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

Unified Diff: ui/views/widget/desktop_aura/x11_desktop_handler.cc

Issue 144003015: Revert of Fixes _NET_ACTIVE_WINDOW support check in order to not always return no. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@aura_deactivate
Patch Set: Created 6 years, 11 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: ui/views/widget/desktop_aura/x11_desktop_handler.cc
diff --git a/ui/views/widget/desktop_aura/x11_desktop_handler.cc b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
index e754f74640bed9658823efa85e279b2f8bc627f6..8125611ef088df54d5033f6ee08b7f1069d90cf7 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_handler.cc
+++ b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
@@ -55,10 +55,17 @@
attr.your_event_mask | PropertyChangeMask |
StructureNotifyMask | SubstructureNotifyMask);
- ::Window active_window;
- wm_supports_active_window_ =
- ui::GetXIDProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &active_window) &&
- active_window;
+ std::vector<Atom> atoms;
+ if (ui::GetAtomArrayProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &atoms)) {
+ Atom active_window = atom_cache_.GetAtom("_NET_ACTIVE_WINDOW");
+ for (std::vector<Atom>::iterator iter = atoms.begin(); iter != atoms.end();
+ ++iter) {
+ if (*(iter) == active_window) {
+ wm_supports_active_window_ = true;
+ break;
+ }
+ }
+ }
}
X11DesktopHandler::~X11DesktopHandler() {
@@ -129,14 +136,14 @@
// Check for a change to the active window.
switch (event->type) {
case PropertyNotify: {
- ::Atom active_window_atom = atom_cache_.GetAtom("_NET_ACTIVE_WINDOW");
+ ::Atom active_window = atom_cache_.GetAtom("_NET_ACTIVE_WINDOW");
if (event->xproperty.window == x_root_window_ &&
- event->xproperty.atom == active_window_atom) {
- ::Window window;
- if (ui::GetXIDProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &window) &&
+ event->xproperty.atom == active_window) {
+ int window;
+ if (ui::GetIntProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &window) &&
window) {
- OnActiveWindowChanged(window);
+ OnActiveWindowChanged(static_cast< ::Window>(window));
}
}
break;
« 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