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

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

Issue 138903007: 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: fix views_unittests 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 | « ui/views/widget/desktop_aura/x11_desktop_handler.h ('k') | 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 8125611ef088df54d5033f6ee08b7f1069d90cf7..e754f74640bed9658823efa85e279b2f8bc627f6 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_handler.cc
+++ b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
@@ -55,17 +55,10 @@ X11DesktopHandler::X11DesktopHandler()
attr.your_event_mask | PropertyChangeMask |
StructureNotifyMask | SubstructureNotifyMask);
- 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;
- }
- }
- }
+ ::Window active_window;
+ wm_supports_active_window_ =
+ ui::GetXIDProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &active_window) &&
+ active_window;
}
X11DesktopHandler::~X11DesktopHandler() {
@@ -136,14 +129,14 @@ bool X11DesktopHandler::Dispatch(const base::NativeEvent& event) {
// Check for a change to the active window.
switch (event->type) {
case PropertyNotify: {
- ::Atom active_window = atom_cache_.GetAtom("_NET_ACTIVE_WINDOW");
+ ::Atom active_window_atom = atom_cache_.GetAtom("_NET_ACTIVE_WINDOW");
if (event->xproperty.window == x_root_window_ &&
- event->xproperty.atom == active_window) {
- int window;
- if (ui::GetIntProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &window) &&
+ event->xproperty.atom == active_window_atom) {
+ ::Window window;
+ if (ui::GetXIDProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &window) &&
window) {
- OnActiveWindowChanged(static_cast< ::Window>(window));
+ OnActiveWindowChanged(window);
}
}
break;
« no previous file with comments | « ui/views/widget/desktop_aura/x11_desktop_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698