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

Unified Diff: ash/display/mirror_window_controller.cc

Issue 2319933002: X11: Remove calls to XSelectInput (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/aura/window_tree_host_x11.h » ('j') | ui/aura/window_tree_host_x11.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/display/mirror_window_controller.cc
diff --git a/ash/display/mirror_window_controller.cc b/ash/display/mirror_window_controller.cc
index fec84ea72e6a211e1c423f37db6f7c81c133c25c..af175ab832ced2bbb36ea355cf93c2c48ae5e194 100644
--- a/ash/display/mirror_window_controller.cc
+++ b/ash/display/mirror_window_controller.cc
@@ -40,27 +40,13 @@
#include "ui/gfx/native_widget_types.h"
#if defined(USE_X11)
+#include "ui/aura/window_tree_host_x11.h"
#include "ui/gfx/x/x11_types.h" // nogncheck
#endif
namespace ash {
namespace {
-#if defined(USE_X11)
-// Mirror window shouldn't handle input events.
-void DisableInput(XID window) {
- long event_mask = ExposureMask | VisibilityChangeMask | StructureNotifyMask |
- PropertyChangeMask;
- XSelectInput(gfx::GetXDisplay(), window, event_mask);
- unsigned char mask[XIMaskLen(XI_LASTEVENT)] = {0};
- XIEventMask evmask;
- evmask.deviceid = XIAllDevices;
- evmask.mask_len = sizeof(mask);
- evmask.mask = mask;
- XISelectEvents(gfx::GetXDisplay(), window, &evmask, 1);
-}
-#endif
-
// ScreenPositionClient for mirroring windows.
class MirroringScreenPositionClient
: public aura::client::ScreenPositionClient {
@@ -197,17 +183,17 @@ void MirrorWindowController::UpdateWindow(
base::StringPrintf("MirrorRootWindow-%d", mirror_host_count++));
host->compositor()->SetBackgroundColor(SK_ColorBLACK);
// No need to remove the observer because the WindowTreeHostManager
- // outlives
- // the
- // host.
+ // outlives the host.
host->AddObserver(Shell::GetInstance()->window_tree_host_manager());
host->AddObserver(this);
// TODO(oshima): TouchHUD is using idkey.
InitRootWindowSettings(host->window())->display_id = display_info.id();
host->InitHost();
#if defined(USE_X11)
- if (!display_manager->IsInUnifiedMode())
- DisableInput(host->GetAcceleratedWidget());
+ if (!display_manager->IsInUnifiedMode()) {
+ // Mirror window shouldn't handle input events.
+ static_cast<aura::WindowTreeHostX11*>(host)->DisableInput();
+ }
#endif
#if defined(OS_CHROMEOS)
« no previous file with comments | « no previous file | ui/aura/window_tree_host_x11.h » ('j') | ui/aura/window_tree_host_x11.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698