mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +00:00
LibGUI: Allow finding the source of a GAction activation
When a GAction is activated by a menu, or by a toolbar button, you can now use GAction::activator() to get a pointer to whomever activated it. This can be used to implement context-specific behaviors in situations where the same action is exposed through multiple paths. This addresses an issue that was brought up in #826.
This commit is contained in:
@@ -209,7 +209,7 @@ void GWindowServerConnection::handle(const WindowClient::MenuItemActivated& mess
|
||||
return;
|
||||
}
|
||||
if (auto* action = menu->action_at(message.identifier()))
|
||||
action->activate();
|
||||
action->activate(menu);
|
||||
}
|
||||
|
||||
void GWindowServerConnection::handle(const WindowClient::WM_WindowStateChanged& message)
|
||||
|
||||
Reference in New Issue
Block a user