diff options
author | monsta <[email protected]> | 2017-05-11 15:08:49 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2017-05-14 13:55:14 +0300 |
commit | 18a191d3a4fa910680e084e88cd04db3ade01c0e (patch) | |
tree | e36c19ac09a6142757eaa7664286623e5b376442 /maximus | |
parent | aa8270634e8943608a105a8ee1ef04859bc7dc41 (diff) | |
download | mate-netbook-18a191d3a4fa910680e084e88cd04db3ade01c0e.tar.bz2 mate-netbook-18a191d3a4fa910680e084e88cd04db3ade01c0e.tar.xz |
maximus: don't crash on invalid window ID
fixes https://github.com/mate-desktop/mate-netbook/issues/5
Diffstat (limited to 'maximus')
-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)); |