Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1855)

Unified Diff: app/active_window_watcher_x.cc

Issue 1076007: Fixes bug in ActiveWindowWatcherX. It appears that in newer versions... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/active_window_watcher_x.cc
===================================================================
--- app/active_window_watcher_x.cc (revision 42106)
+++ app/active_window_watcher_x.cc (working copy)
@@ -30,11 +30,15 @@
gdk_screen_get_display(gdk_screen_get_default()), kNetActiveWindow);
GdkWindow* root = gdk_get_default_root_window();
+
// Set up X Event filter to listen for PropertyChange X events. These events
// tell us when the active window changes.
- gdk_window_add_filter(root, &ActiveWindowWatcherX::OnWindowXEvent, this);
- XSelectInput(
- GDK_WINDOW_XDISPLAY(root), GDK_WINDOW_XID(root), PropertyChangeMask);
+ // Don't use XSelectInput directly here, as gdk internally seems to cache the
+ // mask and reapply XSelectInput after this, resetting any mask we set here.
+ gdk_window_set_events(root,
+ static_cast<GdkEventMask>(gdk_window_get_events(root) |
+ GDK_PROPERTY_CHANGE_MASK));
+ gdk_window_add_filter(NULL, &ActiveWindowWatcherX::OnWindowXEvent, this);
}
void ActiveWindowWatcherX::NotifyActiveWindowChanged() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698