| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/widget/desktop_aura/x11_desktop_handler.h" | 5 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" |
| 6 | 6 |
| 7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 | 9 |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 if (ui::PlatformEventSource::GetInstance()) | 51 if (ui::PlatformEventSource::GetInstance()) |
| 52 ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); | 52 ui::PlatformEventSource::GetInstance()->AddPlatformEventDispatcher(this); |
| 53 aura::Env::GetInstance()->AddObserver(this); | 53 aura::Env::GetInstance()->AddObserver(this); |
| 54 | 54 |
| 55 XWindowAttributes attr; | 55 XWindowAttributes attr; |
| 56 XGetWindowAttributes(xdisplay_, x_root_window_, &attr); | 56 XGetWindowAttributes(xdisplay_, x_root_window_, &attr); |
| 57 XSelectInput(xdisplay_, x_root_window_, | 57 XSelectInput(xdisplay_, x_root_window_, |
| 58 attr.your_event_mask | PropertyChangeMask | | 58 attr.your_event_mask | PropertyChangeMask | |
| 59 StructureNotifyMask | SubstructureNotifyMask); | 59 StructureNotifyMask | SubstructureNotifyMask); |
| 60 | 60 |
| 61 wm_supports_active_window_ = | 61 if (ui::GuessWindowManager() == ui::WM_WMII) { |
| 62 ui::WmSupportsHint(atom_cache_.GetAtom("_NET_ACTIVE_WINDOW")); | 62 // wmii says that it supports _NET_ACTIVE_WINDOW but does not. |
| 63 // https://code.google.com/p/wmii/issues/detail?id=266 |
| 64 wm_supports_active_window_ = false; |
| 65 } else { |
| 66 wm_supports_active_window_ = |
| 67 ui::WmSupportsHint(atom_cache_.GetAtom("_NET_ACTIVE_WINDOW")); |
| 68 } |
| 63 } | 69 } |
| 64 | 70 |
| 65 X11DesktopHandler::~X11DesktopHandler() { | 71 X11DesktopHandler::~X11DesktopHandler() { |
| 66 aura::Env::GetInstance()->RemoveObserver(this); | 72 aura::Env::GetInstance()->RemoveObserver(this); |
| 67 if (ui::PlatformEventSource::GetInstance()) | 73 if (ui::PlatformEventSource::GetInstance()) |
| 68 ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); | 74 ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); |
| 69 } | 75 } |
| 70 | 76 |
| 71 void X11DesktopHandler::ActivateWindow(::Window window) { | 77 void X11DesktopHandler::ActivateWindow(::Window window) { |
| 72 if (current_window_ == window && | 78 if (current_window_ == window && |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); | 237 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); |
| 232 } | 238 } |
| 233 | 239 |
| 234 if (event_type == DestroyNotify) { | 240 if (event_type == DestroyNotify) { |
| 235 // Notify the XForeignWindowManager that |window| has been destroyed. | 241 // Notify the XForeignWindowManager that |window| has been destroyed. |
| 236 ui::XForeignWindowManager::GetInstance()->OnWindowDestroyed(window); | 242 ui::XForeignWindowManager::GetInstance()->OnWindowDestroyed(window); |
| 237 } | 243 } |
| 238 } | 244 } |
| 239 | 245 |
| 240 } // namespace views | 246 } // namespace views |
| OLD | NEW |