summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dix/window.c4
-rw-r--r--include/input.h5
-rw-r--r--xfixes/cursor.c10
3 files changed, 11 insertions, 8 deletions
diff --git a/dix/window.c b/dix/window.c
index 49ef4a081..ff979d984 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -1431,6 +1431,8 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client)
}
}
+ CursorVisible = TRUE;
+
if (pWin->realized)
WindowHasNewCursor(pWin);
@@ -3467,6 +3469,8 @@ ChangeWindowDeviceCursor(WindowPtr pWin, DeviceIntPtr pDev, CursorPtr pCursor)
}
out:
+ CursorVisible = TRUE;
+
if (pWin->realized)
WindowHasNewCursor(pWin);
diff --git a/include/input.h b/include/input.h
index f0196f514..076e2c517 100644
--- a/include/input.h
+++ b/include/input.h
@@ -628,6 +628,11 @@ extern _X_HIDDEN void valuator_set_mode(DeviceIntPtr dev, int axis, int mode);
xfixes/cursor.c uses it to determine if the cursor is enabled */
extern Bool EnableCursor;
+/* Set to FALSE by default - ChangeWindowAttributes sets it to TRUE on
+ * CWCursor, xfixes/cursor.c uses it to determine if the cursor is enabled
+ */
+extern Bool CursorVisible;
+
extern _X_EXPORT ValuatorMask *valuator_mask_new(int num_valuators);
extern _X_EXPORT void valuator_mask_free(ValuatorMask **mask);
extern _X_EXPORT void valuator_mask_set_range(ValuatorMask *mask,
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 4d4a75e3e..d6f61c20f 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -139,8 +139,7 @@ typedef struct _CursorScreen {
#define Unwrap(as,s,elt,backup) (((backup) = (s)->elt), (s)->elt = (as)->elt)
/* The cursor doesn't show up until the first XDefineCursor() */
-static Bool CursorVisible = FALSE;
-
+Bool CursorVisible = FALSE;
Bool EnableCursor = TRUE;
static Bool
@@ -152,12 +151,7 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor)
Unwrap(cs, pScreen, DisplayCursor, backupProc);
- /*
- * Have to check ConnectionInfo to distinguish client requests from
- * initial root window setup. Not a great way to do it, I admit.
- */
- if (ConnectionInfo)
- CursorVisible = EnableCursor;
+ CursorVisible = CursorVisible && EnableCursor;
if (cs->pCursorHideCounts != NULL || !CursorVisible) {
ret = (*pScreen->DisplayCursor) (pDev, pScreen, NullCursor);