aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.7.99.2/hide-cursor-and-ppm-root.patch
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.7.99.2/hide-cursor-and-ppm-root.patch
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadopenembedded-core-contrib-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.7.99.2/hide-cursor-and-ppm-root.patch')
-rw-r--r--meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.7.99.2/hide-cursor-and-ppm-root.patch308
1 files changed, 308 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.7.99.2/hide-cursor-and-ppm-root.patch b/meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.7.99.2/hide-cursor-and-ppm-root.patch
new file mode 100644
index 0000000000..73f30ee716
--- /dev/null
+++ b/meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.7.99.2/hide-cursor-and-ppm-root.patch
@@ -0,0 +1,308 @@
+Index: xorg-server-1.7.99.2/dix/window.c
+===================================================================
+--- xorg-server-1.7.99.2.orig/dix/window.c 2009-11-04 16:25:50.000000000 +0000
++++ xorg-server-1.7.99.2/dix/window.c 2010-02-10 17:42:22.719078216 +0000
+@@ -179,6 +179,8 @@
+
+ #define SubStrSend(pWin,pParent) (StrSend(pWin) || SubSend(pParent))
+
++char* RootPPM = NULL;
++
+ #ifdef DEBUG
+ /******
+ * PrintWindowTree
+@@ -304,6 +306,115 @@
+ #endif
+ }
+
++static int
++get_int(FILE *fp)
++{
++ int c = 0;
++
++ while ((c = getc(fp)) != EOF)
++ {
++ if (isspace(c))
++ continue;
++
++ if (c == '#')
++ while (c = getc(fp))
++ if (c == EOF)
++ return 0;
++ else if (c == '\n')
++ break;
++
++ if (isdigit(c))
++ {
++ int val = c - '0';
++ while ((c = getc(fp)) && isdigit(c))
++ val = (val * 10) + (c - '0');
++ return val;
++ }
++ }
++
++ return 0;
++}
++
++static unsigned char*
++ppm_load (const char* path, int depth, int *width, int *height)
++{
++ FILE *fp;
++ int max, n = 0, w, h, i, j, bytes_per_line;
++ unsigned char *data, *res, h1, h2;
++
++ if (depth < 16 || depth > 32)
++ return NULL;
++
++ if (depth > 16)
++ depth = 32;
++
++ fp = fopen (path, "r");
++ if (fp == NULL)
++ return FALSE;
++
++ h1 = getc(fp);
++ h2 = getc(fp);
++
++ /* magic is 'P6' for raw ppm */
++ if (h1 != 'P' && h2 != '6')
++ goto fail;
++
++ w = get_int(fp);
++ h = get_int(fp);
++
++ if (w == 0 || h == 0)
++ goto fail;
++
++ max = get_int(fp);
++
++ if (max != 255)
++ goto fail;
++
++ bytes_per_line = ((w * depth + 31) >> 5) << 2;
++
++ res = data = malloc(bytes_per_line * h);
++
++ for (i=0; i<h; i++)
++ {
++ for (j=0; j<w; j++)
++ {
++ unsigned char buf[3];
++ fread(buf, 1, 3, fp);
++
++ switch (depth)
++ {
++ case 24:
++ case 32:
++ *data = buf[2];
++ *(data+1) = buf[1];
++ *(data+2) = buf[0];
++ data += 4;
++ break;
++ case 16:
++ default:
++ *(unsigned short*)data
++ = ((buf[0] >> 3) << 11) | ((buf[1] >> 2) << 5) | (buf[2] >> 3);
++ data += 2;
++ break;
++ }
++ }
++ data += (bytes_per_line - (w*(depth>>3)));
++ }
++
++ data = res;
++
++ *width = w;
++ *height = h;
++
++ fclose(fp);
++
++ return res;
++
++ fail:
++ fclose(fp);
++ return NULL;
++}
++
+ static void
+ MakeRootTile(WindowPtr pWin)
+ {
+@@ -314,6 +425,36 @@
+ unsigned char *from, *to;
+ int i, j;
+
++ if (RootPPM != NULL)
++ {
++ int w, h;
++ unsigned char *data;
++
++ if ((data = ppm_load (RootPPM, pScreen->rootDepth, &w, &h)) != NULL)
++ {
++ pWin->background.pixmap
++ = (*pScreen->CreatePixmap)(pScreen, w, h, pScreen->rootDepth, 0);
++
++ pWin->backgroundState = BackgroundPixmap;
++ pGC = GetScratchGC(pScreen->rootDepth, pScreen);
++ if (!pWin->background.pixmap || !pGC)
++ FatalError("could not create root tile");
++
++ ValidateGC((DrawablePtr)pWin->background.pixmap, pGC);
++
++ (*pGC->ops->PutImage)((DrawablePtr)pWin->background.pixmap,
++ pGC,
++ pScreen->rootDepth,
++ 0, 0, w, h, 0, ZPixmap, (char *)data);
++ FreeScratchGC(pGC);
++
++ free(data);
++ return;
++ }
++ else
++ ErrorF("Unable to load root window image.");
++ }
++
+ pWin->background.pixmap = (*pScreen->CreatePixmap)(pScreen, 4, 4,
+ pScreen->rootDepth, 0);
+
+@@ -530,6 +671,7 @@
+ }
+
+
++
+ WindowPtr
+ RealChildHead(WindowPtr pWin)
+ {
+Index: xorg-server-1.7.99.2/hw/kdrive/src/kdrive.c
+===================================================================
+--- xorg-server-1.7.99.2.orig/hw/kdrive/src/kdrive.c 2010-02-10 17:36:36.000000000 +0000
++++ xorg-server-1.7.99.2/hw/kdrive/src/kdrive.c 2010-02-10 17:43:07.797828099 +0000
+@@ -60,6 +60,9 @@
+ { 32, 32 }
+ };
+
++int
++ProcXFixesHideCursor (ClientPtr client) ;
++
+ #define NUM_KD_DEPTHS (sizeof (kdDepths) / sizeof (kdDepths[0]))
+
+ #define KD_DEFAULT_BUTTONS 5
+@@ -92,6 +95,9 @@
+
+ KdOsFuncs *kdOsFuncs;
+
++extern Bool CursorInitiallyHidden; /* See Xfixes cursor.c */
++extern char* RootPPM; /* dix/window.c */
++
+ void
+ KdSetRootClip (ScreenPtr pScreen, BOOL enable)
+ {
+@@ -275,6 +281,7 @@
+ KdSetRootClip (pScreen, TRUE);
+ if (pScreenPriv->card->cfuncs->dpms)
+ (*pScreenPriv->card->cfuncs->dpms) (pScreen, pScreenPriv->dpmsState);
++
+ return TRUE;
+ }
+
+@@ -553,6 +560,8 @@
+ ErrorF("-switchCmd Command to execute on vt switch\n");
+ ErrorF("-zap Terminate server on Ctrl+Alt+Backspace\n");
+ ErrorF("vtxx Use virtual terminal xx instead of the next available\n");
++ ErrorF("-hide-cursor Start with cursor hidden\n");
++ ErrorF("-root-ppm [path] Specify ppm file to use as root window background.\n");
+ }
+
+ int
+@@ -616,6 +625,19 @@
+ kdSoftCursor = TRUE;
+ return 1;
+ }
++ if (!strcmp (argv[i], "-hide-cursor"))
++ {
++ CursorInitiallyHidden = TRUE;
++ return 1;
++ }
++ if (!strcmp (argv[i], "-root-ppm"))
++ {
++ if ((i+1) < argc)
++ RootPPM = argv[i+1];
++ else
++ UseMsg ();
++ return 2;
++ }
+ if (!strcmp (argv[i], "-videoTest"))
+ {
+ kdVideoTest = TRUE;
+Index: xorg-server-1.7.99.2/xfixes/cursor.c
+===================================================================
+--- xorg-server-1.7.99.2.orig/xfixes/cursor.c 2009-12-19 01:43:53.000000000 +0000
++++ xorg-server-1.7.99.2/xfixes/cursor.c 2010-02-10 17:45:02.089079491 +0000
+@@ -57,6 +57,7 @@
+ static RESTYPE CursorClientType;
+ static RESTYPE CursorHideCountType;
+ static RESTYPE CursorWindowType;
++static Bool CursorGloballyHidden;
+ static CursorPtr CursorCurrent[MAXDEVICES];
+ static CursorPtr pInvisibleCursor = NULL;
+
+@@ -65,6 +66,8 @@
+
+ static void deleteCursorHideCountsForScreen (ScreenPtr pScreen);
+
++Bool CursorInitiallyHidden = FALSE;
++
+ #define VERIFY_CURSOR(pCursor, cursor, client, access) \
+ do { \
+ int err; \
+@@ -150,7 +153,7 @@
+ if (ConnectionInfo)
+ CursorVisible = EnableCursor;
+
+- if (cs->pCursorHideCounts != NULL || !CursorVisible) {
++ if (cs->pCursorHideCounts != NULL || !CursorVisible || CursorGloballyHidden) {
+ ret = ((*pScreen->RealizeCursor)(pDev, pScreen, pInvisibleCursor) &&
+ (*pScreen->DisplayCursor) (pDev, pScreen, pInvisibleCursor));
+ } else {
+@@ -887,6 +890,12 @@
+ return (ret == BadValue) ? BadWindow : ret;
+ }
+
++ /* Is cursor set to be initially hidden ?, if so reset this
++ * flag as now visibility assumed under control of client.
++ */
++ if (CursorGloballyHidden)
++ CursorGloballyHidden = FALSE;
++
+ /*
+ * Has client hidden the cursor before on this screen?
+ * If so, just increment the count.
+@@ -950,9 +959,19 @@
+ return (rc == BadValue) ? BadWindow : rc;
+ }
+
++ /* X was started with cursor hidden, therefore just reset our flag
++ * (returning to normal client control) and cause cursor to now be
++ * shown.
++ */
++ if (CursorGloballyHidden == TRUE)
++ {
++ CursorGloballyHidden = FALSE;
++ return (client->noClientException);
++ }
++
+ /*
+ * Has client hidden the cursor on this screen?
+- * If not, generate an error.
++ * If so, generate an error.
+ */
+ pChc = findCursorHideCount(client, pWin->drawable.pScreen);
+ if (pChc == NULL) {
+@@ -1068,6 +1087,8 @@
+ {
+ int i;
+
++ CursorGloballyHidden = CursorInitiallyHidden;
++
+ if (party_like_its_1989)
+ CursorVisible = EnableCursor;
+