[Xquartz-changes] xserver: Branch 'server-1.4-apple' - 2 commits
Jeremy Huddleston
jeremyhu at freedesktop.org
Wed Nov 4 12:28:25 PST 2009
dix/events.c | 8 +++-----
hw/xquartz/X11Application.m | 6 ++++++
hw/xquartz/X11Controller.h | 1 +
hw/xquartz/quartzKeyboard.c | 23 +++++++++++++++++++++++
4 files changed, 33 insertions(+), 5 deletions(-)
New commits:
commit afa2aa860aa2e76c33daf0b1ecc5f5dd79e3a050
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Wed Nov 4 12:27:24 2009 -0800
dix: Properly detect if the other device is frozen
Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
(cherry picked from commit 7f48713a780e14b08e8e71c6ad3a11a7e17813b8)
diff --git a/dix/events.c b/dix/events.c
index 6458173..a5f176c 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1441,7 +1441,7 @@ AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState)
thisGrabbed = thisDev->grab && SameClient(thisDev->grab, client);
thisSynced = FALSE;
otherGrabbed = FALSE;
- othersFrozen = TRUE;
+ othersFrozen = FALSE;
grabTime = thisDev->grabTime;
for (dev = inputInfo.devices; dev; dev = dev->next)
{
@@ -1455,11 +1455,9 @@ AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState)
otherGrabbed = TRUE;
if (thisDev->sync.other == dev->grab)
thisSynced = TRUE;
- if (dev->sync.state < FROZEN)
- othersFrozen = FALSE;
+ if (dev->sync.state >= FROZEN)
+ othersFrozen = TRUE;
}
- else if (!dev->sync.other || !SameClient(dev->sync.other, client))
- othersFrozen = FALSE;
}
if (!((thisGrabbed && thisDev->sync.state >= FROZEN) || thisSynced))
return;
commit 1362f8023a3c55fb83f907d99570d2a935c94707
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date: Tue Nov 3 16:35:27 2009 -0800
XQuartz: Run xmodmap after programatically updating the keymap.
Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
Signed-off-by: Martin Otte <otte at duke.edu>
(cherry picked from commit 5e79976c13c5b94b12392b493846ca26be11750b)
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 1d61a50..bff8415 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -962,6 +962,12 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
/* not reached */
}
+void launch_client(const char *cmd) {
+ NSString *string = [[NSString alloc] initWithUTF8String:cmd];
+ [[X11App controller] launch_client:string];
+ [string release];
+}
+
@implementation X11Application (Private)
#ifdef NX_DEVICELCMDKEYMASK
diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index a86b20f..3d8e007 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -144,5 +144,6 @@ typedef unsigned int NSUInteger;
#endif /* __OBJC__ */
void X11ControllerMain(int argc, char **argv, char **envp);
+void launch_client(const char *cmd);
#endif /* X11CONTROLLER_H */
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index d284b93..6f8b383 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -52,6 +52,8 @@
#include "quartzKeyboard.h"
#include "quartzAudio.h"
+#include "X11Application.h"
+
#include "threadSafety.h"
#ifdef NDEBUG
@@ -372,6 +374,10 @@ void DarwinKeyboardReloadHandler(void) {
CFIndex initialKeyRepeatValue, keyRepeatValue;
BOOL ok;
DeviceIntPtr pDev = darwinKeyboard;
+ const char *xmodmap = PROJECTROOT "/bin/xmodmap";
+ const char *sysmodmap = PROJECTROOT "/lib/X11/xinit/.Xmodmap";
+ const char *homedir = getenv("HOME");
+ char usermodmap[PATH_MAX], cmd[PATH_MAX];
DEBUG_LOG("DarwinKeyboardReloadHandler\n");
@@ -415,6 +421,23 @@ void DarwinKeyboardReloadHandler(void) {
}
XkbUpdateCoreDescription(darwinKeyboard, 0);
} pthread_mutex_unlock(&keyInfo_mutex);
+
+ /* Check for system .Xmodmap */
+ if (access(xmodmap, F_OK) == 0) {
+ if (access(sysmodmap, F_OK) == 0) {
+ snprintf (cmd, sizeof(cmd), "%s %s", xmodmap, sysmodmap);
+ launch_client(cmd);
+ }
+ }
+
+ /* 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);
+ launch_client(cmd);
+ }
+ }
}
//-----------------------------------------------------------------------------
More information about the Xquartz-changes
mailing list