]> git.eshelyaron.com Git - emacs.git/commitdiff
Make NS toolbar item ID more unique (bug#50160)
authorAlan Third <alan@idiocy.org>
Wed, 25 Aug 2021 18:50:27 +0000 (19:50 +0100)
committerAlan Third <alan@idiocy.org>
Wed, 22 Dec 2021 20:48:19 +0000 (20:48 +0000)
* src/nsmenu.m
([EmacsToolbar addDisplayItemWithImage:idx:tag:labelText:helpText:enabled:]):
Add the label to the identifier to avoid collisions between toolbar
items that use the same image.

src/nsmenu.m

index f42cd38702248c0315326e8b2a738bca03b2d59b..d15386641f8256db7fa191ddb9f5a7319ee8a156 100644 (file)
@@ -1255,8 +1255,8 @@ update_frame_tool_bar (struct frame *f)
   NSTRACE ("[EmacsToolbar addDisplayItemWithImage: ...]");
 
   /* 1) come up w/identifier */
-  NSString *identifier
-    = [NSString stringWithFormat: @"%lu", (unsigned long)[img hash]];
+  NSString *identifier = [NSString stringWithFormat: @"%lu%@",
+                                   (unsigned long)[img hash], label];
   [activeIdentifiers addObject: identifier];
 
   /* 2) create / reuse item */