summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-09-23 22:06:51 +0200
committerMarc-André Lureau <marcandre.lureau@gmail.com>2013-09-30 02:19:51 +0200
commite67caa8516ad040351476076272385d8db81880a (patch)
tree1da5c8e2262de80a29d1a486e8e49619eaef666a /client
parentd524047400f14d0899dcff1a057f0e25b3dfcff9 (diff)
downloadspice-e67caa8516ad040351476076272385d8db81880a.tar.gz
spice-e67caa8516ad040351476076272385d8db81880a.tar.xz
spice-e67caa8516ad040351476076272385d8db81880a.zip
spicec: add SPICE_NOGRAB
Similar to spice-gtk, disable mouse and keyboard grab (useful when running under a debugger)
Diffstat (limited to 'client')
-rw-r--r--client/x11/red_window.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
index d82f5b74..7e16fcd2 100644
--- a/client/x11/red_window.cpp
+++ b/client/x11/red_window.cpp
@@ -1765,9 +1765,13 @@ void RedWindow::do_start_key_interception()
// that reason we temporary disable focus event handling. Same happens
// LeaveNotify and EnterNotify.
+ if (getenv("SPICE_NOGRAB"))
+ return;
+
ASSERT(_focused);
XLockDisplay(x_display);
XGrabKeyboard(x_display, _win, True, GrabModeAsync, GrabModeAsync, CurrentTime);
+
XUnlockDisplay(x_display);
sync(true);
_listener.on_start_key_interception();
@@ -1845,6 +1849,9 @@ void RedWindow::release_mouse()
void RedWindow::capture_mouse()
{
+ if (getenv("SPICE_NOGRAB"))
+ return;
+
int grab_retries = MOUSE_GRAB_RETRIES;
XLockDisplay(x_display);
XSync(x_display, False);