From 2db365cb6397edb359072c8acbc9dd642909460f Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Mon, 30 Jan 2012 15:18:51 +0100 Subject: core: Also reset the XSelectInput for WnckScreen and WnckApplication We don't want to break apps that have set some specific mask with XSelectInput. --- libwnck/application.c | 15 +++++++++++---- libwnck/screen.c | 12 +++++++----- libwnck/window.c | 6 +++--- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/libwnck/application.c b/libwnck/application.c index edd32e6..f10c334 100644 --- a/libwnck/application.c +++ b/libwnck/application.c @@ -60,6 +60,8 @@ struct _WnckApplicationPrivate int pid; char *name; + int orig_event_mask; + WnckWindow *name_window; /* window we are using name of */ GdkPixbuf *icon; @@ -186,6 +188,11 @@ wnck_application_finalize (GObject *object) application = WNCK_APPLICATION (object); + _wnck_select_input (WNCK_SCREEN_XSCREEN (application->priv->screen), + application->priv->xwindow, + application->priv->orig_event_mask, + FALSE); + application->priv->xwindow = None; g_list_free (application->priv->windows); @@ -566,10 +573,10 @@ _wnck_application_create (Window xwindow, /* Note that xwindow may correspond to a WnckWindow's xwindow, * so we select events needed by either */ - _wnck_select_input (xscreen, - application->priv->xwindow, - WNCK_APP_WINDOW_EVENT_MASK, - TRUE); + application->priv->orig_event_mask = _wnck_select_input (xscreen, + application->priv->xwindow, + WNCK_APP_WINDOW_EVENT_MASK, + TRUE); return application; } diff --git a/libwnck/screen.c b/libwnck/screen.c index c47640c..cbe45ed 100644 --- a/libwnck/screen.c +++ b/libwnck/screen.c @@ -75,6 +75,8 @@ struct _WnckScreenPrivate Window xroot; Screen *xscreen; + int orig_event_mask; + /* in map order */ GList *mapped_windows; /* in stacking order */ @@ -515,7 +517,7 @@ wnck_screen_finalize (GObject *object) _wnck_select_input (screen->priv->xscreen, screen->priv->xroot, - 0, + screen->priv->orig_event_mask, FALSE); unqueue_update (screen); @@ -600,10 +602,10 @@ wnck_screen_construct (Display *display, screen->priv->bg_pixmap = None; - _wnck_select_input (screen->priv->xscreen, - screen->priv->xroot, - PropertyChangeMask, - TRUE); + screen->priv->orig_event_mask = _wnck_select_input (screen->priv->xscreen, + screen->priv->xroot, + PropertyChangeMask, + TRUE); screen->priv->need_update_workspace_list = TRUE; screen->priv->need_update_stack_list = TRUE; diff --git a/libwnck/window.c b/libwnck/window.c index 86ee611..28bbb37 100644 --- a/libwnck/window.c +++ b/libwnck/window.c @@ -542,9 +542,9 @@ _wnck_window_create (Window xwindow, * and the one we want for window */ window->priv->orig_event_mask =_wnck_select_input (xscreen, - window->priv->xwindow, - WNCK_APP_WINDOW_EVENT_MASK, - TRUE); + window->priv->xwindow, + WNCK_APP_WINDOW_EVENT_MASK, + TRUE); /* Default the group leader to the window itself; it is set in * update_wmhints() if a different group leader is specified. -- cgit v1.2.1