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

Side by Side Diff: ash/display/mirror_window_controller.cc

Issue 558503005: Disable XI2 events on mirror window (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | 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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698