pkgsrc/net/x2vnc/patches/patch-ab
abs 1fd0165b1c Remove dga from PKG_SUGGESTED_OPTIONS, and add a note that is breaks
mouse draggin on some systems
Bump PKGREVISION
2015-04-23 09:17:48 +00:00

29 lines
665 B
Text

$NetBSD: patch-ab,v 1.2 2015/04/23 09:17:48 abs Exp $
Remember to always ungrab on exit
--- x.c.orig 2006-06-14 05:34:41.000000000 +0200
+++ x.c
@@ -173,6 +173,14 @@ int warn_about_hotkey(Display *dpy, XErr
*/
static Bool mouseOnScreen;
+static void atexit_ungrab(void) {
+ if (grabbed) {
+ fprintf(stderr, "%s: exit while grabbed, ungrabbing input devices\n",
+ programName);
+ ungrabit(-1, -1, DefaultRootWindow(dpy));
+ }
+}
+
/*
* CreateXWindow.
*/
@@ -534,6 +542,7 @@ Bool CreateXWindow(void)
dumpcoord(&origo2);
fprintf(stderr,"offset=%d, %d\n",x_offset,y_offset);
*/
+ atexit(atexit_ungrab);
return True;
}