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

Side by Side Diff: ui/base/x/active_window_watcher_x.cc

Issue 8632021: GTK: Port to gdk_x11_window_lookup_for_display (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Put GDK X11 compatability in another file Created 9 years 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 unified diff | Download patch
« no previous file with comments | « ui/base/gtk/gdk_x_compat.h ('k') | ui/base/x/x11_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/x/active_window_watcher_x.h" 5 #include "ui/base/x/active_window_watcher_x.h"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 #include <gdk/gdkx.h> 8 #include <gdk/gdkx.h>
9 #include "ui/base/gtk/gtk_compat.h"
10 #include "ui/base/gtk/gdk_x_compat.h"
9 11
10 #include "ui/base/x/active_window_watcher_x_observer.h" 12 #include "ui/base/x/active_window_watcher_x_observer.h"
11 #include "ui/base/x/root_window_property_watcher_x.h" 13 #include "ui/base/x/root_window_property_watcher_x.h"
12 #include "ui/base/x/x11_util.h" 14 #include "ui/base/x/x11_util.h"
13 15
14 namespace ui { 16 namespace ui {
15 17
16 static const char* const kNetActiveWindow = "_NET_ACTIVE_WINDOW"; 18 static const char* const kNetActiveWindow = "_NET_ACTIVE_WINDOW";
17 19
18 // static 20 // static
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 &num_items, 79 &num_items,
78 &remaining_bytes, 80 &remaining_bytes,
79 &property); 81 &property);
80 82
81 // Check that the property was set and contained a single 32-bit item (we 83 // Check that the property was set and contained a single 32-bit item (we
82 // don't check that remaining_bytes is 0, though, as XFCE's window manager 84 // don't check that remaining_bytes is 0, though, as XFCE's window manager
83 // seems to actually store two values in the property for some unknown 85 // seems to actually store two values in the property for some unknown
84 // reason.) 86 // reason.)
85 if (format == 32 && num_items == 1) { 87 if (format == 32 && num_items == 1) {
86 int xid = *reinterpret_cast<int*>(property); 88 int xid = *reinterpret_cast<int*>(property);
87 GdkWindow* active_window = gdk_window_lookup(xid); 89 GdkDisplay* display = gdk_display_get_default();
90 GdkWindow* active_window = gdk_x11_window_lookup_for_display(display, xid);
88 FOR_EACH_OBSERVER(ActiveWindowWatcherXObserver, observers_, 91 FOR_EACH_OBSERVER(ActiveWindowWatcherXObserver, observers_,
89 ActiveWindowChanged(active_window)); 92 ActiveWindowChanged(active_window));
90 } 93 }
91 if (property) 94 if (property)
92 XFree(property); 95 XFree(property);
93 } 96 }
94 97
95 } // namespace ui 98 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/gtk/gdk_x_compat.h ('k') | ui/base/x/x11_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698