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

Side by Side Diff: ui/aura/dispatcher_linux.cc

Issue 9837046: Revert r128507 "Revert r128436 "relanding: disabled workspace_window_resizer test. fixed access-aft… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/env.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/aura/dispatcher_linux.h" 5 #include "ui/aura/dispatcher_linux.h"
6 6
7 #include <X11/extensions/XInput2.h> 7 #include <X11/extensions/XInput2.h>
8 8
9 #include "ui/aura/root_window_host_linux.h" 9 #include "ui/aura/root_window_host_linux.h"
10 #include "ui/base/events.h" 10 #include "ui/base/events.h"
11 11
12 namespace aura { 12 namespace aura {
13 13
14 DispatcherLinux::DispatcherLinux() { 14 DispatcherLinux::DispatcherLinux() {
15 base::MessagePumpX::SetDefaultDispatcher(this); 15 base::MessagePumpX::SetDefaultDispatcher(this);
16 } 16 }
17 17
18 DispatcherLinux::~DispatcherLinux() { 18 DispatcherLinux::~DispatcherLinux() {
19 base::MessagePumpX::SetDefaultDispatcher(NULL); 19 base::MessagePumpX::SetDefaultDispatcher(NULL);
20 } 20 }
21 21
22 void DispatcherLinux::RootWindowHostCreated(::Window window, 22 void DispatcherLinux::RootWindowHostCreated(::Window window,
23 ::Window root, 23 ::Window root,
24 RootWindowHostLinux* host) { 24 RootWindowHostLinux* host) {
25 hosts_.insert(std::make_pair(window, host)); 25 hosts_.insert(std::make_pair(window, host));
26 hosts_.insert(std::make_pair(root, host)); 26 // Only the 1st root window listens to the root window.
27 if (hosts_.find(root) == hosts_.end())
28 hosts_.insert(std::make_pair(root, host));
27 } 29 }
28 30
29 void DispatcherLinux::RootWindowHostDestroying(::Window window, ::Window root) { 31 void DispatcherLinux::RootWindowHostDestroying(::Window window, ::Window root) {
32 if (hosts_[window] == hosts_[root])
33 hosts_.erase(root);
30 hosts_.erase(window); 34 hosts_.erase(window);
31 hosts_.erase(root);
32 } 35 }
33 36
34 base::MessagePumpDispatcher::DispatchStatus DispatcherLinux::Dispatch( 37 base::MessagePumpDispatcher::DispatchStatus DispatcherLinux::Dispatch(
35 XEvent* xev) { 38 XEvent* xev) {
36 // XI_HierarchyChanged events are special. There is no window associated with 39 // XI_HierarchyChanged events are special. There is no window associated with
37 // these events. So process them directly from here. 40 // these events. So process them directly from here.
38 if (xev->type == GenericEvent && 41 if (xev->type == GenericEvent &&
39 xev->xgeneric.evtype == XI_HierarchyChanged) { 42 xev->xgeneric.evtype == XI_HierarchyChanged) {
40 ui::UpdateDeviceList(); 43 ui::UpdateDeviceList();
41 return EVENT_PROCESSED; 44 return EVENT_PROCESSED;
(...skipping 11 matching lines...) Expand all
53 } 56 }
54 HostsMap::const_iterator it = hosts_.find(window); 57 HostsMap::const_iterator it = hosts_.find(window);
55 return it != hosts_.end() ? it->second : NULL; 58 return it != hosts_.end() ? it->second : NULL;
56 } 59 }
57 60
58 Dispatcher* CreateDispatcher() { 61 Dispatcher* CreateDispatcher() {
59 return new DispatcherLinux; 62 return new DispatcherLinux;
60 } 63 }
61 64
62 } // namespace aura 65 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/aura.gyp ('k') | ui/aura/env.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698