diff options
author | monsta <[email protected]> | 2017-05-11 15:08:49 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2017-05-14 13:55:59 +0300 |
commit | d0c6d2f15e9b5148c932a6d7f89be86754198e26 (patch) | |
tree | a740005ecfe82b8f7a342ff8e2a8efc3967bf611 | |
parent | 6029f5d6fbdee6b861eb872456ab1c20baf06d7b (diff) | |
download | mate-netbook-d0c6d2f15e9b5148c932a6d7f89be86754198e26.tar.bz2 mate-netbook-d0c6d2f15e9b5148c932a6d7f89be86754198e26.tar.xz |
maximus: don't crash on invalid window ID
fixes https://github.com/mate-desktop/mate-netbook/issues/5
-rw-r--r-- | maximus/maximus-app.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/maximus/maximus-app.c b/maximus/maximus-app.c index a08278b..9b1120f 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)); |