mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
dix: only show the cursor if a window defines one (#58398)
e02f864fdf "Suppress cursor display until the first XDefineCursor() request"
disabled cursor display a priori unless -retro is given.
On a plain server, caling XFixesHideCursor() and XFixesShowCursor() would
show the default root cursor, despite no client actually defining a cursor.
Change the logic, disable CursorVisible by default and only enable it from
the window's CWCursor logic. If no window ever defines a cursor, said cursor
stays invisible.
X.Org Bug 58398 <http://bugs.freedesktop.org/show_bug.cgi?id=58398>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Bastien Nocera <hadess@hadess.net>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
This commit is contained in:
@@ -129,8 +129,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
|
||||
@@ -142,12 +141,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);
|
||||
|
||||
Reference in New Issue
Block a user