summaryrefslogtreecommitdiff
path: root/games/xracer/patches/patch-src_ws__x11.c
blob: a3f7df5fbd03dc8706dc5252ae8c0589321ead60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
$NetBSD: patch-src_ws__x11.c,v 1.1 2016/04/04 17:33:42 khorben Exp $

Avoid references to obsolete GLUT internals

--- src/ws_x11.c.orig	2016-04-04 07:44:51.000000000 +0000
+++ src/ws_x11.c
@@ -28,6 +28,7 @@
 #include "xracer-ws.h"
 #include "xracer-log.h"
 
+#if 0
 /* X11- and GLUT-specific hack to warp and grab the pointer into the window. */
 struct GLUTwindow
 {
@@ -39,33 +40,43 @@ extern Display *__glutDisplay;
 
 extern Window __glutRoot;
 extern struct GLUTwindow *__glutCurrentWindow;
+#endif
 
 void
 xrWsWarpPointer ()
 {
+#if 0
   Window window = __glutCurrentWindow->win;
 
   XWarpPointer(__glutDisplay, 0, window, 0, 0, 0, 0, xrWidth/2, xrHeight/2);
+#else
+  glutWarpPointer(xrWidth/2, xrHeight/2);
+#endif
 }
 
 /* Grab the pointer. */
 void
 xrWsGrabPointer ()
 {
+#if 0
   Window window = __glutCurrentWindow->win;
 
   if (XGrabPointer(__glutDisplay, window, True,
         ButtonReleaseMask | ButtonPressMask,
         GrabModeAsync, GrabModeAsync,
         window, None, CurrentTime) != GrabSuccess)
+#else
     xrLog (LOG_ERROR, "pointer grab failed");
+#endif
 }
 
 /* Flush out the event queue. */
 void
 xrWsFlushEventQueue ()
 {
+#if 0
   XSync(__glutDisplay, False);
+#endif
 }
 
 /* X11 hack to give window a class, so WindowManagers can interact with it
@@ -75,10 +86,12 @@ xrWsFlushEventQueue ()
 void
 xrWsFixWindowClass ()
 {
+#if 0
    XClassHint classhint;
    Window window = __glutCurrentWindow->win;
 
    classhint.res_name = (char *) "xracer";
    classhint.res_class = (char *) "XRacer";
    XSetClassHint (__glutDisplay, window, &classhint);
+#endif
 }