From 6d5f8224a50c7d5c65b5b9c88058d5968ea7127e Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 4 Dec 2002 19:50:57 +0000 Subject: [PATCH] Always look up and create the Motif drag window as a child of the root Wed Dec 4 14:31:46 2002 Owen Taylor * gdk/x11/gdkdnd-x11.c: Always look up and create the Motif drag window as a child of the root window of screen 0 rather than the default screen. (#100362, Erwann Chenede) * gdk/x11/gdkdnd-x11.c (motif_read_initiator_info): Return FALSE, not GDK_FILTER_REMOVE on failure; this isn't a filter function. * gdk/x11/gdkselection-x11.c gtk/gtkselection.c: Add some g_return_if_fail() to catch selection == None more gracefully than an X error. --- ChangeLog | 17 ++++++++++++++++- ChangeLog.pre-2-10 | 17 ++++++++++++++++- ChangeLog.pre-2-2 | 17 ++++++++++++++++- ChangeLog.pre-2-4 | 17 ++++++++++++++++- ChangeLog.pre-2-6 | 17 ++++++++++++++++- ChangeLog.pre-2-8 | 17 ++++++++++++++++- gdk/x11/gdkdnd-x11.c | 8 ++++---- gdk/x11/gdkselection-x11.c | 9 +++++++-- gtk/gtkselection.c | 16 ++++++++++++---- 9 files changed, 119 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index eea99f5c19..9217cee41e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,21 @@ +Wed Dec 4 14:31:46 2002 Owen Taylor + + * gdk/x11/gdkdnd-x11.c: Always look up and create the + Motif drag window as a child of the root window of screen 0 + rather than the default screen. (#100362, Erwann Chenede) + + * gdk/x11/gdkdnd-x11.c (motif_read_initiator_info): + Return FALSE, not GDK_FILTER_REMOVE on failure; this + isn't a filter function. + + * gdk/x11/gdkselection-x11.c gtk/gtkselection.c: Add + some g_return_if_fail() to catch selection == None more + gracefully than an X error. + 2002-12-04 Christian Neumair - * src/gtkcellrendertoggle.c: Fixed typo. + * gtk/gtkcellrendertoggle.c: Fixed typo in property + description. Wed Dec 4 12:44:50 2002 Owen Taylor diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index eea99f5c19..9217cee41e 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,6 +1,21 @@ +Wed Dec 4 14:31:46 2002 Owen Taylor + + * gdk/x11/gdkdnd-x11.c: Always look up and create the + Motif drag window as a child of the root window of screen 0 + rather than the default screen. (#100362, Erwann Chenede) + + * gdk/x11/gdkdnd-x11.c (motif_read_initiator_info): + Return FALSE, not GDK_FILTER_REMOVE on failure; this + isn't a filter function. + + * gdk/x11/gdkselection-x11.c gtk/gtkselection.c: Add + some g_return_if_fail() to catch selection == None more + gracefully than an X error. + 2002-12-04 Christian Neumair - * src/gtkcellrendertoggle.c: Fixed typo. + * gtk/gtkcellrendertoggle.c: Fixed typo in property + description. Wed Dec 4 12:44:50 2002 Owen Taylor diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index eea99f5c19..9217cee41e 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,6 +1,21 @@ +Wed Dec 4 14:31:46 2002 Owen Taylor + + * gdk/x11/gdkdnd-x11.c: Always look up and create the + Motif drag window as a child of the root window of screen 0 + rather than the default screen. (#100362, Erwann Chenede) + + * gdk/x11/gdkdnd-x11.c (motif_read_initiator_info): + Return FALSE, not GDK_FILTER_REMOVE on failure; this + isn't a filter function. + + * gdk/x11/gdkselection-x11.c gtk/gtkselection.c: Add + some g_return_if_fail() to catch selection == None more + gracefully than an X error. + 2002-12-04 Christian Neumair - * src/gtkcellrendertoggle.c: Fixed typo. + * gtk/gtkcellrendertoggle.c: Fixed typo in property + description. Wed Dec 4 12:44:50 2002 Owen Taylor diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index eea99f5c19..9217cee41e 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,6 +1,21 @@ +Wed Dec 4 14:31:46 2002 Owen Taylor + + * gdk/x11/gdkdnd-x11.c: Always look up and create the + Motif drag window as a child of the root window of screen 0 + rather than the default screen. (#100362, Erwann Chenede) + + * gdk/x11/gdkdnd-x11.c (motif_read_initiator_info): + Return FALSE, not GDK_FILTER_REMOVE on failure; this + isn't a filter function. + + * gdk/x11/gdkselection-x11.c gtk/gtkselection.c: Add + some g_return_if_fail() to catch selection == None more + gracefully than an X error. + 2002-12-04 Christian Neumair - * src/gtkcellrendertoggle.c: Fixed typo. + * gtk/gtkcellrendertoggle.c: Fixed typo in property + description. Wed Dec 4 12:44:50 2002 Owen Taylor diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index eea99f5c19..9217cee41e 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,6 +1,21 @@ +Wed Dec 4 14:31:46 2002 Owen Taylor + + * gdk/x11/gdkdnd-x11.c: Always look up and create the + Motif drag window as a child of the root window of screen 0 + rather than the default screen. (#100362, Erwann Chenede) + + * gdk/x11/gdkdnd-x11.c (motif_read_initiator_info): + Return FALSE, not GDK_FILTER_REMOVE on failure; this + isn't a filter function. + + * gdk/x11/gdkselection-x11.c gtk/gtkselection.c: Add + some g_return_if_fail() to catch selection == None more + gracefully than an X error. + 2002-12-04 Christian Neumair - * src/gtkcellrendertoggle.c: Fixed typo. + * gtk/gtkcellrendertoggle.c: Fixed typo in property + description. Wed Dec 4 12:44:50 2002 Owen Taylor diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index eea99f5c19..9217cee41e 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,6 +1,21 @@ +Wed Dec 4 14:31:46 2002 Owen Taylor + + * gdk/x11/gdkdnd-x11.c: Always look up and create the + Motif drag window as a child of the root window of screen 0 + rather than the default screen. (#100362, Erwann Chenede) + + * gdk/x11/gdkdnd-x11.c (motif_read_initiator_info): + Return FALSE, not GDK_FILTER_REMOVE on failure; this + isn't a filter function. + + * gdk/x11/gdkselection-x11.c gtk/gtkselection.c: Add + some g_return_if_fail() to catch selection == None more + gracefully than an X error. + 2002-12-04 Christian Neumair - * src/gtkcellrendertoggle.c: Fixed typo. + * gtk/gtkcellrendertoggle.c: Fixed typo in property + description. Wed Dec 4 12:44:50 2002 Owen Taylor diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index 2257444929..44c812c54e 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -784,7 +784,7 @@ motif_lookup_drag_window (GdkDisplay *display, gint format; guchar *data; - XGetWindowProperty (lookup_xdisplay, DefaultRootWindow (lookup_xdisplay), + XGetWindowProperty (lookup_xdisplay, RootWindow (lookup_xdisplay, 0), gdk_x11_get_xatom_by_name_for_display (display, "_MOTIF_DRAG_WINDOW"), 0, 1, FALSE, XA_WINDOW, &type, &format, &nitems, &bytes_after, @@ -837,7 +837,7 @@ motif_find_drag_window (GdkDisplay *display, display_x11->motif_drag_window = XCreateWindow (persistant_xdisplay, - DefaultRootWindow (persistant_xdisplay), + RootWindow (persistant_xdisplay, 0), -100, -100, 10, 10, 0, 0, InputOnly, CopyFromParent, (CWOverrideRedirect | CWEventMask), &attr); @@ -846,7 +846,7 @@ motif_find_drag_window (GdkDisplay *display, g_message ("Created drag window %#lx\n", display_x11->motif_drag_window)); XChangeProperty (persistant_xdisplay, - DefaultRootWindow (persistant_xdisplay), + RootWindow (persistant_xdisplay, 0), motif_drag_window_atom, XA_WINDOW, 32, PropModeReplace, (guchar *)&motif_drag_window_atom, 1); @@ -1466,7 +1466,7 @@ motif_read_initiator_info (GdkDisplay *display, { g_warning ("Invalid target index in TOP_LEVEL_ENTER MESSAGE"); XFree (initiator_info); - return GDK_FILTER_REMOVE; + return FALSE; } tmp_list = g_list_last (display_x11->motif_target_lists[initiator_info->targets_index]); diff --git a/gdk/x11/gdkselection-x11.c b/gdk/x11/gdkselection-x11.c index 5a83ccdbc1..859fca7c67 100644 --- a/gdk/x11/gdkselection-x11.c +++ b/gdk/x11/gdkselection-x11.c @@ -132,6 +132,7 @@ gdk_selection_owner_set_for_display (GdkDisplay *display, OwnerInfo *info; g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); + g_return_val_if_fail (selection != GDK_NONE, FALSE); if (display->closed) return FALSE; @@ -202,8 +203,10 @@ gdk_selection_owner_get_for_display (GdkDisplay *display, GdkAtom selection) { Window xwindow; + g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); - + g_return_val_if_fail (selection != GDK_NONE, NULL); + if (display->closed) return NULL; @@ -223,6 +226,8 @@ gdk_selection_convert (GdkWindow *requestor, guint32 time) { GdkDisplay *display; + + g_return_if_fail (selection != GDK_NONE); if (GDK_WINDOW_DESTROYED (requestor)) return; @@ -390,7 +395,7 @@ gdk_selection_send_notify_for_display (GdkDisplay *display, XSelectionEvent xevent; g_return_if_fail (GDK_IS_DISPLAY (display)); - + xevent.type = SelectionNotify; xevent.serial = 0; xevent.send_event = True; diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c index 700494ff2c..e0bf168a4c 100644 --- a/gtk/gtkselection.c +++ b/gtk/gtkselection.c @@ -321,6 +321,7 @@ gtk_selection_owner_set_for_display (GdkDisplay *display, GdkWindow *window; g_return_val_if_fail (GDK_IS_DISPLAY (display), FALSE); + g_return_val_if_fail (selection != GDK_NONE, FALSE); g_return_val_if_fail (widget == NULL || GTK_WIDGET_REALIZED (widget), FALSE); g_return_val_if_fail (widget == NULL || gtk_widget_get_display (widget) == display, FALSE); @@ -416,6 +417,7 @@ gtk_selection_owner_set (GtkWidget *widget, GdkDisplay *display; g_return_val_if_fail (widget == NULL || GTK_WIDGET_REALIZED (widget), FALSE); + g_return_val_if_fail (selection != GDK_NONE, FALSE); if (widget) display = gtk_widget_get_display (widget); @@ -520,6 +522,9 @@ gtk_selection_clear_targets (GtkWidget *widget, GList *tmp_list; GList *lists; + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (selection != GDK_NONE); + lists = g_object_get_data (G_OBJECT (widget), gtk_selection_handler_key); tmp_list = lists; @@ -549,7 +554,8 @@ gtk_selection_add_target (GtkWidget *widget, { GtkTargetList *list; - g_return_if_fail (widget != NULL); + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (selection != GDK_NONE); list = gtk_selection_target_list_get (widget, selection); gtk_target_list_add (list, target, 0, info); @@ -562,8 +568,9 @@ gtk_selection_add_targets (GtkWidget *widget, guint ntargets) { GtkTargetList *list; - - g_return_if_fail (widget != NULL); + + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (selection != GDK_NONE); g_return_if_fail (targets != NULL); list = gtk_selection_target_list_get (widget, selection); @@ -661,7 +668,8 @@ gtk_selection_convert (GtkWidget *widget, GdkWindow *owner_window; GdkDisplay *display; - g_return_val_if_fail (widget != NULL, FALSE); + g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE); + g_return_val_if_fail (selection != GDK_NONE, FALSE); if (initialize) gtk_selection_init ();