1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/views/widget/desktop_aura/x11_scoped_capture.h"
10 #include "ui/gfx/x/x11_types.h"
14 X11ScopedCapture::X11ScopedCapture(XID window)
16 // TODO(sad): Use XI2 API instead.
17 unsigned int event_mask = PointerMotionMask | ButtonReleaseMask |
19 int status = XGrabPointer(gfx::GetXDisplay(), window, True, event_mask,
20 GrabModeAsync, GrabModeAsync, None, None,
22 captured_ = status == GrabSuccess;
25 X11ScopedCapture::~X11ScopedCapture() {
27 XUngrabPointer(gfx::GetXDisplay(), CurrentTime);