Commit 4251a51e authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

Patch from Erwann Chenede.

Thu Jun 20 15:53:21 2002  Owen Taylor  <otaylor@redhat.com>

	Patch from Erwann Chenede.

	* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkprivate-x11.h:
	Introduce a yes/no/unknown GdkTristate, use it
	in a couple of places. (#79962)

	* gdk/x11/gdkwindow-x11.c gdk/x11/gdkdisplay-x11.h: Make
	gravity_works per-display. (#79963)
parent 511d536a
Thu Jun 20 15:53:21 2002 Owen Taylor <otaylor@redhat.com>
Patch from Erwann Chenede.
* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkprivate-x11.h:
Introduce a yes/no/unknown GdkTristate, use it
in a couple of places. (#79962)
* gdk/x11/gdkwindow-x11.c gdk/x11/gdkdisplay-x11.h: Make
gravity_works per-display. (#79963)
Thu Jun 20 15:36:40 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_owner_set): Get
......
Thu Jun 20 15:53:21 2002 Owen Taylor <otaylor@redhat.com>
Patch from Erwann Chenede.
* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkprivate-x11.h:
Introduce a yes/no/unknown GdkTristate, use it
in a couple of places. (#79962)
* gdk/x11/gdkwindow-x11.c gdk/x11/gdkdisplay-x11.h: Make
gravity_works per-display. (#79963)
Thu Jun 20 15:36:40 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_owner_set): Get
......
Thu Jun 20 15:53:21 2002 Owen Taylor <otaylor@redhat.com>
Patch from Erwann Chenede.
* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkprivate-x11.h:
Introduce a yes/no/unknown GdkTristate, use it
in a couple of places. (#79962)
* gdk/x11/gdkwindow-x11.c gdk/x11/gdkdisplay-x11.h: Make
gravity_works per-display. (#79963)
Thu Jun 20 15:36:40 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_owner_set): Get
......
Thu Jun 20 15:53:21 2002 Owen Taylor <otaylor@redhat.com>
Patch from Erwann Chenede.
* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkprivate-x11.h:
Introduce a yes/no/unknown GdkTristate, use it
in a couple of places. (#79962)
* gdk/x11/gdkwindow-x11.c gdk/x11/gdkdisplay-x11.h: Make
gravity_works per-display. (#79963)
Thu Jun 20 15:36:40 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_owner_set): Get
......
Thu Jun 20 15:53:21 2002 Owen Taylor <otaylor@redhat.com>
Patch from Erwann Chenede.
* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkprivate-x11.h:
Introduce a yes/no/unknown GdkTristate, use it
in a couple of places. (#79962)
* gdk/x11/gdkwindow-x11.c gdk/x11/gdkdisplay-x11.h: Make
gravity_works per-display. (#79963)
Thu Jun 20 15:36:40 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_owner_set): Get
......
Thu Jun 20 15:53:21 2002 Owen Taylor <otaylor@redhat.com>
Patch from Erwann Chenede.
* gdk/x11/gdkdisplay-x11.[ch] gdk/x11/gdkprivate-x11.h:
Introduce a yes/no/unknown GdkTristate, use it
in a couple of places. (#79962)
* gdk/x11/gdkwindow-x11.c gdk/x11/gdkdisplay-x11.h: Make
gravity_works per-display. (#79963)
Thu Jun 20 15:36:40 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_selection_owner_set): Get
......
......@@ -132,8 +132,9 @@ gdk_open_display (const gchar *display_name)
display_x11->default_screen = display_x11->screens[DefaultScreen (display_x11->xdisplay)];
display_x11->leader_window = XCreateSimpleWindow (display_x11->xdisplay,
GDK_SCREEN_X11 (display_x11->default_screen)->xroot_window,
10, 10, 10, 10, 0, 0, 0);
10, 10, 10, 10, 0, 0, 0);
display_x11->have_shape = GDK_UNKNOWN;
display_x11->gravity_works = GDK_UNKNOWN;
if (_gdk_synchronize)
XSynchronize (display_x11->xdisplay, True);
......@@ -198,6 +199,8 @@ gdk_open_display (const gchar *display_name)
_gdk_input_init (display);
_gdk_dnd_init (display);
g_signal_emit_by_name (gdk_library_get(), "display_opened", display);
return display;
}
......
......@@ -44,6 +44,13 @@ typedef struct _GdkDisplayX11Class GdkDisplayX11Class;
#define GDK_IS_DISPLAY_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DISPLAY_X11))
#define GDK_DISPLAY_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DISPLAY_X11, GdkDisplayX11Class))
typedef enum
{
GDK_UNKNOWN,
GDK_NO,
GDK_YES
} GdkTristate;
struct _GdkDisplayX11
{
GdkDisplay parent_instance;
......@@ -68,7 +75,8 @@ struct _GdkDisplayX11
gboolean use_xshm;
gboolean have_shm_pixmaps;
gint have_shape;
GdkTristate have_shape;
GdkTristate gravity_works;
/* Information about current pointer and keyboard grabs held by this
* client. If gdk_pointer_xgrab_window or gdk_keyboard_xgrab_window
......
......@@ -2666,23 +2666,22 @@ gdk_window_add_colormap_windows (GdkWindow *window)
static gboolean
gdk_window_have_shape_ext (GdkDisplay *display)
{
enum { UNKNOWN, NO, YES };
GdkDisplayX11 *display_x11;
g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE);
display_x11 = GDK_DISPLAY_X11 (display);
if (display_x11->have_shape == UNKNOWN)
if (display_x11->have_shape == GDK_UNKNOWN)
{
int ignore;
if (XQueryExtension (display_x11->xdisplay, "SHAPE", &ignore, &ignore, &ignore))
display_x11->have_shape = YES;
display_x11->have_shape = GDK_YES;
else
display_x11->have_shape = NO;
display_x11->have_shape = GDK_NO;
}
return (display_x11->have_shape == YES);
return (display_x11->have_shape == GDK_YES);
}
#define WARN_SHAPE_TOO_BIG() g_warning ("GdkWindow is too large to allow the use of shape masks or shape regions.")
......@@ -3943,11 +3942,9 @@ gdk_window_merge_child_shapes (GdkWindow *window)
static gboolean
gdk_window_gravity_works (GdkWindow *window)
{
enum { UNKNOWN, NO, YES };
static gint gravity_works = UNKNOWN;
GdkDisplay *display = GDK_DRAWABLE_DISPLAY (window);
GdkDisplayX11 *display_x11 = GDK_DISPLAY_X11 (GDK_DRAWABLE_DISPLAY (window));
if (gravity_works == UNKNOWN)
if (display_x11->gravity_works == GDK_UNKNOWN)
{
GdkWindowAttr attr;
GdkWindow *parent;
......@@ -3957,11 +3954,11 @@ gdk_window_gravity_works (GdkWindow *window)
/* This particular server apparently has a bug so that the test
* works but the actual code crashes it
*/
if ((!strcmp (XServerVendor (GDK_DISPLAY_XDISPLAY (display)),
if ((!strcmp (XServerVendor (display_x11->xdisplay),
"Sun Microsystems, Inc.")) &&
(VendorRelease (GDK_DISPLAY_XDISPLAY (display)) == 3400))
(VendorRelease (display_x11->xdisplay) == 3400))
{
gravity_works = NO;
display_x11->gravity_works = GDK_NO;
return FALSE;
}
......@@ -3995,10 +3992,10 @@ gdk_window_gravity_works (GdkWindow *window)
gdk_window_destroy (parent);
gdk_window_destroy (child);
gravity_works = ((y == -20) ? YES : NO);
display_x11->gravity_works = ((y == -20) ? GDK_YES : GDK_NO);
}
return (gravity_works == YES);
return (display_x11->gravity_works == GDK_YES);
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment