xserver: Branch 'xorg-server-1.2-apple' - 4 commits

Ben Byer bbyer at kemper.freedesktop.org
Wed Oct 31 04:09:36 PDT 2007


 hw/darwin/apple/X11Application.m |   11 +++++------
 hw/darwin/apple/X11Controller.m  |    8 +++++---
 hw/darwin/darwinEvents.c         |   16 ++++++++++++++++
 3 files changed, 26 insertions(+), 9 deletions(-)

New commits:
commit 26e84bcd52ad633c6b5261501f39cd225d84ef82
Author: Ben Byer <bbyer at bbyer.local>
Date:   Wed Oct 31 04:09:32 2007 -0700

    fixed bug that prevented customized Applications menu items
    with arguments from working

diff --git a/hw/darwin/apple/X11Controller.m b/hw/darwin/apple/X11Controller.m
index cc039b1..a6a75d0 100644
--- a/hw/darwin/apple/X11Controller.m
+++ b/hw/darwin/apple/X11Controller.m
@@ -296,15 +296,17 @@
 - (void) launch_client:(NSString *)filename
 {
   const char *command = [filename UTF8String];
-  const char *argv[5];
+  const char *argv[7];
   int child1, child2 = 0;
   int status;
 	
   argv[0] = "/usr/bin/login";
   argv[1] = "-fp";
   argv[2] = getlogin();
-  argv[3] = command;
-  argv[4] = NULL;
+  argv[3] = "/bin/sh";
+  argv[4] = "-c";
+  argv[5] = command;
+  argv[6] = NULL;
     
   /* Do the fork-twice trick to avoid having to reap zombies */
     
commit 6b293e9204492d131a9f9330ebb2e247fcec8a09
Author: Ben Byer <bbyer at bbyer.local>
Date:   Wed Oct 31 04:08:06 2007 -0700

    fix incorrectly formatted .xinitrc warning

diff --git a/hw/darwin/apple/X11Application.m b/hw/darwin/apple/X11Application.m
index a4adc05..afd495b 100644
--- a/hw/darwin/apple/X11Application.m
+++ b/hw/darwin/apple/X11Application.m
@@ -895,12 +895,11 @@ check_xinitrc (void)
 	
     /* FIXME: put localized strings into Resources/English.lproj */
 	
-    msg = NSLocalizedString (
-							 @"You have an existing ~/.xinitrc file.\n\n\
-							 Windows displayed by X11 applications may not have titlebars, or may look \
-							 different to windows displayed by native applications.\n\n\
-							 Would you like to move aside the existing file and use the standard X11 \
-							 environment?", @"Startup xinitrc dialog");
+    msg = NSLocalizedString (@"You have an existing ~/.xinitrc file.\n\n\
+Windows displayed by X11 applications may not have titlebars, or may look \
+different to windows displayed by native applications.\n\n\
+Would you like to move aside the existing file and use the standard X11 \
+environment?", @"Startup xinitrc dialog");
 	
     if (NSRunAlertPanel (nil, msg, NSLocalizedString (@"Yes", @""),
 						 NSLocalizedString (@"No", @""), nil)
commit 9cf83386e828e38fca2a164dee322e9208ec8fd6
Author: Ben Byer <bbyer at bbyer.local>
Date:   Wed Oct 31 03:39:47 2007 -0700

    Trap Deactivate messages and release modifiers to avoid "stuck shift lock" (etc) bugs

diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
index fc79da8..6293d6b 100644
--- a/hw/darwin/darwinEvents.c
+++ b/hw/darwin/darwinEvents.c
@@ -143,6 +143,16 @@ static void DarwinUpdateModifiers(
     }
 }
 
+/*
+ * DarwinReleaseModifiers
+ * This hacky function releases all modifier keys.  It should be called when X11.app
+ * is deactivated (kXDarwinDeactivate) to prevent modifiers from getting stuck if they
+ * are held down during a "context" switch -- otherwise, we would miss the KeyUp.
+ */
+static void DarwinReleaseModifiers(void) {
+	xEvent e;
+	DarwinUpdateModifiers(&e, KeyRelease, COMMAND_MASK(-1) | CONTROL_MASK(-1) | ALTERNATE_MASK(-1) | SHIFT_MASK(-1));
+}
 
 /*
  * DarwinSimulateMouseClick
@@ -467,6 +477,9 @@ void ProcessInputEvents(void)
                 break;
             }
 
+			case kXDarwinDeactivate:
+				DarwinReleaseModifiers();
+				// fall through
             default:
                 // Check for mode specific event
                 DarwinModeProcessEvent(&xe);
commit e306e8760f2caebd38c4d96c30f029a965f23b76
Author: Ben Byer <bbyer at bbyer.local>
Date:   Wed Oct 31 03:22:18 2007 -0700

    Workaround for a bug where the holding down Command to make a "fake"
    button 2 click would actually result in a Command-2 chord.
    (I.e. it wasn't releasing Command before clicking the fake button.)

diff --git a/hw/darwin/darwinEvents.c b/hw/darwin/darwinEvents.c
index 6b4f727..fc79da8 100644
--- a/hw/darwin/darwinEvents.c
+++ b/hw/darwin/darwinEvents.c
@@ -162,6 +162,9 @@ static void DarwinSimulateMouseClick(
     int modifierMask)   // modifiers used for the fake click
 {
     // first fool X into forgetting about the keys
+	// for some reason, it's not enough to tell X we released the Command key -- 
+	// it has to be the *left* Command key.
+	if (modifierMask & NX_COMMANDMASK) modifierMask |=NX_DEVICELCMDKEYMASK ;
     DarwinUpdateModifiers(xe, KeyRelease, modifierMask);
 
     // push the mouse button


More information about the xorg-commit mailing list