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

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Fri Jul 24 09:42:39 PDT 2009


 hw/xquartz/X11Application.h                                         |    1 
 hw/xquartz/X11Application.m                                         |    5 
 hw/xquartz/X11Controller.h                                          |   25 +++-
 hw/xquartz/X11Controller.m                                          |   62 +++++++---
 hw/xquartz/bundle/Resources/English.lproj/Localizable.strings       |binary
 hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib   |   35 -----
 hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib |binary
 7 files changed, 81 insertions(+), 47 deletions(-)

New commits:
commit 0c504436c633b8241dd26d6ff74b64afeab50409
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Jul 24 09:16:37 2009 -0700

    XQuartz: Rever the "Set can_quit to true during a Sparkle-initiated relaunch." change
    
    This was in place to work around the issue that was correctly solved with the
    previous commit (changing the Windows menu behavior).  Reverting this change
    no longer causes crashing, so it's safe to show the dialog now.
    (cherry picked from commit 023cef31bbb2ab80a241098d82fcfd35ada75fc0)

diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index 4d46911..9477e94 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -343,7 +343,7 @@ BOOL xquartz_resetenv_display = NO;
 
 // Sent immediately before installing the specified update.
 - (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update {
-    [self set_can_quit:YES];
+    //[self set_can_quit:YES];
 }
 
 #endif
commit 210180790a40bd0f7aeb95064b139f92ac2d6edd
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Thu Jul 23 20:03:29 2009 -0700

    XQuartz: Change handling of Windows menu to workaround a bug triggered by mixing Sparkle and X11 windows
    
    <rdar://problem/7088335> NSApplication releases the separator in the Windows menu even though it's an IBOutlet
    (cherry picked from commit 27ac5135267be9cb221329ae68461117dd43a4bf)

diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index 7e0d6b5..5b38a11 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -67,8 +67,13 @@
     IBOutlet NSTextField *sync_text2;
     IBOutlet NSPopUpButton *depth;
 
-    IBOutlet NSMenuItem *x11_about_item;
     IBOutlet NSMenuItem *window_separator;
+    // window_separator is DEPRECATED due to this radar:
+    // <rdar://problem/7088335> NSApplication releases the separator in the Windows menu even though it's an IBOutlet
+    // It is kept around for localization compatability and is subject to removal "eventually"
+    // If it is !NULL (meaning it is in the nib), it is removed from the menu and released
+
+    IBOutlet NSMenuItem *x11_about_item;
     IBOutlet NSMenuItem *dock_window_separator;
     IBOutlet NSMenuItem *apps_separator;
     IBOutlet NSMenuItem *toggle_fullscreen_item;
@@ -83,6 +88,9 @@
     NSMutableArray *table_apps;
 
     IBOutlet NSMenu *dock_menu;
+    
+    // This is where in the Windows menu we'll start (this will be the index of the separator)
+    NSInteger windows_menu_start;
 
     int checked_window_item;
     x_list *pending_apps;
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index 4e08c13..4d46911 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -103,7 +103,14 @@ BOOL xquartz_resetenv_display = NO;
      selector: @selector(apps_table_done:)
      name: NSWindowWillCloseNotification
      object: [apps_table window]];
+
+    // Setup data about our Windows menu
+    if(window_separator) {
+        [[window_separator menu] removeItem:window_separator];
+        window_separator = nil;
+    }
     
+    windows_menu_start = [[X11App windowsMenu] numberOfItems];
 }
 
 - (void) item_selected:sender
@@ -117,17 +124,15 @@ BOOL xquartz_resetenv_display = NO;
 - (void) remove_window_menu
 {
   NSMenu *menu;
-  int first, count, i;
-	
+  int count, i;
+
   /* Work backwards so we don't mess up the indices */
-  menu = [window_separator menu];
-  first = [menu indexOfItem:window_separator] + 1;
+  menu = [X11App windowsMenu];
   count = [menu numberOfItems];
-  for (i = count - 1; i >= first; i--)
+  for (i = count - 1; i >= windows_menu_start; i--)
     [menu removeItemAtIndex:i];
 	
-  menu = [dock_window_separator menu];
-  count = [menu indexOfItem:dock_window_separator];
+  count = [dock_menu indexOfItem:dock_window_separator];
   for (i = 0; i < count; i++)
     [dock_menu removeItemAtIndex:0];
 }
@@ -138,9 +143,15 @@ BOOL xquartz_resetenv_display = NO;
   NSMenuItem *item;
   int first, count, i;
 
-  menu = [window_separator menu];
-  first = [menu indexOfItem:window_separator] + 1;
+  menu = [X11App windowsMenu];
+  first = windows_menu_start + 1;
   count = [list count];
+  
+  // Push a Separator
+  if(count) {
+      [menu addItem:[NSMenuItem separatorItem]];
+  }
+
   for (i = 0; i < count; i++)
     {
       NSString *name, *shortcut;
@@ -285,8 +296,8 @@ BOOL xquartz_resetenv_display = NO;
   int first, count;
   int n = [nn intValue];
 
-  menu = [window_separator menu];
-  first = [menu indexOfItem:window_separator] + 1;
+  menu = [X11App windowsMenu];
+  first = windows_menu_start + 1;
   count = [menu numberOfItems] - first;
 	
   if (checked_window_item >= 0 && checked_window_item < count)
@@ -729,9 +740,7 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)row
     
   if (item == toggle_fullscreen_item)
     return !quartzEnableRootless;
-  else   if (item == copy_menu_item) // For some reason, this isn't working...
-      return NO;
-  else if (menu == [window_separator menu] || menu == dock_menu
+  else if (menu == [X11App windowsMenu] || menu == dock_menu
 	   || (menu == [x11_about_item menu] && [item tag] == 42))
     return (AppleWMSelectedEvents () & AppleWMControllerNotifyMask) != 0;
   else
diff --git a/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib b/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib
index 38b0018..94d0104 100644
--- a/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib
+++ b/hw/xquartz/bundle/Resources/English.lproj/main.nib/designable.nib
@@ -2,9 +2,9 @@
 <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
 	<data>
 		<int key="IBDocument.SystemTarget">1050</int>
-		<string key="IBDocument.SystemVersion">9J61</string>
+		<string key="IBDocument.SystemVersion">9L29</string>
 		<string key="IBDocument.InterfaceBuilderVersion">677</string>
-		<string key="IBDocument.AppKitVersion">949.46</string>
+		<string key="IBDocument.AppKitVersion">949.54</string>
 		<string key="IBDocument.HIToolboxVersion">353.00</string>
 		<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
 			<bool key="EncodedWithXMLCoder">YES</bool>
@@ -341,17 +341,6 @@
 									<reference key="NSOnImage" ref="531645050"/>
 									<reference key="NSMixedImage" ref="351811234"/>
 								</object>
-								<object class="NSMenuItem" id="444952046">
-									<reference key="NSMenu" ref="96874957"/>
-									<bool key="NSIsDisabled">YES</bool>
-									<bool key="NSIsSeparator">YES</bool>
-									<string key="NSTitle"/>
-									<string key="NSKeyEquiv"/>
-									<int key="NSKeyEquivModMask">1048576</int>
-									<int key="NSMnemonicLoc">2147483647</int>
-									<reference key="NSOnImage" ref="531645050"/>
-									<reference key="NSMixedImage" ref="351811234"/>
-								</object>
 							</object>
 							<string key="NSName">_NSWindowsMenu</string>
 						</object>
@@ -1955,14 +1944,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string>
 				</object>
 				<object class="IBConnectionRecord">
 					<object class="IBOutletConnection" key="connection">
-						<string key="label">window_separator</string>
-						<reference key="source" ref="485884620"/>
-						<reference key="destination" ref="444952046"/>
-					</object>
-					<int key="connectionID">300331</int>
-				</object>
-				<object class="IBConnectionRecord">
-					<object class="IBOutletConnection" key="connection">
 						<string key="label">menu</string>
 						<reference key="source" ref="815810918"/>
 						<reference key="destination" ref="524015605"/>
@@ -2209,7 +2190,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string>
 							<reference ref="1036389925"/>
 							<reference ref="369641893"/>
 							<reference ref="155085383"/>
-							<reference ref="444952046"/>
 							<reference ref="984461797"/>
 							<reference ref="280172320"/>
 						</object>
@@ -3014,11 +2994,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string>
 						<reference key="parent" ref="492358940"/>
 					</object>
 					<object class="IBObjectRecord">
-						<int key="objectID">300330</int>
-						<reference key="object" ref="444952046"/>
-						<reference key="parent" ref="96874957"/>
-					</object>
-					<object class="IBObjectRecord">
 						<int key="objectID">300337</int>
 						<reference key="object" ref="10973343"/>
 						<object class="NSMutableArray" key="children">
@@ -3401,8 +3376,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string>
 					<string>298.ImportedFromIB2</string>
 					<string>300295.IBPluginDependency</string>
 					<string>300295.IBShouldRemoveOnLegacySave</string>
-					<string>300330.IBPluginDependency</string>
-					<string>300330.ImportedFromIB2</string>
 					<string>300337.IBPluginDependency</string>
 					<string>300337.ImportedFromIB2</string>
 					<string>300338.IBPluginDependency</string>
@@ -3638,7 +3611,7 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string>
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
-					<string>{{349, 858}, {315, 153}}</string>
+					<string>{{349, 868}, {315, 143}}</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
 					<string>{{271, 666}, {301, 153}}</string>
@@ -3699,8 +3672,6 @@ d2hpY2ggbWF5IHByZXZlbnQgWDExIGFwcGxpY2F0aW9ucyBmcm9tIGxhdW5jaGluZy4</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
-					<reference ref="9"/>
-					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
 					<reference ref="9"/>
diff --git a/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib b/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib
index 5165089..fee8f1c 100644
Binary files a/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib and b/hw/xquartz/bundle/Resources/English.lproj/main.nib/keyedobjects.nib differ
commit 1f011818e89444ab6471256e81caa9fd2f615814
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Tue Jul 21 00:22:12 2009 -0700

    XQuartz: Set can_quit to true during a Sparkle-initiated relaunch.
    (cherry picked from commit b2e9a77111d4572402d8ca95e3368db97ba7d598)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index eb0c39a..f5fa5ee 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -970,7 +970,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
         fprintf(stderr, "Error initializing xpbproxy\n");
 
 #if XQUARTZ_SPARKLE
-    [[X11App controller] set_check_for_updates_menu_item];
+    [[X11App controller] setup_sparkle];
     [[SUUpdater sharedUpdater] resetUpdateCycle];
 //    [[SUUpdater sharedUpdater] checkForUpdates:X11App];
 #endif
diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index d8f7ff4..7e0d6b5 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -39,6 +39,10 @@
 #include "sanitizedCocoa.h"
 #include "xpr/x-list.h"
 
+#ifdef XQUARTZ_SPARKLE
+#include <Sparkle/SUUpdater.h>
+#endif
+
 @interface X11Controller : NSObject
 {
     IBOutlet NSPanel *prefs_panel;
@@ -91,7 +95,8 @@
 - (void) set_window_menu_check:(NSNumber *)n;
 - (void) set_apps_menu:(NSArray *)list;
 #ifdef XQUARTZ_SPARKLE
-- (void) set_check_for_updates_menu_item;
+- (void) setup_sparkle;
+- (void) updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update;
 #endif
 - (void) set_can_quit:(OSX_BOOL)state;
 - (void) server_ready;
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index 2e05816..4e08c13 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -53,10 +53,6 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-#ifdef XQUARTZ_SPARKLE
-#include <Sparkle/SUUpdater.h>
-#endif
-
 BOOL xquartz_resetenv_display = NO;
 
 @implementation X11Controller
@@ -317,7 +313,7 @@ BOOL xquartz_resetenv_display = NO;
 }
 
 #ifdef XQUARTZ_SPARKLE
-- (void) set_check_for_updates_menu_item {
+- (void) setup_sparkle {
     if(check_for_updates_item)
         return; // already did it...
 
@@ -330,7 +326,15 @@ BOOL xquartz_resetenv_display = NO;
     [check_for_updates_item setTarget:[SUUpdater sharedUpdater]];
     [check_for_updates_item setEnabled:YES];
 
+    // Set X11Controller as the delegate for the updater.
+    [[SUUpdater sharedUpdater] setDelegate:self];
 }
+
+// Sent immediately before installing the specified update.
+- (void)updater:(SUUpdater *)updater willInstallUpdate:(SUAppcastItem *)update {
+    [self set_can_quit:YES];
+}
+
 #endif
 
 - (void) launch_client:(NSString *)filename
commit 590c0f4050b8fa81e23ae61a4aa398fc03780c32
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Mon Jul 20 22:38:25 2009 -0700

    XQuartz: Added a "Check for X11 Updates..." menu item.
    (cherry picked from commit 305144bfa4b59791123c44e869fab93a084792d6)

diff --git a/hw/xquartz/X11Application.h b/hw/xquartz/X11Application.h
index c02073e..5e828a4 100644
--- a/hw/xquartz/X11Application.h
+++ b/hw/xquartz/X11Application.h
@@ -56,6 +56,7 @@
 - (void) prefs_set_string:(NSString *)key value:(NSString *)value;
 - (void) prefs_synchronize;
 
+- (X11Controller *) controller;
 - (OSX_BOOL) x_active;
 @end
 
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 736d4e6..eb0c39a 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -783,6 +783,10 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
 			     AppleWMCopyToPasteboard);
 }
 
+- (X11Controller *) controller {
+    return _controller;
+}
+
 - (OSX_BOOL) x_active {
     return _x_active;
 }
@@ -966,6 +970,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
         fprintf(stderr, "Error initializing xpbproxy\n");
 
 #if XQUARTZ_SPARKLE
+    [[X11App controller] set_check_for_updates_menu_item];
     [[SUUpdater sharedUpdater] resetUpdateCycle];
 //    [[SUUpdater sharedUpdater] checkForUpdates:X11App];
 #endif
diff --git a/hw/xquartz/X11Controller.h b/hw/xquartz/X11Controller.h
index bb9adb1..d8f7ff4 100644
--- a/hw/xquartz/X11Controller.h
+++ b/hw/xquartz/X11Controller.h
@@ -30,6 +30,10 @@
 #ifndef X11CONTROLLER_H
 #define X11CONTROLLER_H 1
 
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
 #if __OBJC__
 
 #include "sanitizedCocoa.h"
@@ -64,6 +68,9 @@
     IBOutlet NSMenuItem *dock_window_separator;
     IBOutlet NSMenuItem *apps_separator;
     IBOutlet NSMenuItem *toggle_fullscreen_item;
+#ifdef XQUARTZ_SPARKLE
+    NSMenuItem *check_for_updates_item; // Programatically enabled
+#endif
     IBOutlet NSMenuItem *copy_menu_item;
     IBOutlet NSMenu *dock_apps_menu;
     IBOutlet NSTableView *apps_table;
@@ -83,6 +90,9 @@
 - (void) set_window_menu:(NSArray *)list;
 - (void) set_window_menu_check:(NSNumber *)n;
 - (void) set_apps_menu:(NSArray *)list;
+#ifdef XQUARTZ_SPARKLE
+- (void) set_check_for_updates_menu_item;
+#endif
 - (void) set_can_quit:(OSX_BOOL)state;
 - (void) server_ready;
 
diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m
index adf861c..2e05816 100644
--- a/hw/xquartz/X11Controller.m
+++ b/hw/xquartz/X11Controller.m
@@ -53,6 +53,10 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
+#ifdef XQUARTZ_SPARKLE
+#include <Sparkle/SUUpdater.h>
+#endif
+
 BOOL xquartz_resetenv_display = NO;
 
 @implementation X11Controller
@@ -312,6 +316,23 @@ BOOL xquartz_resetenv_display = NO;
   [self install_apps_menu:list];
 }
 
+#ifdef XQUARTZ_SPARKLE
+- (void) set_check_for_updates_menu_item {
+    if(check_for_updates_item)
+        return; // already did it...
+
+    NSMenu *menu = [x11_about_item menu];
+
+    check_for_updates_item = [menu insertItemWithTitle:NSLocalizedString(@"Check for X11 Updates...", @"Check for X11 Updates...")
+                                               action:@selector (checkForUpdates:)
+                                        keyEquivalent:@""
+                                              atIndex:1];
+    [check_for_updates_item setTarget:[SUUpdater sharedUpdater]];
+    [check_for_updates_item setEnabled:YES];
+
+}
+#endif
+
 - (void) launch_client:(NSString *)filename
 {
     int child1, child2 = 0;
diff --git a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings
index 001227a..0341502 100644
Binary files a/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings and b/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings differ


More information about the xorg-commit mailing list