mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-17 08:17:30 +03:00
CatDog: Don't show context menu when clicking outside of widget
The context menu for CatDog was shown when right clicking anywhere on the screen because of global cursor tracking being enabled. Also fix event not being passed by reference. Fixes #7285
This commit is contained in:
parent
83fc591cea
commit
41e74d4d31
Notes:
sideshowbarker
2024-07-18 17:45:22 +09:00
Author: https://github.com/metmo Commit: https://github.com/SerenityOS/serenity/commit/41e74d4d317 Pull-request: https://github.com/SerenityOS/serenity/pull/7292 Issue: https://github.com/SerenityOS/serenity/issues/7285
@ -101,8 +101,9 @@ int main(int argc, char** argv)
|
||||
advice_timer->start();
|
||||
};
|
||||
|
||||
catdog_widget.on_context_menu_request = [&](GUI::ContextMenuEvent event) {
|
||||
context_menu->popup(event.screen_position());
|
||||
catdog_widget.on_context_menu_request = [&](GUI::ContextMenuEvent& event) {
|
||||
if (catdog_widget.rect().contains(event.position()))
|
||||
context_menu->popup(event.screen_position());
|
||||
};
|
||||
|
||||
return app->exec();
|
||||
|
Loading…
Reference in New Issue
Block a user