summaryrefslogtreecommitdiff
path: root/maximus/maximus-app.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-05-11 15:08:49 +0300
committermonsta <[email protected]>2017-05-14 14:13:09 +0300
commit78d2c87c7a37fda1a18f654567e5497e4a8030fc (patch)
tree7ee3e23e5c787be489f709243c7797c7403af5c4 /maximus/maximus-app.c
parentb9e04a89438db9e98d1a6fe9287bedef9ebaab24 (diff)
downloadmate-netbook-78d2c87c7a37fda1a18f654567e5497e4a8030fc.tar.bz2
mate-netbook-78d2c87c7a37fda1a18f654567e5497e4a8030fc.tar.xz
maximus: don't crash on invalid window ID
fixes https://github.com/mate-desktop/mate-netbook/issues/5
Diffstat (limited to 'maximus/maximus-app.c')
-rw-r--r--maximus/maximus-app.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/maximus/maximus-app.c b/maximus/maximus-app.c
index f6ee627..74ba5bd 100644
--- a/maximus/maximus-app.c
+++ b/maximus/maximus-app.c
@@ -149,11 +149,14 @@ 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 ();
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 ())
+ return;
if (type != hints_atom || !data)
hints = new_hints;
@@ -366,7 +369,11 @@ on_window_opened (WnckScreen *screen,
return;
/* Ignore undecorated windows */
+ gdk_error_trap_push ();
exclude = wnck_window_is_decorated (window) ? 0 : 1;
+ if (gdk_error_trap_pop ())
+ return;
+
if (wnck_window_is_maximized (window))
exclude = 0;
g_object_set_data (G_OBJECT (window), "exclude", GINT_TO_POINTER (exclude));