summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-06-10 13:36:35 -0700
committerKeith Packard <keithp@keithp.com>2010-06-10 13:36:35 -0700
commit84190d20954ef7888e4d96832c2a4b3225b4dfa2 (patch)
treee4fcd79d2d95fda7b2cea04a904cf87dbe166cd5 /hw
parent4172aa137c1b9b6f2a25c320d847af1f5ac56fba (diff)
parent5e1ef1f4dde4615498c1c5e7a4e422c3b3432fe8 (diff)
Merge remote branch 'jeremyhu/master'
Diffstat (limited to 'hw')
-rw-r--r--hw/xquartz/quartzKeyboard.c30
-rw-r--r--hw/xquartz/xpr/dri.c16
-rw-r--r--hw/xquartz/xpr/driWrap.c10
-rw-r--r--hw/xquartz/xpr/xprCursor.c4
4 files changed, 31 insertions, 29 deletions
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 745333f03..75cf23ff4 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -427,20 +427,28 @@ void DarwinKeyboardReloadHandler(void) {
}
} pthread_mutex_unlock(&keyInfo_mutex);
- /* Check for system .Xmodmap */
+ /* Modify with xmodmap */
if (access(xmodmap, F_OK) == 0) {
+ /* Check for system .Xmodmap */
if (access(sysmodmap, F_OK) == 0) {
- snprintf (cmd, sizeof(cmd), "%s %s", xmodmap, sysmodmap);
- X11ApplicationLaunchClient(cmd);
+ if(snprintf (cmd, sizeof(cmd), "%s %s", xmodmap, sysmodmap) < sizeof(cmd)) {
+ X11ApplicationLaunchClient(cmd);
+ } else {
+ ErrorF("X11.app: Unable to create / execute xmodmap command line");
+ }
}
- }
-
- /* Check for user's local .Xmodmap */
- if (homedir != NULL) {
- snprintf (usermodmap, sizeof(usermodmap), "%s/.Xmodmap", homedir);
- if (access(usermodmap, F_OK) == 0) {
- snprintf (cmd, sizeof(cmd), "%s %s", xmodmap, usermodmap);
- X11ApplicationLaunchClient(cmd);
+
+ /* Check for user's local .Xmodmap */
+ if ((homedir != NULL) && (snprintf (usermodmap, sizeof(usermodmap), "%s/.Xmodmap", homedir) < sizeof(usermodmap))) {
+ if (access(usermodmap, F_OK) == 0) {
+ if(snprintf (cmd, sizeof(cmd), "%s %s", xmodmap, usermodmap) < sizeof(cmd)) {
+ X11ApplicationLaunchClient(cmd);
+ } else {
+ ErrorF("X11.app: Unable to create / execute xmodmap command line");
+ }
+ }
+ } else {
+ ErrorF("X11.app: Unable to determine path to user's .Xmodmap");
}
}
}
diff --git a/hw/xquartz/xpr/dri.c b/hw/xquartz/xpr/dri.c
index dc780038d..0d2c51a2a 100644
--- a/hw/xquartz/xpr/dri.c
+++ b/hw/xquartz/xpr/dri.c
@@ -205,14 +205,14 @@ DRIScreenInit(ScreenPtr pScreen)
DRIScreenPrivPtr pDRIPriv;
int i;
- if (!dixRegisterPrivateKey(&DRIScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
- return FALSE:
- if (!dixRegisterPrivateKey(&DRIWindowPrivateKeyRec, PRIVATE_WINDOW, 0))
- return FALSE:
- if (!dixRegisterPrivateKey(&DRIPixmapPrivateKeyRec, PRIVATE_PIXMAP, 0))
- return FALSE:
- if (!dixRegisterPrivateKey(&DRIPixmapBufferPrivateKeyRec, PRIVATE_PIXMAP, 0))
- return FALSE:
+ if (!dixRegisterPrivateKey(&DRIScreenPrivKeyRec, PRIVATE_SCREEN, 0))
+ return FALSE;
+ if (!dixRegisterPrivateKey(&DRIWindowPrivKeyRec, PRIVATE_WINDOW, 0))
+ return FALSE;
+ if (!dixRegisterPrivateKey(&DRIPixmapPrivKeyRec, PRIVATE_PIXMAP, 0))
+ return FALSE;
+ if (!dixRegisterPrivateKey(&DRIPixmapBufferPrivKeyRec, PRIVATE_PIXMAP, 0))
+ return FALSE;
pDRIPriv = (DRIScreenPrivPtr) calloc(1, sizeof(DRIScreenPrivRec));
if (!pDRIPriv) {
diff --git a/hw/xquartz/xpr/driWrap.c b/hw/xquartz/xpr/driWrap.c
index efbae3caf..65843b83f 100644
--- a/hw/xquartz/xpr/driWrap.c
+++ b/hw/xquartz/xpr/driWrap.c
@@ -530,18 +530,12 @@ DRIWrapInit(ScreenPtr pScreen) {
if(!dixRegisterPrivateKey(&driGCKeyRec, PRIVATE_GC, sizeof(DRIGCRec)))
return FALSE;
- if(!dixRegisterPrivateKey(&driWrapScreenKeyRec, PRIVATE_WINDOW, sizeof(DRIWrapScreenRec)))
- return FALSE;
-
- pScreenPriv = malloc(sizeof(*pScreenPriv));
-
- if(NULL == pScreenPriv)
+ if(!dixRegisterPrivateKey(&driWrapScreenKeyRec, PRIVATE_SCREEN, sizeof(DRIWrapScreenRec)))
return FALSE;
+ pScreenPriv = dixGetPrivateAddr(&pScreen->devPrivates, &driWrapScreenKeyRec);
pScreenPriv->CreateGC = pScreen->CreateGC;
pScreen->CreateGC = DRICreateGC;
- dixSetPrivate(&pScreen->devPrivates, driWrapScreenKey, pScreenPriv);
-
return TRUE;
}
diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c
index c268c2c87..67fcbe76e 100644
--- a/hw/xquartz/xpr/xprCursor.c
+++ b/hw/xquartz/xpr/xprCursor.c
@@ -58,7 +58,7 @@ typedef struct {
} QuartzCursorScreenRec, *QuartzCursorScreenPtr;
static DevPrivateKeyRec darwinCursorScreenKeyRec;
-#define darwinCursorScreenKey (&darwinCursorScreenKey)
+#define darwinCursorScreenKey (&darwinCursorScreenKeyRec)
#define CURSOR_PRIV(pScreen) ((QuartzCursorScreenPtr) \
dixLookupPrivate(&pScreen->devPrivates, darwinCursorScreenKey))
@@ -359,7 +359,7 @@ QuartzInitCursor(ScreenPtr pScreen)
if (!miDCInitialize(pScreen, &quartzScreenFuncsRec))
return FALSE;
- if (!dixRegisterPrivate(&darwinCursorScreenKeyRec, PRIVATE_SCREEN, 0))
+ if (!dixRegisterPrivateKey(&darwinCursorScreenKeyRec, PRIVATE_SCREEN, 0))
return FALSE;
ScreenPriv = calloc(1, sizeof(QuartzCursorScreenRec));