mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:58:11 +00: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
1 changed files with 3 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue