Chromium Code Reviews| 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)]; | |
| 50 memset(mask, 0, sizeof(mask)); | |
|
oshima
2014/09/11 17:33:55
nit:
unsigned char mask[..] = {0}
kpschoedel
2014/09/11 17:49:19
Done.
| |
| 51 XIEventMask evmask; | |
| 52 evmask.deviceid = XIAllDevices; | |
| 53 evmask.mask_len = sizeof(mask); | |
| 54 evmask.mask = mask; | |
| 55 XISelectEvents(gfx::GetXDisplay(), window, &evmask, 1); | |
| 48 } | 56 } |
| 49 #endif | 57 #endif |
| 50 | 58 |
| 51 class NoneCaptureClient : public aura::client::CaptureClient { | 59 class NoneCaptureClient : public aura::client::CaptureClient { |
| 52 public: | 60 public: |
| 53 NoneCaptureClient() {} | 61 NoneCaptureClient() {} |
| 54 virtual ~NoneCaptureClient() {} | 62 virtual ~NoneCaptureClient() {} |
| 55 | 63 |
| 56 private: | 64 private: |
| 57 // Does a capture on the |window|. | 65 // 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()); | 183 display_manager->mirrored_display_id()); |
| 176 const DisplayInfo& source_display_info = display_manager->GetDisplayInfo( | 184 const DisplayInfo& source_display_info = display_manager->GetDisplayInfo( |
| 177 Shell::GetScreen()->GetPrimaryDisplay().id()); | 185 Shell::GetScreen()->GetPrimaryDisplay().id()); |
| 178 DCHECK(display_manager->IsMirrored()); | 186 DCHECK(display_manager->IsMirrored()); |
| 179 return scoped_ptr<RootWindowTransformer>( | 187 return scoped_ptr<RootWindowTransformer>( |
| 180 CreateRootWindowTransformerForMirroredDisplay(source_display_info, | 188 CreateRootWindowTransformerForMirroredDisplay(source_display_info, |
| 181 mirror_display_info)); | 189 mirror_display_info)); |
| 182 } | 190 } |
| 183 | 191 |
| 184 } // namespace ash | 192 } // namespace ash |
| OLD | NEW |