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

Side by Side Diff: ui/views/widget/desktop_aura/x11_scoped_capture.cc

Issue 380943003: Do not release capture when transferring capture between Chrome windows on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/desktop_aura/x11_scoped_capture.h ('k') | 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
(Empty)
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.
4
5 #include "ui/views/widget/desktop_aura/x11_scoped_capture.h"
6
7 #include <X11/X.h>
8 #include <X11/Xlib.h>
9
10 #include "ui/gfx/x/x11_types.h"
11
12 namespace views {
13
14 X11ScopedCapture::X11ScopedCapture(XID window)
15 : captured_(false) {
16 // TODO(sad): Use XI2 API instead.
17 unsigned int event_mask = PointerMotionMask | ButtonReleaseMask |
18 ButtonPressMask;
19 int status = XGrabPointer(gfx::GetXDisplay(), window, True, event_mask,
20 GrabModeAsync, GrabModeAsync, None, None,
21 CurrentTime);
22 captured_ = status == GrabSuccess;
23 }
24
25 X11ScopedCapture::~X11ScopedCapture() {
26 if (captured_) {
27 XUngrabPointer(gfx::GetXDisplay(), CurrentTime);
28 }
29 }
30
31 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/x11_scoped_capture.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698