OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ash/display/mirror_window_controller.h" | 5 #include "ash/display/mirror_window_controller.h" |
6 | 6 |
7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 #include <X11/extensions/XInput2.h> |
9 | 10 |
10 // Xlib.h defines RootWindow. | 11 // Xlib.h defines RootWindow. |
11 #undef RootWindow | 12 #undef RootWindow |
12 #endif | 13 #endif |
13 | 14 |
14 #include "ash/display/cursor_window_controller.h" | 15 #include "ash/display/cursor_window_controller.h" |
15 #include "ash/display/display_controller.h" | 16 #include "ash/display/display_controller.h" |
16 #include "ash/display/display_info.h" | 17 #include "ash/display/display_info.h" |
17 #include "ash/display/display_manager.h" | 18 #include "ash/display/display_manager.h" |
18 #include "ash/display/root_window_transformers.h" | 19 #include "ash/display/root_window_transformers.h" |
(...skipping 19 matching lines...) Expand all Loading... |
38 | 39 |
39 namespace ash { | 40 namespace ash { |
40 namespace { | 41 namespace { |
41 | 42 |
42 #if defined(USE_X11) | 43 #if defined(USE_X11) |
43 // Mirror window shouldn't handle input events. | 44 // Mirror window shouldn't handle input events. |
44 void DisableInput(XID window) { | 45 void DisableInput(XID window) { |
45 long event_mask = ExposureMask | VisibilityChangeMask | | 46 long event_mask = ExposureMask | VisibilityChangeMask | |
46 StructureNotifyMask | PropertyChangeMask; | 47 StructureNotifyMask | PropertyChangeMask; |
47 XSelectInput(gfx::GetXDisplay(), window, event_mask); | 48 XSelectInput(gfx::GetXDisplay(), window, event_mask); |
| 49 unsigned char mask[XIMaskLen(XI_LASTEVENT)] = {0}; |
| 50 XIEventMask evmask; |
| 51 evmask.deviceid = XIAllDevices; |
| 52 evmask.mask_len = sizeof(mask); |
| 53 evmask.mask = mask; |
| 54 XISelectEvents(gfx::GetXDisplay(), window, &evmask, 1); |
48 } | 55 } |
49 #endif | 56 #endif |
50 | 57 |
51 class NoneCaptureClient : public aura::client::CaptureClient { | 58 class NoneCaptureClient : public aura::client::CaptureClient { |
52 public: | 59 public: |
53 NoneCaptureClient() {} | 60 NoneCaptureClient() {} |
54 virtual ~NoneCaptureClient() {} | 61 virtual ~NoneCaptureClient() {} |
55 | 62 |
56 private: | 63 private: |
57 // Does a capture on the |window|. | 64 // Does a capture on the |window|. |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 display_manager->mirrored_display_id()); | 182 display_manager->mirrored_display_id()); |
176 const DisplayInfo& source_display_info = display_manager->GetDisplayInfo( | 183 const DisplayInfo& source_display_info = display_manager->GetDisplayInfo( |
177 Shell::GetScreen()->GetPrimaryDisplay().id()); | 184 Shell::GetScreen()->GetPrimaryDisplay().id()); |
178 DCHECK(display_manager->IsMirrored()); | 185 DCHECK(display_manager->IsMirrored()); |
179 return scoped_ptr<RootWindowTransformer>( | 186 return scoped_ptr<RootWindowTransformer>( |
180 CreateRootWindowTransformerForMirroredDisplay(source_display_info, | 187 CreateRootWindowTransformerForMirroredDisplay(source_display_info, |
181 mirror_display_info)); | 188 mirror_display_info)); |
182 } | 189 } |
183 | 190 |
184 } // namespace ash | 191 } // namespace ash |
OLD | NEW |