bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62234: Toolbar does not work properly (with Emacs 29 or 30)


From: Daniel Martín
Subject: bug#62234: Toolbar does not work properly (with Emacs 29 or 30)
Date: Sat, 18 Mar 2023 02:09:04 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin)

Po Lu <luangruo@yahoo.com> writes:

>> I can certainly reproduce an issue with the toolbar in the NS port.  I
>> think it's the same issue that the OP is describing.  Here's some steps
>> to reproduce it:
>>
>> emacs -Q
>>
>> The Save and the Cut(Kill) icons are enabled.
>>
>> Resize the Emacs frame a little bit.
>>
>> The Save and the Cut(Kill) icons are now disabled, as expected, because
>> the *scratch* buffer is not backed by a file, and there's no active
>> region.
>
> If it helps, I don't see this at all on GNUstep.  Both buttons are
> initially disabled.

I've browsed some old Apple documentation and I think the way the
toolbar validation is implemented in the NS port may not be totally
correct.
https://web.archive.org/web/20090405012930if_/http://developer.apple.com/documentation/Cocoa/Conceptual/Toolbars/Tasks/ValidatingTBItems.html#//apple_ref/doc/uid/20000753-1036447
states that "If an image item has a valid target/action pair, then the
toolbar will call NSToolbarItemValidation’s validateToolbarItem: on
target if the target implements it; otherwise the item is enabled by
default.".

So I've implemented the above idea in the attached patch and it fixes
the issue for me.  I've also removed the validateVisibleItems override,
which should not be needed (and it's probably incorrect, as Apple's
documentation says that if you override this method, you must call
super).

Could you check if the patch also works fine on GNUStep?  If not,
perhaps we could make the change conditional to Apple systems.  Thanks.

Attachment: 0001-Fix-toolbar-item-validation-in-the-NS-port.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]