summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2012-01-30 15:18:51 +0100
committerVincent Untz <vuntz@gnome.org>2012-01-30 15:39:40 +0100
commit2db365cb6397edb359072c8acbc9dd642909460f (patch)
tree49952261a43c213237a0f87c6ce319ca83cb289a
parent46f87fa639a108c2ecd5ed711a530716545b2065 (diff)
downloadlibwnck-2db365cb6397edb359072c8acbc9dd642909460f.tar.gz
core: Also reset the XSelectInput for WnckScreen and WnckApplication
We don't want to break apps that have set some specific mask with XSelectInput.
-rw-r--r--libwnck/application.c15
-rw-r--r--libwnck/screen.c12
-rw-r--r--libwnck/window.c6
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.