changeset 74792:8486ab1d2401

(mac_update_title_bar) [TARGET_API_MAC_CARBON]: Call mac_update_proxy_icon also when buffer modification flag changed. [TARGET_API_MAC_CARBON] (mac_update_proxy_icon): Don't update alias, but compare FSRef/FSSpec of resolved alias.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Fri, 22 Dec 2006 08:27:27 +0000
parents 6b69e86dc4cc
children 00df8b8ea324
files src/macfns.c
diffstat 1 files changed, 18 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/macfns.c	Fri Dec 22 08:14:45 2006 +0000
+++ b/src/macfns.c	Fri Dec 22 08:27:27 2006 +0000
@@ -1969,9 +1969,9 @@
     {
       AEDesc desc;
 #ifdef MAC_OSX
-      FSRef fref;
+      FSRef fref, fref_proxy;
 #else
-      FSSpec fss;
+      FSSpec fss, fss_proxy;
 #endif
       Boolean changed;
       Lisp_Object encoded_file_name = ENCODE_FILE (file_name);
@@ -1997,10 +1997,19 @@
 	{
 	  if (alias)
 	    {
+	      /* (FS)ResolveAlias never sets `changed' to true if
+		 `alias' is minimal.  */
 #ifdef MAC_OSX
-	      err = FSUpdateAlias (NULL, &fref, alias, &changed);
+	      err = FSResolveAlias (NULL, alias, &fref_proxy, &changed);
+	      if (err == noErr)
+		err = FSCompareFSRefs (&fref, &fref_proxy);
 #else
-	      err = UpdateAlias (NULL, &fss, alias, &changed);
+	      err = ResolveAlias (NULL, alias, &fss_proxy, &changed);
+	      if (err == noErr)
+		err = !(fss.vRefNum == fss_proxy.vRefNum
+			&& fss.parID == fss_proxy.parID
+			&& EqualString (fss.name, fss_proxy.name,
+					false, true));
 #endif
 	    }
 	  if (err != noErr || alias == NULL)
@@ -2051,11 +2060,11 @@
 	 confusing.  */
       || (!MINI_WINDOW_P (w)
 	  && (modified_p != !NILP (w->last_had_star))))
-    SetWindowModified (FRAME_MAC_WINDOW (f),
-		       !MINI_WINDOW_P (w) && modified_p);
-
-  if (windows_or_buffers_changed)
-    mac_update_proxy_icon (f);
+    {
+      SetWindowModified (FRAME_MAC_WINDOW (f),
+			 !MINI_WINDOW_P (w) && modified_p);
+      mac_update_proxy_icon (f);
+    }
 #endif
 }