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

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

Issue 52823002: x11: Move XInput2 availability information out of the message pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 1 month 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/events/x/touch_factory_x11.cc ('k') | no next file » | 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/views/widget/desktop_aura/desktop_root_window_host_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_root_window_host_x11.h"
6 6
7 #include <X11/extensions/shape.h> 7 #include <X11/extensions/shape.h>
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <X11/Xregion.h> 10 #include <X11/Xregion.h>
11 #include <X11/Xutil.h> 11 #include <X11/Xutil.h>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/debug/trace_event.h" 14 #include "base/debug/trace_event.h"
15 #include "base/message_loop/message_pump_x11.h" 15 #include "base/message_loop/message_pump_x11.h"
16 #include "base/strings/stringprintf.h" 16 #include "base/strings/stringprintf.h"
17 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
18 #include "third_party/skia/include/core/SkPath.h" 18 #include "third_party/skia/include/core/SkPath.h"
19 #include "ui/aura/client/cursor_client.h" 19 #include "ui/aura/client/cursor_client.h"
20 #include "ui/aura/client/focus_client.h" 20 #include "ui/aura/client/focus_client.h"
21 #include "ui/aura/client/user_action_client.h" 21 #include "ui/aura/client/user_action_client.h"
22 #include "ui/aura/root_window.h" 22 #include "ui/aura/root_window.h"
23 #include "ui/aura/window_property.h" 23 #include "ui/aura/window_property.h"
24 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h" 24 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h"
25 #include "ui/base/x/x11_util.h" 25 #include "ui/base/x/x11_util.h"
26 #include "ui/events/event_utils.h" 26 #include "ui/events/event_utils.h"
27 #include "ui/events/x/device_data_manager.h" 27 #include "ui/events/x/device_data_manager.h"
28 #include "ui/events/x/device_list_cache_x.h"
28 #include "ui/events/x/touch_factory_x11.h" 29 #include "ui/events/x/touch_factory_x11.h"
29 #include "ui/gfx/insets.h" 30 #include "ui/gfx/insets.h"
30 #include "ui/gfx/path.h" 31 #include "ui/gfx/path.h"
31 #include "ui/gfx/path_x11.h" 32 #include "ui/gfx/path_x11.h"
32 #include "ui/native_theme/native_theme.h" 33 #include "ui/native_theme/native_theme.h"
33 #include "ui/views/corewm/compound_event_filter.h" 34 #include "ui/views/corewm/compound_event_filter.h"
34 #include "ui/views/corewm/corewm_switches.h" 35 #include "ui/views/corewm/corewm_switches.h"
35 #include "ui/views/corewm/tooltip_aura.h" 36 #include "ui/views/corewm/tooltip_aura.h"
36 #include "ui/views/ime/input_method.h" 37 #include "ui/views/ime/input_method.h"
37 #include "ui/views/linux_ui/linux_ui.h" 38 #include "ui/views/linux_ui/linux_ui.h"
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 928
928 long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask | 929 long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask |
929 KeyPressMask | KeyReleaseMask | 930 KeyPressMask | KeyReleaseMask |
930 EnterWindowMask | LeaveWindowMask | 931 EnterWindowMask | LeaveWindowMask |
931 ExposureMask | VisibilityChangeMask | 932 ExposureMask | VisibilityChangeMask |
932 StructureNotifyMask | PropertyChangeMask | 933 StructureNotifyMask | PropertyChangeMask |
933 PointerMotionMask; 934 PointerMotionMask;
934 XSelectInput(xdisplay_, xwindow_, event_mask); 935 XSelectInput(xdisplay_, xwindow_, event_mask);
935 XFlush(xdisplay_); 936 XFlush(xdisplay_);
936 937
937 if (base::MessagePumpForUI::HasXInput2()) 938 if (ui::IsXInput2Available())
938 ui::TouchFactory::GetInstance()->SetupXI2ForXWindow(xwindow_); 939 ui::TouchFactory::GetInstance()->SetupXI2ForXWindow(xwindow_);
939 940
940 // TODO(erg): We currently only request window deletion events. We also 941 // TODO(erg): We currently only request window deletion events. We also
941 // should listen for activation events and anything else that GTK+ listens 942 // should listen for activation events and anything else that GTK+ listens
942 // for, and do something useful. 943 // for, and do something useful.
943 ::Atom protocols[2]; 944 ::Atom protocols[2];
944 protocols[0] = atom_cache_.GetAtom("WM_DELETE_WINDOW"); 945 protocols[0] = atom_cache_.GetAtom("WM_DELETE_WINDOW");
945 protocols[1] = atom_cache_.GetAtom("_NET_WM_PING"); 946 protocols[1] = atom_cache_.GetAtom("_NET_WM_PING");
946 XSetWMProtocols(xdisplay_, xwindow_, protocols, 2); 947 XSetWMProtocols(xdisplay_, xwindow_, protocols, 2);
947 948
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
1430 if (linux_ui) { 1431 if (linux_ui) {
1431 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(); 1432 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme();
1432 if (native_theme) 1433 if (native_theme)
1433 return native_theme; 1434 return native_theme;
1434 } 1435 }
1435 1436
1436 return ui::NativeTheme::instance(); 1437 return ui::NativeTheme::instance();
1437 } 1438 }
1438 1439
1439 } // namespace views 1440 } // namespace views
OLDNEW
« no previous file with comments | « ui/events/x/touch_factory_x11.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698