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

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

Issue 2319933002: X11: Remove calls to XSelectInput (Closed)
Patch Set: Comments Created 4 years, 3 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/desktop_window_tree_host_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_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>
(...skipping 14 matching lines...) Expand all
25 #include "ui/aura/client/cursor_client.h" 25 #include "ui/aura/client/cursor_client.h"
26 #include "ui/aura/client/focus_client.h" 26 #include "ui/aura/client/focus_client.h"
27 #include "ui/aura/window.h" 27 #include "ui/aura/window.h"
28 #include "ui/aura/window_event_dispatcher.h" 28 #include "ui/aura/window_event_dispatcher.h"
29 #include "ui/aura/window_property.h" 29 #include "ui/aura/window_property.h"
30 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h" 30 #include "ui/base/dragdrop/os_exchange_data_provider_aurax11.h"
31 #include "ui/base/hit_test.h" 31 #include "ui/base/hit_test.h"
32 #include "ui/base/ime/input_method.h" 32 #include "ui/base/ime/input_method.h"
33 #include "ui/base/x/x11_util.h" 33 #include "ui/base/x/x11_util.h"
34 #include "ui/base/x/x11_util_internal.h" 34 #include "ui/base/x/x11_util_internal.h"
35 #include "ui/base/x/x11_window_event_manager.h"
35 #include "ui/display/display.h" 36 #include "ui/display/display.h"
36 #include "ui/display/screen.h" 37 #include "ui/display/screen.h"
37 #include "ui/events/devices/x11/device_data_manager_x11.h" 38 #include "ui/events/devices/x11/device_data_manager_x11.h"
38 #include "ui/events/devices/x11/device_list_cache_x11.h" 39 #include "ui/events/devices/x11/device_list_cache_x11.h"
39 #include "ui/events/devices/x11/touch_factory_x11.h" 40 #include "ui/events/devices/x11/touch_factory_x11.h"
40 #include "ui/events/event_utils.h" 41 #include "ui/events/event_utils.h"
41 #include "ui/events/platform/platform_event_source.h" 42 #include "ui/events/platform/platform_event_source.h"
42 #include "ui/events/platform/x11/x11_event_source.h" 43 #include "ui/events/platform/x11/x11_event_source.h"
43 #include "ui/gfx/geometry/insets.h" 44 #include "ui/gfx/geometry/insets.h"
44 #include "ui/gfx/geometry/size_conversions.h" 45 #include "ui/gfx/geometry/size_conversions.h"
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 open_windows().push_front(xwindow_); 1390 open_windows().push_front(xwindow_);
1390 1391
1391 // TODO(erg): Maybe need to set a ViewProp here like in RWHL::RWHL(). 1392 // TODO(erg): Maybe need to set a ViewProp here like in RWHL::RWHL().
1392 1393
1393 long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask | 1394 long event_mask = ButtonPressMask | ButtonReleaseMask | FocusChangeMask |
1394 KeyPressMask | KeyReleaseMask | 1395 KeyPressMask | KeyReleaseMask |
1395 EnterWindowMask | LeaveWindowMask | 1396 EnterWindowMask | LeaveWindowMask |
1396 ExposureMask | VisibilityChangeMask | 1397 ExposureMask | VisibilityChangeMask |
1397 StructureNotifyMask | PropertyChangeMask | 1398 StructureNotifyMask | PropertyChangeMask |
1398 PointerMotionMask; 1399 PointerMotionMask;
1399 XSelectInput(xdisplay_, xwindow_, event_mask); 1400 xwindow_events_.reset(new ui::XScopedEventSelector(xwindow_, event_mask));
1400 XFlush(xdisplay_); 1401 XFlush(xdisplay_);
1401 1402
1402 if (ui::IsXInput2Available()) 1403 if (ui::IsXInput2Available())
1403 ui::TouchFactory::GetInstance()->SetupXI2ForXWindow(xwindow_); 1404 ui::TouchFactory::GetInstance()->SetupXI2ForXWindow(xwindow_);
1404 1405
1405 // TODO(erg): We currently only request window deletion events. We also 1406 // TODO(erg): We currently only request window deletion events. We also
1406 // should listen for activation events and anything else that GTK+ listens 1407 // should listen for activation events and anything else that GTK+ listens
1407 // for, and do something useful. 1408 // for, and do something useful.
1408 ::Atom protocols[2]; 1409 ::Atom protocols[2];
1409 protocols[0] = atom_cache_.GetAtom("WM_DELETE_WINDOW"); 1410 protocols[0] = atom_cache_.GetAtom("WM_DELETE_WINDOW");
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
2308 if (linux_ui) { 2309 if (linux_ui) {
2309 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); 2310 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window);
2310 if (native_theme) 2311 if (native_theme)
2311 return native_theme; 2312 return native_theme;
2312 } 2313 }
2313 2314
2314 return ui::NativeThemeAura::instance(); 2315 return ui::NativeThemeAura::instance();
2315 } 2316 }
2316 2317
2317 } // namespace views 2318 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ('k') | ui/views/widget/desktop_aura/x11_desktop_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698