[PATCH 06/11] spicec: add SPICE_NOGRAB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Similar to spice-gtk, disable mouse and keyboard grab (useful when
running under a debugger)
---
 client/x11/red_window.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/client/x11/red_window.cpp b/client/x11/red_window.cpp
index d82f5b7..7e16fcd 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);
-- 
1.8.3.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]