[44536] trunk/dports/x11/xorg-server

jeremyhu at macports.org jeremyhu at macports.org
Mon Dec 29 21:31:35 PST 2008


Revision: 44536
          http://trac.macports.org/changeset/44536
Author:   jeremyhu at macports.org
Date:     2008-12-29 21:31:34 -0800 (Mon, 29 Dec 2008)
Log Message:
-----------
xorg-server: Bump to 1.4.2-apple30 to match what's shipping in 2.3.2_rc5 from xquartz.macosforge.org

Modified Paths:
--------------
    trunk/dports/x11/xorg-server/Portfile

Added Paths:
-----------
    trunk/dports/x11/xorg-server/files/vnc-workaround.patch

Modified: trunk/dports/x11/xorg-server/Portfile
===================================================================
--- trunk/dports/x11/xorg-server/Portfile	2008-12-30 04:51:46 UTC (rev 44535)
+++ trunk/dports/x11/xorg-server/Portfile	2008-12-30 05:31:34 UTC (rev 44536)
@@ -3,7 +3,7 @@
 PortSystem 1.0
 
 name		xorg-server
-version		1.4.2-apple29
+version		1.4.2-apple30
 categories	x11 devel
 maintainers	jeremyhu openmaintainer
 description	The X.org / Xquartz X server.
@@ -18,10 +18,10 @@
 distfiles	xorg-server-$version.tar.bz2:xq \
 		MesaLib-${mesavers}.tar.bz2:mesa
 
-checksums           xorg-server-1.4.2-apple29.tar.bz2 \
-                    md5     57b8a1d7c90780388cf3d5bff207ae29 \
-                    sha1    cce49bd56889038c6ba2315b4a4361532aeb2e4d \
-                    rmd160  31f50db729a6ab1d47daff8bad0866c724d6d147 \
+checksums           xorg-server-1.4.2-apple30.tar.bz2 \
+                    md5     9ce0d24fc932527f361d06979c092a4b \
+                    sha1    e2841b3bd8b51463e76f0610bc6eb1f81d36dfb6 \
+                    rmd160  d079fb31648b2c1251c5164262a8e25faefb7113 \
                     MesaLib-7.0.4.tar.bz2 \
                     md5     8d7bacbe0234742a5d08c8088c4619e9 \
                     sha1    7e2ecbe89d245510d2681d04e959aee6adc205c5 \
@@ -30,6 +30,8 @@
 use_bzip2	yes
 use_parallel_build yes
 
+patchfiles vnc-workaround.patch
+
 depends_build \
 	port:pkgconfig \
 	port:xorg-applewmproto \

Added: trunk/dports/x11/xorg-server/files/vnc-workaround.patch
===================================================================
--- trunk/dports/x11/xorg-server/files/vnc-workaround.patch	                        (rev 0)
+++ trunk/dports/x11/xorg-server/files/vnc-workaround.patch	2008-12-30 05:31:34 UTC (rev 44536)
@@ -0,0 +1,207 @@
+diff --git a/hw/xquartz/X11Application.m xorg-server-1.4.2-apple30hw/xquartz/X11Application.m
+index 990c008..90077fe 100644
+--- hw/xquartz/X11Application.m
++++ hw/xquartz/X11Application.m
+@@ -63,13 +63,8 @@ extern BOOL xpbproxy_init (void);
+ #define ProximityIn    0
+ #define ProximityOut   1
+ 
+-/* workaround a bug in vnc for those hit by a bug in Remote Desktop on OSX */
+-#define VNCMODIFIERBUGWORKAROUND 1 
+-
+-#ifdef VNCMODIFIERBUGWORKAROUND
+-static BOOL vncModifierBugWorkaround = YES;
++/* Stuck modifier / button state... force release when we context switch */
+ static NSEventType keyState[NUM_KEYCODES];
+-#endif
+ 
+ int X11EnableKeyEquivalents = TRUE, quartzFullscreenMenu = FALSE;
+ int quartzHasRoot = FALSE, quartzEnableRootless = TRUE;
+@@ -187,41 +182,36 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
+ 
+ - (void) activateX:(OSX_BOOL)state {
+     /* Create a TSM document that supports full Unicode input, and
+-     * have it activated while X is active
+-     */
++     have it activated while X is active */
+     static TSMDocumentID x11_document;
+-#ifdef VNCMODIFIERBUGWORKAROUND
+     size_t i;
+-#endif
+     DEBUG_LOG("state=%d, _x_active=%d, \n", state, _x_active)
+     if (state) {
+         DarwinSendDDXEvent(kXquartzActivate, 0);
+-        
++
+         if (!_x_active) {
+             if (x11_document == 0) {
+                 OSType types[1];
+                 types[0] = kUnicodeDocument;
+                 NewTSMDocument (1, types, &x11_document, 0);
+             }
+-            
++
+             if (x11_document != 0)	ActivateTSMDocument (x11_document);
+         }
+     } else {
+-#ifdef VNCMODIFIERBUGWORKAROUND
+-        if(vncModifierBugWorkaround) {
+-            DarwinUpdateModKeys(0);
+-            for(i=0; i < NUM_KEYCODES; i++) {
+-                if(keyState[i] == NSKeyDown)
+-                    DarwinSendKeyboardEvents(KeyRelease, i);
+-            }
++
++        DarwinUpdateModKeys(0);
++        for(i=0; i < NUM_KEYCODES; i++) {
++            if(keyState[i] == NSKeyDown)
++                DarwinSendKeyboardEvents(KeyRelease, i);
+         }
+-#endif
+-        DarwinSendDDXEvent(kXquartzDeactivate, 0);
+         
++        DarwinSendDDXEvent(kXquartzDeactivate, 0);
++
+         if (_x_active && x11_document != 0)
+             DeactivateTSMDocument (x11_document);
+     }
+-    
++
+     _x_active = state;
+ }
+ 
+@@ -697,11 +687,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
+ {
+     NSString *nsstr;
+     const char *tem;
+-
+-#ifdef VNCMODIFIERBUGWORKAROUND
+-    vncModifierBugWorkaround = [self prefs_get_boolean:@"vncModifierBugWorkaround" default:vncModifierBugWorkaround];
+-#endif
+-    
++	
+     quartzUseSysBeep = [self prefs_get_boolean:@PREFS_SYSBEEP
+                                        default:quartzUseSysBeep];
+     quartzEnableRootless = [self prefs_get_boolean:@PREFS_ROOTLESS
+@@ -884,10 +870,7 @@ environment the next time you start X11?", @"Startup xinitrc dialog");
+ 
+ void X11ApplicationMain (int argc, char **argv, char **envp) {
+     NSAutoreleasePool *pool;
+-#ifdef VNCMODIFIERBUGWORKAROUND
+-    size_t i;
+-#endif
+-    
++
+ #ifdef DEBUG
+     while (access ("/tmp/x11-block", F_OK) == 0) sleep (1);
+ #endif
+@@ -904,14 +887,6 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
+ 					selector:@selector (became_key:)
+ 					name:NSWindowDidBecomeKeyNotification object:nil];
+ 
+-#ifdef VNCMODIFIERBUGWORKAROUND
+-    if(vncModifierBugWorkaround) {
+-        for(i=0; i < NUM_KEYCODES; i++) {
+-            keyState[i] = NSKeyUp;
+-        }
+-    }
+-#endif
+-
+     /*
+      * The xpr Quartz mode is statically linked into this server.
+      * Initialize all the Quartz functions.
+@@ -957,6 +932,18 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
+ @implementation X11Application (Private)
+ extern int darwin_modifier_flags; // darwinEvents.c
+ 
++#ifdef NX_DEVICELCMDKEYMASK
++/* This is to workaround a bug in the VNC server where we sometimes see the L
++ * modifier and sometimes see no "side"
++ */
++static inline int ensure_flag(int flags, int device_independent, int device_dependents, int device_dependent_default) {
++    if( (flags & device_independent) &&
++       !(flags & device_dependents))
++        flags |= device_dependent_default;
++    return flags;
++}
++#endif
++
+ - (void) sendX11NSEvent:(NSEvent *)e {
+     NSRect screen;
+     NSPoint location;
+@@ -964,6 +951,7 @@ extern int darwin_modifier_flags; // darwinEvents.c
+     int ev_button, ev_type;
+     float pointer_x, pointer_y, pressure, tilt_x, tilt_y;
+     DeviceIntPtr pDev;
++    int modifierFlags;
+ 
+     /* convert location to be relative to top-left of primary display */
+     location = [e locationInWindow];
+@@ -984,17 +972,34 @@ extern int darwin_modifier_flags; // darwinEvents.c
+     pressure = 0;
+     tilt_x = 0;
+     tilt_y = 0;
++    
++    modifierFlags = [e modifierFlags];
++    
++    /* These are the "only" modifier keys we care about */
++    modifierFlags &= (NX_COMMANDMASK | NX_CONTROLMASK | NX_ALTERNATEMASK | NX_SHIFTMASK |
++                      NX_SECONDARYFNMASK | NX_ALPHASHIFTMASK | NX_NUMERICPADMASK |
++                      NX_HELPMASK | NX_DEVICELCTLKEYMASK | NX_DEVICELSHIFTKEYMASK |
++                      NX_DEVICERSHIFTKEYMASK | NX_DEVICELCMDKEYMASK | NX_DEVICERCMDKEYMASK |
++                      NX_DEVICELALTKEYMASK | NX_DEVICERALTKEYMASK | NX_DEVICERCTLKEYMASK);
++    
++#ifdef NX_DEVICELCMDKEYMASK
++    /* This is to workaround a bug in the VNC server where we sometimes see the L
++     * modifier and sometimes see no "side"
++     */
++    modifierFlags = ensure_flag(modifierFlags, NX_CONTROLMASK,   NX_DEVICELCTLKEYMASK   | NX_DEVICERCTLKEYMASK,     NX_DEVICELCTLKEYMASK);
++    modifierFlags = ensure_flag(modifierFlags, NX_SHIFTMASK,     NX_DEVICELSHIFTKEYMASK | NX_DEVICERSHIFTKEYMASK,   NX_DEVICELSHIFTKEYMASK);
++    modifierFlags = ensure_flag(modifierFlags, NX_COMMANDMASK,   NX_DEVICELCMDKEYMASK   | NX_DEVICERCMDKEYMASK,     NX_DEVICELCMDKEYMASK);
++    modifierFlags = ensure_flag(modifierFlags, NX_ALTERNATEMASK, NX_DEVICELALTKEYMASK   | NX_DEVICERALTKEYMASK,     NX_DEVICELALTKEYMASK);
++#endif
+ 
+     /* We don't receive modifier key events while out of focus, and 3button
+      * emulation mucks this up, so we need to check our modifier flag state
+      * on every event... ugg
+      */
+-#ifdef VNCMODIFIERBUGWORKAROUND
+-    if(!vncModifierBugWorkaround)
+-#endif
+-    if(darwin_modifier_flags != [e modifierFlags])
+-        DarwinUpdateModKeys([e modifierFlags]);
+-
++    
++    if(darwin_modifier_flags != modifierFlags)
++        DarwinUpdateModKeys(modifierFlags);
++    
+ 	switch ([e type]) {
+ 		case NSLeftMouseDown:     ev_button=1; ev_type=ButtonPress;   goto handle_mouse;
+ 		case NSOtherMouseDown:    ev_button=2; ev_type=ButtonPress;   goto handle_mouse;
+@@ -1133,21 +1138,14 @@ extern int darwin_modifier_flags; // darwinEvents.c
+                 }
+             }
+ 
+-#ifdef VNCMODIFIERBUGWORKAROUND
+-            if(vncModifierBugWorkaround)
+-                keyState[[e keyCode]] == [e type];
+-#endif
++            /* Avoid stuck keys on context switch */
++            if(keyState[[e keyCode]] == [e type])
++                return;
++            keyState[[e keyCode]] = [e type];
+ 
+             DarwinSendKeyboardEvents(([e type] == NSKeyDown) ? KeyPress : KeyRelease, [e keyCode]);
+             break;
+-
+-#ifdef VNCMODIFIERBUGWORKAROUND
+-        case NSFlagsChanged:
+-            if(vncModifierBugWorkaround)
+-                DarwinUpdateModKeys([e modifierFlags]);
+-            break;
+-#endif
+-
++            
+         default: break; /* for gcc */
+ 	}	
+ }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081229/972b2ee7/attachment.html>


More information about the macports-changes mailing list