aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/dixfonts.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/dixfonts.c')
-rw-r--r--xorg-server/dix/dixfonts.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/xorg-server/dix/dixfonts.c b/xorg-server/dix/dixfonts.c
index 496e075d9..c701c9fbe 100644
--- a/xorg-server/dix/dixfonts.c
+++ b/xorg-server/dix/dixfonts.c
@@ -74,6 +74,10 @@ Equipment Corporation.
#include "xf86bigfontsrv.h"
#endif
+#ifdef _MSC_VER
+#define strdup _strdup
+#endif
+
#define QUERYCHARINFO(pci, pr) *(pr) = (pci)->metrics
extern pointer fosNaturalParams;
@@ -130,6 +134,7 @@ SetDefaultFont(char *defaultfontname)
int err;
FontPtr pf;
XID fid;
+ static FontPtr last_pf;
fid = FakeClientID(0);
err = OpenFont(serverClient, fid, FontLoadAll | FontOpenSync,
@@ -138,9 +143,10 @@ SetDefaultFont(char *defaultfontname)
return FALSE;
err = dixLookupResourceByType((pointer *)&pf, fid, RT_FONT, serverClient,
DixReadAccess);
- if (err != Success)
+ if (err == Success) last_pf = pf;
+ if (last_pf == (FontPtr) NULL)
return FALSE;
- defaultFont = pf;
+ defaultFont = last_pf;
return TRUE;
}
@@ -1164,7 +1170,7 @@ badAlloc:
#define TextEltHeader 2
#define FontShiftSize 5
-static ChangeGCVal clearGC[] = { { .ptr = NullPixmap } };
+static ChangeGCVal clearGC[] = { NullPixmap };
#define clearGCmask (GCClipMask)
int