diff options
author | Daniel Stone <daniel@fooishbar.org> | 2007-07-08 20:48:57 +0300 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2007-08-01 01:53:31 +0300 |
commit | 0afeb0241a83796575da827bd81375c99ff10af5 (patch) | |
tree | 091937004feb6ebe531afd1c08cee62e5191ef67 /dix/cursor.c | |
parent | 62ec6d09b3adaea82ff52c8672e6f611c15ec56d (diff) |
DIX: Clean up null root cursor handling
Move the null root cursor handling out of main() and into CreateRootCursor.
Diffstat (limited to 'dix/cursor.c')
-rw-r--r-- | dix/cursor.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/dix/cursor.c b/dix/cursor.c index 5ab562ead..d903124c4 100644 --- a/dix/cursor.c +++ b/dix/cursor.c @@ -430,25 +430,41 @@ AllocGlyphCursor(Font source, unsigned sourceChar, Font mask, unsigned maskChar, *************************************************************/ CursorPtr -CreateRootCursor(char *pfilename, unsigned glyph) +CreateRootCursor(char *unused1, unsigned int unused2) { CursorPtr curs; +#ifdef NULL_ROOT_CURSOR + CursorMetricRec cm; +#else FontPtr cursorfont; int err; XID fontID; +#endif + +#ifdef NULL_ROOT_CURSOR + cm.width = 0; + cm.height = 0; + cm.xhot = 0; + cm.yhot = 0; + curs = AllocCursor(NULL, NULL, &cm, 0, 0, 0, 0, 0, 0); + + if (curs == NullCursor) + return NullCursor; +#else fontID = FakeClientID(0); err = OpenFont(serverClient, fontID, FontLoadAll | FontOpenSync, - (unsigned)strlen( pfilename), pfilename); + (unsigned)strlen(defaultCursorFont), defaultCursorFont); if (err != Success) return NullCursor; cursorfont = (FontPtr)LookupIDByType(fontID, RT_FONT); if (!cursorfont) return NullCursor; - if (AllocGlyphCursor(fontID, glyph, fontID, glyph + 1, + if (AllocGlyphCursor(fontID, 0, fontID, 1, 0, 0, 0, ~0, ~0, ~0, &curs, serverClient) != Success) return NullCursor; +#endif if (!AddResource(FakeClientID(0), RT_CURSOR, (pointer)curs)) return NullCursor; |