summaryrefslogtreecommitdiff
path: root/maximus
diff options
context:
space:
mode:
Diffstat (limited to 'maximus')
-rw-r--r--maximus/main.c5
-rw-r--r--maximus/maximus-app.c23
-rw-r--r--maximus/tomboykeybinder.c9
-rw-r--r--maximus/xutils.c7
4 files changed, 25 insertions, 19 deletions
diff --git a/maximus/main.c b/maximus/main.c
index b271cd2..267cc0a 100644
--- a/maximus/main.c
+++ b/maximus/main.c
@@ -64,6 +64,7 @@ gint main (gint argc, gchar *argv[])
MaximusApp UNUSED_VARIABLE *app;
GOptionContext *context;
GError *error = NULL;
+ GdkDisplay *gdk_display = gdk_display_get_default ();
g_set_application_name ("Maximus");
@@ -89,9 +90,9 @@ gint main (gint argc, gchar *argv[])
g_option_context_parse (context, &argc, &argv, NULL);
g_option_context_free(context);
- gdk_error_trap_push ();
+ gdk_x11_display_error_trap_push (gdk_display);
app = maximus_app_get_default ();
- gdk_error_trap_pop_ignored ();
+ gdk_x11_display_error_trap_pop_ignored (gdk_display);
gtk_main ();
diff --git a/maximus/maximus-app.c b/maximus/maximus-app.c
index 672393c..c451039 100644
--- a/maximus/maximus-app.c
+++ b/maximus/maximus-app.c
@@ -149,13 +149,13 @@ gdk_window_set_mwm_hints (WnckWindow *window,
hints_atom = gdk_x11_get_xatom_by_name_for_display (display,
_XA_MOTIF_WM_HINTS);
- gdk_error_trap_push ();
+ gdk_x11_display_error_trap_push (display);
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display),
wnck_window_get_xid (window),
hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
&bytes_after, &data);
- if (gdk_error_trap_pop ())
+ if (gdk_x11_display_error_trap_pop (display))
return;
if (type != hints_atom || !data)
@@ -181,7 +181,7 @@ gdk_window_set_mwm_hints (WnckWindow *window,
wnck_window_get_xid (window),
hints_atom, hints_atom, 32, PropModeReplace,
(guchar *)hints, sizeof (MotifWmHints)/sizeof (long));
- gdk_flush ();
+ gdk_display_flush (display);
_wnck_error_trap_pop ();
if (data)
@@ -359,6 +359,7 @@ on_window_opened (WnckScreen *screen,
MaximusAppPrivate *priv;
WnckWindowType type;
gint exclude = 0;
+ GdkDisplay *gdk_display = gdk_display_get_default ();
g_return_if_fail (MAXIMUS_IS_APP (app));
g_return_if_fail (WNCK_IS_WINDOW (window));
@@ -369,9 +370,9 @@ on_window_opened (WnckScreen *screen,
return;
/* Ignore undecorated windows */
- gdk_error_trap_push ();
+ gdk_x11_display_error_trap_push (gdk_display);
exclude = wnck_window_is_decorated (window) ? 0 : 1;
- if (gdk_error_trap_pop ())
+ if (gdk_x11_display_error_trap_pop (gdk_display))
return;
if (wnck_window_is_maximized (window))
@@ -390,7 +391,7 @@ on_window_opened (WnckScreen *screen,
if (wnck_window_is_maximized(window) && priv->undecorate)
{
_window_set_decorations (window, 0);
- gdk_flush ();
+ gdk_display_flush (gdk_display);
}
g_signal_connect (window, "state-changed",
G_CALLBACK (on_window_state_changed), app);
@@ -403,7 +404,7 @@ on_window_opened (WnckScreen *screen,
if (!window_is_too_large_for_screen (window))
{
_window_set_decorations (window, 0);
- gdk_flush ();
+ gdk_display_flush (gdk_display);
}
}
@@ -483,12 +484,14 @@ on_app_undecorate_changed (GSettings *settings,
if (!is_excluded (app, window))
{
- gdk_error_trap_push ();
+ GdkDisplay *gdk_display = gdk_display_get_default ();
+
+ gdk_x11_display_error_trap_push (gdk_display);
_window_set_decorations (window, priv->undecorate ? 0 : 1);
wnck_window_unmaximize (window);
wnck_window_maximize (window);
- gdk_flush ();
- gdk_error_trap_pop_ignored ();
+ gdk_display_flush (gdk_display);
+ gdk_x11_display_error_trap_pop_ignored (gdk_display);
sleep (1);
}
diff --git a/maximus/tomboykeybinder.c b/maximus/tomboykeybinder.c
index 261dcb7..79ce6df 100644
--- a/maximus/tomboykeybinder.c
+++ b/maximus/tomboykeybinder.c
@@ -102,7 +102,8 @@ grab_ungrab_with_ignorable_modifiers (GdkWindow *rootwin,
static gboolean
do_grab_key (Binding *binding)
{
- GdkKeymap *keymap = gdk_keymap_get_for_display (gdk_display_get_default ());
+ GdkDisplay *gdk_display = gdk_display_get_default ();
+ GdkKeymap *keymap = gdk_keymap_get_for_display (gdk_display);
GdkWindow *rootwin = gdk_get_default_root_window ();
EggVirtualModifierType virtual_mods = 0;
@@ -131,15 +132,15 @@ do_grab_key (Binding *binding)
TRACE (g_print ("Got modmask %d\n", binding->modifiers));
- gdk_error_trap_push ();
+ gdk_x11_display_error_trap_push (gdk_display);
grab_ungrab_with_ignorable_modifiers (rootwin,
binding,
TRUE /* grab */);
- gdk_flush ();
+ gdk_display_flush (gdk_display);
- if (gdk_error_trap_pop ()) {
+ if (gdk_x11_display_error_trap_pop (gdk_display)) {
g_warning ("Binding '%s' failed!\n", binding->keystring);
return FALSE;
}
diff --git a/maximus/xutils.c b/maximus/xutils.c
index 1ca894a..85b09e6 100644
--- a/maximus/xutils.c
+++ b/maximus/xutils.c
@@ -37,14 +37,15 @@
void
_wnck_error_trap_push (void)
{
- gdk_error_trap_push ();
+ gdk_x11_display_error_trap_push (gdk_display_get_default ());
}
int
_wnck_error_trap_pop (void)
{
- XSync (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), False);
- return gdk_error_trap_pop ();
+ GdkDisplay *gdk_display = gdk_display_get_default ();
+ XSync (GDK_DISPLAY_XDISPLAY (gdk_display), False);
+ return gdk_x11_display_error_trap_pop (gdk_display);
}
static char*