|
|
06bf710 |
From 82b1de694b9c26099c8c0065f455e7cb217c8561 Mon Sep 17 00:00:00 2001
|
|
|
5f43859 |
From: Adam Jackson <ajax@redhat.com>
|
|
|
5f43859 |
Date: Wed, 20 Aug 2008 10:11:07 -0400
|
|
|
5f43859 |
Subject: [PATCH] Hide the cursor until the first XDefineCursor() call.
|
|
|
5f43859 |
|
|
|
5f43859 |
---
|
|
|
06bf710 |
xfixes/cursor.c | 14 ++++++++++++--
|
|
|
06bf710 |
1 files changed, 12 insertions(+), 2 deletions(-)
|
|
|
5f43859 |
|
|
|
5f43859 |
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
|
|
|
06bf710 |
index d51251f..26a5d61 100755
|
|
|
5f43859 |
--- a/xfixes/cursor.c
|
|
|
5f43859 |
+++ b/xfixes/cursor.c
|
|
|
b969802 |
@@ -70,7 +70,7 @@
|
|
|
5f43859 |
return BadCursor; \
|
|
|
5f43859 |
} \
|
|
|
5f43859 |
}
|
|
|
5f43859 |
-
|
|
|
5f43859 |
+
|
|
|
5f43859 |
/*
|
|
|
5f43859 |
* There is a global list of windows selecting for cursor events
|
|
|
5f43859 |
*/
|
|
|
b969802 |
@@ -119,6 +119,10 @@
|
|
|
5f43859 |
#define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
|
|
|
5f43859 |
#define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
|
|
|
5f43859 |
|
|
|
5f43859 |
+/* The cursor doesn't show up until the first XDefineCursor() */
|
|
|
b969802 |
+extern void *ConnectionInfo;
|
|
|
5f43859 |
+static Bool CursorVisible = FALSE;
|
|
|
5f43859 |
+
|
|
|
5f43859 |
static Bool
|
|
|
5f43859 |
CursorDisplayCursor (ScreenPtr pScreen,
|
|
|
5f43859 |
CursorPtr pCursor)
|
|
|
b969802 |
@@ -128,7 +132,14 @@
|
|
|
5f43859 |
|
|
|
5f43859 |
Unwrap (cs, pScreen, DisplayCursor);
|
|
|
5f43859 |
|
|
|
5f43859 |
- if (cs->pCursorHideCounts != NULL) {
|
|
|
06bf710 |
+ /*
|
|
|
06bf710 |
+ * Have to check ConnectionInfo to distinguish client requests from
|
|
|
06bf710 |
+ * initial root window setup. Not a great way to do it, I admit.
|
|
|
06bf710 |
+ */
|
|
|
06bf710 |
+ if (ConnectionInfo)
|
|
|
06bf710 |
+ CursorVisible = TRUE;
|
|
|
06bf710 |
+
|
|
|
5f43859 |
+ if (cs->pCursorHideCounts != NULL || !CursorVisible) {
|
|
|
5f43859 |
ret = (*pScreen->DisplayCursor) (pScreen, pInvisibleCursor);
|
|
|
5f43859 |
} else {
|
|
|
5f43859 |
ret = (*pScreen->DisplayCursor) (pScreen, pCursor);
|
|
|
5f43859 |
--
|
|
|
06bf710 |
1.6.0.6
|
|
|
5f43859 |
|