* Wed Aug 20 2008 Adam Jackson <ajax@redhat.com> 1.4.99.906-9

- xserver-1.5.0-hide-cursor.patch: Suppress displaying the cursor until
  an app calls XDefineCursor().
This commit is contained in:
Adam Jackson 2008-08-22 20:08:52 +00:00
parent 04e6c06e9c
commit a2498155a2
2 changed files with 100 additions and 2 deletions

View File

@ -19,7 +19,7 @@
Summary: X.Org X11 X server Summary: X.Org X11 X server
Name: xorg-x11-server Name: xorg-x11-server
Version: 1.4.99.906 Version: 1.4.99.906
Release: 8%{?dist} Release: 9%{?dist}
URL: http://www.x.org URL: http://www.x.org
License: MIT License: MIT
Group: User Interface/X Group: User Interface/X
@ -67,8 +67,8 @@ Patch5011: xserver-1.4.99-endian.patch
# evdev keyboard map fix # evdev keyboard map fix
Patch5013: xserver-1.5.0-xkb-fix-ProcXkbSetXYZ-to-work-on-all.patch Patch5013: xserver-1.5.0-xkb-fix-ProcXkbSetXYZ-to-work-on-all.patch
Patch5014: xserver-1.5.0-force-SwitchCoreKeyboard-for-evdev.patch Patch5014: xserver-1.5.0-force-SwitchCoreKeyboard-for-evdev.patch
Patch5015: xserver-1.5.0-enable-selinux.patch Patch5015: xserver-1.5.0-enable-selinux.patch
Patch6000: xserver-1.5.0-hide-cursor.patch
%define moduledir %{_libdir}/xorg/modules %define moduledir %{_libdir}/xorg/modules
%define drimoduledir %{_libdir}/dri %define drimoduledir %{_libdir}/dri
@ -494,6 +494,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Wed Aug 20 2008 Adam Jackson <ajax@redhat.com> 1.4.99.906-9
- xserver-1.5.0-hide-cursor.patch: Suppress displaying the cursor until
an app calls XDefineCursor().
* Thu Aug 14 2008 Kristian Høgsberg <krh@redhat.com> - 1.4.99.906-8 * Thu Aug 14 2008 Kristian Høgsberg <krh@redhat.com> - 1.4.99.906-8
- Add bg-none-root patch for plymouth. - Add bg-none-root patch for plymouth.

View File

@ -0,0 +1,94 @@
From e99347a3e82e6db47dd482169b6799968afc3893 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Wed, 20 Aug 2008 10:11:07 -0400
Subject: [PATCH] Hide the cursor until the first XDefineCursor() call.
---
xfixes/cursor.c | 28 ++++++++++++++++++++++++++--
1 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index d51251f..c8c4c9f 100755
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -70,7 +70,7 @@
return BadCursor; \
} \
}
-
+
/*
* There is a global list of windows selecting for cursor events
*/
@@ -109,6 +109,7 @@
typedef struct _CursorScreen {
DisplayCursorProcPtr DisplayCursor;
+ ChangeWindowAttributesProcPtr ChangeWindowAttributes;
CloseScreenProcPtr CloseScreen;
CursorHideCountPtr pCursorHideCounts;
} CursorScreenRec, *CursorScreenPtr;
@@ -119,6 +120,9 @@
#define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func)
#define Unwrap(as,s,elt) ((s)->elt = (as)->elt)
+/* The cursor doesn't show up until the first XDefineCursor() */
+static Bool CursorVisible = FALSE;
+
static Bool
CursorDisplayCursor (ScreenPtr pScreen,
CursorPtr pCursor)
@@ -128,7 +132,7 @@
Unwrap (cs, pScreen, DisplayCursor);
- if (cs->pCursorHideCounts != NULL) {
+ if (cs->pCursorHideCounts != NULL || !CursorVisible) {
ret = (*pScreen->DisplayCursor) (pScreen, pInvisibleCursor);
} else {
ret = (*pScreen->DisplayCursor) (pScreen, pCursor);
@@ -161,6 +165,24 @@
}
static Bool
+CursorChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
+{
+ ScreenPtr pScreen = pWin->drawable.pScreen;
+ CursorScreenPtr cs = GetCursorScreen(pScreen);
+ Bool ret;
+ extern char *ConnectionInfo;
+
+ if ((mask & CWCursor) && ConnectionInfo)
+ CursorVisible = TRUE;
+
+ Unwrap(cs, pScreen, ChangeWindowAttributes);
+ ret = pScreen->ChangeWindowAttributes(pWin, mask);
+ Wrap(cs, pScreen, ChangeWindowAttributes, CursorChangeWindowAttributes);
+
+ return ret;
+}
+
+static Bool
CursorCloseScreen (int index, ScreenPtr pScreen)
{
CursorScreenPtr cs = GetCursorScreen (pScreen);
@@ -168,6 +190,7 @@
Unwrap (cs, pScreen, CloseScreen);
Unwrap (cs, pScreen, DisplayCursor);
+ Unwrap (cs, pScreen, ChangeWindowAttributes);
deleteCursorHideCountsForScreen(pScreen);
ret = (*pScreen->CloseScreen) (index, pScreen);
xfree (cs);
@@ -1042,6 +1065,8 @@
return FALSE;
Wrap (cs, pScreen, CloseScreen, CursorCloseScreen);
Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor);
+ Wrap (cs, pScreen, ChangeWindowAttributes,
+ CursorChangeWindowAttributes);
cs->pCursorHideCounts = NULL;
SetCursorScreen (pScreen, cs);
}
--
1.5.6.4