[gtk+] Use gdk_error_trap_pop_ignore() where appropriate



commit 1243b4861c6b959b1ca4ebb724e3d82f61d78a78
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Sep 18 23:17:31 2010 -0400

    Use gdk_error_trap_pop_ignore() where appropriate

 gtk/gtkplug.c         |    2 +-
 gtk/gtkselection.c    |    4 ++--
 gtk/gtksocket-x11.c   |   16 ++++++++--------
 gtk/gtksocket.c       |    8 ++++----
 gtk/gtktrayicon-x11.c |    4 ++--
 gtk/gtkxembed.c       |    2 +-
 6 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtkplug.c b/gtk/gtkplug.c
index c31f070..9496edb 100644
--- a/gtk/gtkplug.c
+++ b/gtk/gtkplug.c
@@ -684,7 +684,7 @@ gtk_plug_realize (GtkWidget *widget)
 	  gdk_error_trap_push ();
 	  gdk_window_destroy (gdk_window);
 	  gdk_flush ();
-	  gdk_error_trap_pop ();
+	  gdk_error_trap_pop_ignored ();
 	  gdk_window = gdk_window_new (gtk_widget_get_root_window (widget),
                                    &attributes, attributes_mask);
           gtk_widget_set_window (widget, gdk_window);
diff --git a/gtk/gtkselection.c b/gtk/gtkselection.c
index ed618f8..3323521 100644
--- a/gtk/gtkselection.c
+++ b/gtk/gtkselection.c
@@ -2298,10 +2298,10 @@ _gtk_selection_request (GtkWidget *widget,
 						 event->time);
 	  g_free (mult_atoms);
 	  g_slice_free (GtkIncrInfo, info);
-          gdk_error_trap_pop ();
+          gdk_error_trap_pop_ignored ();
 	  return TRUE;
 	}
-      gdk_error_trap_pop ();
+      gdk_error_trap_pop_ignored ();
 
       /* This is annoying; the ICCCM doesn't specify the property type
        * used for the property contents, so the autoconversion for
diff --git a/gtk/gtksocket-x11.c b/gtk/gtksocket-x11.c
index 6d1e626..f5b217b 100644
--- a/gtk/gtksocket-x11.c
+++ b/gtk/gtksocket-x11.c
@@ -120,7 +120,7 @@ _gtk_socket_windowing_size_request (GtkSocket *socket)
     }
   socket->have_size = TRUE;
   
-  gdk_error_trap_pop ();
+  gdk_error_trap_pop_ignored ();
 }
 
 void
@@ -152,7 +152,7 @@ _gtk_socket_windowing_send_key_event (GtkSocket *socket,
 	      (mask_key_presses ? KeyPressMask : NoEventMask),
 	      (XEvent *)&xkey);
   gdk_display_sync (gdk_screen_get_display (screen));
-  gdk_error_trap_pop ();
+  gdk_error_trap_pop_ignored ();
 }
 
 void
@@ -229,7 +229,7 @@ _gtk_socket_windowing_send_configure_event (GtkSocket *socket)
    */
   gdk_error_trap_push ();
   gdk_window_get_origin (socket->plug_window, &x, &y);
-  gdk_error_trap_pop ();
+  gdk_error_trap_pop_ignored ();
 
   gtk_widget_get_allocation (GTK_WIDGET(socket), &allocation);
   xconfigure.x = x;
@@ -246,7 +246,7 @@ _gtk_socket_windowing_send_configure_event (GtkSocket *socket)
 	      GDK_WINDOW_XWINDOW (socket->plug_window),
 	      False, NoEventMask, (XEvent *)&xconfigure);
   gdk_display_sync (gtk_widget_get_display (GTK_WIDGET (socket)));
-  gdk_error_trap_pop ();
+  gdk_error_trap_pop_ignored ();
 }
 
 void
@@ -306,14 +306,14 @@ xembed_get_info (GdkWindow     *window,
   unsigned long *data_long;
   int status;
   
-  gdk_error_trap_push();
+  gdk_error_trap_push ();
   status = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
 			       GDK_WINDOW_XWINDOW (window),
 			       xembed_info_atom,
 			       0, 2, False,
 			       xembed_info_atom, &type, &format,
 			       &nitems, &bytes_after, &data);
-  gdk_error_trap_pop();
+  gdk_error_trap_pop_ignored ();
 
   if (status != Success)
     return FALSE;		/* Window vanished? */
@@ -576,7 +576,7 @@ _gtk_socket_windowing_filter_func (GdkXEvent *gdk_xevent,
 					 protocol, TRUE);
 
 	      gdk_display_sync (display);
-	      gdk_error_trap_pop ();
+	      gdk_error_trap_pop_ignored ();
 	      return_val = GDK_FILTER_REMOVE;
 	    }
 	  else if (xevent->xproperty.atom == gdk_x11_get_xatom_by_name_for_display (display, "_XEMBED_INFO"))
@@ -597,7 +597,7 @@ _gtk_socket_windowing_filter_func (GdkXEvent *gdk_xevent,
 			  gdk_error_trap_push ();
 			  gdk_window_show (socket->plug_window);
 			  gdk_flush ();
-			  gdk_error_trap_pop ();
+			  gdk_error_trap_pop_ignored ();
 			  
 			  _gtk_socket_unmap_notify (socket);
 			}
diff --git a/gtk/gtksocket.c b/gtk/gtksocket.c
index 36d3119..3d4d99b 100644
--- a/gtk/gtksocket.c
+++ b/gtk/gtksocket.c
@@ -543,7 +543,7 @@ gtk_socket_size_allocate (GtkWidget     *widget,
  	    }
 	  
 	  gdk_display_sync (gtk_widget_get_display (widget));
-	  gdk_error_trap_pop ();
+	  gdk_error_trap_pop_ignored ();
 	}
     }
 }
@@ -863,7 +863,7 @@ _gtk_socket_add_window (GtkSocket       *socket,
 	{
 	  g_warning (G_STRLOC ": Can't add non-GtkPlug to GtkSocket");
 	  socket->plug_window = NULL;
-	  gdk_error_trap_pop ();
+	  gdk_error_trap_pop_ignored ();
 	  
 	  return;
 	}
@@ -882,7 +882,7 @@ _gtk_socket_add_window (GtkSocket       *socket,
 	  socket->plug_window = gdk_window_foreign_new_for_display (display, xid);
 	  if (!socket->plug_window) /* was deleted before we could get it */
 	    {
-	      gdk_error_trap_pop ();
+	      gdk_error_trap_pop_ignored ();
 	      return;
 	    }
 	}
@@ -919,7 +919,7 @@ _gtk_socket_add_window (GtkSocket       *socket,
 				 protocol, TRUE);
 
       gdk_display_sync (display);
-      gdk_error_trap_pop ();
+      gdk_error_trap_pop_ignored ();
 
       gdk_window_add_filter (socket->plug_window,
 			     _gtk_socket_windowing_filter_func,
diff --git a/gtk/gtktrayicon-x11.c b/gtk/gtktrayicon-x11.c
index 5575277..6e34a6b 100644
--- a/gtk/gtktrayicon-x11.c
+++ b/gtk/gtktrayicon-x11.c
@@ -695,7 +695,7 @@ gtk_tray_icon_send_manager_message (GtkTrayIcon *icon,
   XSendEvent (display,
 	      icon->priv->manager_window, False, NoEventMask, (XEvent *)&ev);
   gdk_display_sync (gtk_widget_get_display (widget));
-  gdk_error_trap_pop ();
+  gdk_error_trap_pop_ignored ();
 }
 
 static void
@@ -952,7 +952,7 @@ _gtk_tray_icon_send_message (GtkTrayIcon *icon,
 		  StructureNotifyMask, (XEvent *)&ev);
     }
   gdk_display_sync (gtk_widget_get_display (GTK_WIDGET (icon)));
-  gdk_error_trap_pop ();
+  gdk_error_trap_pop_ignored ();
 
   return stamp;
 }
diff --git a/gtk/gtkxembed.c b/gtk/gtkxembed.c
index d5ab3bf..6979371 100644
--- a/gtk/gtkxembed.c
+++ b/gtk/gtkxembed.c
@@ -167,7 +167,7 @@ _gtk_xembed_send_message (GdkWindow        *recipient,
 	      GDK_WINDOW_XWINDOW (recipient),
 	      False, NoEventMask, (XEvent *)&xclient);
   gdk_display_sync (display);
-  gdk_error_trap_pop ();
+  gdk_error_trap_pop_ignored ();
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]