summaryrefslogtreecommitdiff
path: root/gdk/x11/gdkdisplay-x11.h
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>2010-09-18 18:19:27 -0400
committerMatthias Clasen <mclasen@redhat.com>2010-09-18 18:19:27 -0400
commitb837ef5a6d2ce003eae3dd558ac1ac9934e9d72c (patch)
tree8d5416d1b998fbd158491b29ce6e1bb09fbd33e1 /gdk/x11/gdkdisplay-x11.h
parent4f3e5e6ebc837d2f805efc73d79cbd2d0a9df4f7 (diff)
downloadgtk+-b837ef5a6d2ce003eae3dd558ac1ac9934e9d72c.tar.gz
Revamp and modernize X error traps
* add per-display gdk_x11_display_error_trap_push() (X11-specific because gdk_error_trap_push() probably should have been) * make gdk_error_trap_push() handle only GDK displays not displays opened without a GDK wrapper * make gdk_error_trap_pop() and gdk_x11_display_error_trap_pop() automatically sync only if needed, so manual gdk_flush() is not required * add gdk_error_trap_pop_ignored() which just asynchronously ignores errors, so never needs to sync * add G_GNUC_WARN_UNUSED_RESULT to plain pop(), because if you use plain pop() and don't need the return value, the async gdk_error_trap_pop_ignored() should be used instead. This results in lots of warnings to clean up in a later patch. The main objective here was to avoid the need to sync just to ignore an error. Now, syncing is automatic, and only happens when we need to know the error code. https://bugzilla.gnome.org/show_bug.cgi?id=629608
Diffstat (limited to 'gdk/x11/gdkdisplay-x11.h')
-rw-r--r--gdk/x11/gdkdisplay-x11.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gdk/x11/gdkdisplay-x11.h b/gdk/x11/gdkdisplay-x11.h
index 87496d4321..b4036cb591 100644
--- a/gdk/x11/gdkdisplay-x11.h
+++ b/gdk/x11/gdkdisplay-x11.h
@@ -141,6 +141,8 @@ struct _GdkDisplayX11
/* The offscreen window that has the pointer in it (if any) */
GdkWindow *active_offscreen_window;
+
+ GSList *error_traps;
};
struct _GdkDisplayX11Class
@@ -149,8 +151,10 @@ struct _GdkDisplayX11Class
};
GType _gdk_display_x11_get_type (void);
-GdkScreen *_gdk_x11_display_screen_for_xrootwin (GdkDisplay *display,
- Window xrootwin);
+GdkScreen *_gdk_x11_display_screen_for_xrootwin (GdkDisplay *display,
+ Window xrootwin);
+void _gdk_x11_display_error_event (GdkDisplay *display,
+ XErrorEvent *error);
G_END_DECLS