summaryrefslogtreecommitdiff
path: root/src/core/errors.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-24 11:29:35 +0100
committerStefano Karapetsas <[email protected]>2014-01-24 11:29:35 +0100
commite7548428cd64022b6b1c39265e0a6fa63a7f78d8 (patch)
tree2498643b6a28423227df1880ff7f16887583b5d5 /src/core/errors.c
parente7f50837683fc30d29768ce6b00e0b1c6b476b48 (diff)
downloadmarco-e7548428cd64022b6b1c39265e0a6fa63a7f78d8.tar.bz2
marco-e7548428cd64022b6b1c39265e0a6fa63a7f78d8.tar.xz
core: Improve GTK3 support
Diffstat (limited to 'src/core/errors.c')
-rw-r--r--src/core/errors.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/core/errors.c b/src/core/errors.c
index c603ccfd..fc89e096 100644
--- a/src/core/errors.c
+++ b/src/core/errors.c
@@ -28,6 +28,7 @@
#include <errno.h>
#include <stdlib.h>
#include <gdk/gdk.h>
+#include <gtk/gtk.h>
#ifdef __GNUC__
#define UNUSED_VARIABLE __attribute__ ((unused))
@@ -35,17 +36,51 @@
#define UNUSED_VARIABLE
#endif
+#if !GTK_CHECK_VERSION (3, 0, 0)
static int x_error_handler (Display *display,
XErrorEvent *error);
static int x_io_error_handler (Display *display);
+#endif
void
meta_errors_init (void)
{
+#if !GTK_CHECK_VERSION (3, 0, 0)
XSetErrorHandler (x_error_handler);
XSetIOErrorHandler (x_io_error_handler);
+#endif
+}
+
+#if GTK_CHECK_VERSION (3, 0, 0)
+
+void
+meta_error_trap_push (MetaDisplay *display)
+{
+ gdk_error_trap_push ();
+}
+
+void
+meta_error_trap_pop (MetaDisplay *display,
+ gboolean last_request_was_roundtrip)
+{
+ gdk_error_trap_pop_ignored ();
}
+void
+meta_error_trap_push_with_return (MetaDisplay *display)
+{
+ gdk_error_trap_push ();
+}
+
+int
+meta_error_trap_pop_with_return (MetaDisplay *display,
+ gboolean last_request_was_roundtrip)
+{
+ return gdk_error_trap_pop ();
+}
+
+#else
+
typedef struct ForeignDisplay ForeignDisplay;
struct ForeignDisplay
@@ -292,3 +327,5 @@ x_io_error_handler (Display *xdisplay)
return 0;
}
+
+#endif