summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Third <alan@idiocy.org>2021-08-25 19:50:27 +0100
committerAlan Third <alan@idiocy.org>2021-12-22 20:48:19 +0000
commit89749a62b51e19a39f145a1985ae5992c58c6776 (patch)
tree3a5bcd851e4a9349bd555d080c0824fe3af6095f
parent42601d3a938ee5a12a557840aef11c4d3bb180f6 (diff)
downloademacs-89749a62b51e19a39f145a1985ae5992c58c6776.tar.gz
emacs-89749a62b51e19a39f145a1985ae5992c58c6776.tar.bz2
emacs-89749a62b51e19a39f145a1985ae5992c58c6776.zip
Make NS toolbar item ID more unique (bug#50160)
* 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.
-rw-r--r--src/nsmenu.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nsmenu.m b/src/nsmenu.m
index f42cd387022..d15386641f8 100644
--- a/src/nsmenu.m
+++ b/src/nsmenu.m
@@ -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 */