From 250aa6b573bc495efe96dad816267daf65182a3c Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Wed, 15 Jan 2014 17:03:00 +0100 Subject: maximus: Add GTK3 support --- maximus/eggaccelerators.c | 3 +++ maximus/eggaccelerators.h | 2 +- maximus/tomboykeybinder.c | 8 ++++++-- maximus/xutils.c | 11 ++++++++++- 4 files changed, 20 insertions(+), 4 deletions(-) (limited to 'maximus') diff --git a/maximus/eggaccelerators.c b/maximus/eggaccelerators.c index 5410259..d914811 100644 --- a/maximus/eggaccelerators.c +++ b/maximus/eggaccelerators.c @@ -22,6 +22,9 @@ #include #include #include +#if GTK_CHECK_VERSION (3, 0, 0) +#include +#endif enum { diff --git a/maximus/eggaccelerators.h b/maximus/eggaccelerators.h index 18e3ae0..282f146 100644 --- a/maximus/eggaccelerators.h +++ b/maximus/eggaccelerators.h @@ -20,7 +20,7 @@ #ifndef __EGG_ACCELERATORS_H__ #define __EGG_ACCELERATORS_H__ -#include +#include #include G_BEGIN_DECLS diff --git a/maximus/tomboykeybinder.c b/maximus/tomboykeybinder.c index 0c50cc0..e84a586 100644 --- a/maximus/tomboykeybinder.c +++ b/maximus/tomboykeybinder.c @@ -86,7 +86,7 @@ grab_ungrab_with_ignorable_modifiers (GdkWindow *rootwin, XGrabKey (GDK_WINDOW_XDISPLAY (rootwin), binding->keycode, binding->modifiers | mod_masks [i], - GDK_WINDOW_XWINDOW (rootwin), + GDK_WINDOW_XID (rootwin), False, GrabModeAsync, GrabModeAsync); @@ -94,7 +94,7 @@ grab_ungrab_with_ignorable_modifiers (GdkWindow *rootwin, XUngrabKey (GDK_WINDOW_XDISPLAY (rootwin), binding->keycode, binding->modifiers | mod_masks [i], - GDK_WINDOW_XWINDOW (rootwin)); + GDK_WINDOW_XID (rootwin)); } } } @@ -309,7 +309,11 @@ tomboy_keybinder_is_modifier (guint keycode) XModifierKeymap *mod_keymap; gboolean retval = FALSE; +#if GTK_CHECK_VERSION (3, 0, 0) + mod_keymap = XGetModifierMapping (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())); +#else mod_keymap = XGetModifierMapping (gdk_display); +#endif map_size = 8 * mod_keymap->max_keypermod; diff --git a/maximus/xutils.c b/maximus/xutils.c index 3ff03bb..b082ced 100644 --- a/maximus/xutils.c +++ b/maximus/xutils.c @@ -43,7 +43,11 @@ _wnck_error_trap_push (void) int _wnck_error_trap_pop (void) { +#if GTK_CHECK_VERSION (3, 0, 0) + XSync (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), False); +#else XSync (gdk_display, False); +#endif return gdk_error_trap_pop (); } @@ -78,7 +82,12 @@ _wnck_get_wmclass (Window xwindow, ch.res_name = NULL; ch.res_class = NULL; - XGetClassHint (gdk_display, xwindow, +#if GTK_CHECK_VERSION (3, 0, 0) + XGetClassHint (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), +#else + XGetClassHint (gdk_display, +#endif + xwindow, &ch); _wnck_error_trap_pop (); -- cgit v1.2.1