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

Side by Side Diff: ui/views/widget/desktop_aura/x11_desktop_handler.cc

Issue 667823002: PlatformEventDispatcher::DispatchEvent() should return a PostDispatchAction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ui_enums
Patch Set: Fix platform_event_source_unittest.cc Created 6 years, 2 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 unified diff | Download patch
OLDNEW
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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 NOTREACHED(); 149 NOTREACHED();
150 } 150 }
151 } 151 }
152 152
153 bool X11DesktopHandler::CanDispatchEvent(const ui::PlatformEvent& event) { 153 bool X11DesktopHandler::CanDispatchEvent(const ui::PlatformEvent& event) {
154 return event->type == CreateNotify || event->type == DestroyNotify || 154 return event->type == CreateNotify || event->type == DestroyNotify ||
155 (event->type == PropertyNotify && 155 (event->type == PropertyNotify &&
156 event->xproperty.window == x_root_window_); 156 event->xproperty.window == x_root_window_);
157 } 157 }
158 158
159 uint32_t X11DesktopHandler::DispatchEvent(const ui::PlatformEvent& event) { 159 ui::PostDispatchAction X11DesktopHandler::DispatchEvent(
160 const ui::PlatformEvent& event) {
160 switch (event->type) { 161 switch (event->type) {
161 case PropertyNotify: { 162 case PropertyNotify: {
162 // Check for a change to the active window. 163 // Check for a change to the active window.
163 CHECK_EQ(x_root_window_, event->xproperty.window); 164 CHECK_EQ(x_root_window_, event->xproperty.window);
164 ::Atom active_window_atom = atom_cache_.GetAtom("_NET_ACTIVE_WINDOW"); 165 ::Atom active_window_atom = atom_cache_.GetAtom("_NET_ACTIVE_WINDOW");
165 if (event->xproperty.atom == active_window_atom) { 166 if (event->xproperty.atom == active_window_atom) {
166 ::Window window; 167 ::Window window;
167 if (ui::GetXIDProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &window) && 168 if (ui::GetXIDProperty(x_root_window_, "_NET_ACTIVE_WINDOW", &window) &&
168 window) { 169 window) {
169 OnActiveWindowChanged(window, ACTIVE); 170 OnActiveWindowChanged(window, ACTIVE);
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window); 236 ui::XMenuList::GetInstance()->MaybeUnregisterMenu(window);
236 } 237 }
237 238
238 if (event_type == DestroyNotify) { 239 if (event_type == DestroyNotify) {
239 // Notify the XForeignWindowManager that |window| has been destroyed. 240 // Notify the XForeignWindowManager that |window| has been destroyed.
240 ui::XForeignWindowManager::GetInstance()->OnWindowDestroyed(window); 241 ui::XForeignWindowManager::GetInstance()->OnWindowDestroyed(window);
241 } 242 }
242 } 243 }
243 244
244 } // namespace views 245 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/x11_desktop_handler.h ('k') | ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698