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

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

Issue 2108933003: Reorder browser list on workspace switch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use LazyInstance. Add small API descriptions. Created 4 years, 6 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
« ui/display/desktop_observer.h ('K') | « ui/display/display.gyp ('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 8ec4b1e7b9aceada7c3a5562ee9c3b3fd966acb5..1783a548251e9e506104d4561892f4b72c34d983 100644
--- a/ui/views/widget/desktop_aura/x11_desktop_handler.cc
+++ b/ui/views/widget/desktop_aura/x11_desktop_handler.cc
@@ -8,20 +8,23 @@
#include <X11/Xlib.h>
#include "base/message_loop/message_loop.h"
+#include "base/strings/string_number_conversions.h"
#include "ui/aura/env.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/base/x/x11_foreign_window_manager.h"
#include "ui/base/x/x11_menu_list.h"
#include "ui/base/x/x11_util.h"
+#include "ui/display/desktop_observer.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/gfx/x/x11_error_tracker.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
namespace {
-const char* kAtomsToCache[] = {
+const char* const kAtomsToCache[] = {
"_NET_ACTIVE_WINDOW",
- NULL
+ "_NET_CURRENT_DESKTOP",
+ nullptr
};
// Our global instance. Deleted when our Env() is deleted.
@@ -184,10 +187,7 @@ bool X11DesktopHandler::CanDispatchEvent(const ui::PlatformEvent& event) {
uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) {
switch (event->type) {
case PropertyNotify: {
- // Check for a change to the active window.
- CHECK_EQ(x_root_window_, event->xproperty.window);
- ::Atom active_window_atom = atom_cache_.GetAtom("_NET_ACTIVE_WINDOW");
- if (event->xproperty.atom == active_window_atom) {
+ if (event->xproperty.atom == atom_cache_.GetAtom("_NET_ACTIVE_WINDOW")) {
::Window window;
if (ui::GetXIDProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &window) &&
window) {
@@ -196,10 +196,14 @@ uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) {
} else {
x_active_window_ = None;
}
+ } else if (event->xproperty.atom ==
+ atom_cache_.GetAtom("_NET_CURRENT_DESKTOP")) {
+ int desktop;
+ if (ui::GetCurrentDesktop(&desktop))
+ display::desktop::OnWorkspaceChanged(base::IntToString(desktop));
}
break;
}
-
case CreateNotify:
OnWindowCreatedOrDestroyed(event->type, event->xcreatewindow.window);
break;
« ui/display/desktop_observer.h ('K') | « ui/display/display.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698