Skip to content

Commit

Permalink
Merge pull request #285 from oae/283-bug-opening-the-content-preview-…
Browse files Browse the repository at this point in the history
…also-opens-the-contextual-menu

[Bug fix]: Correctly handle right click on Indicator
  • Loading branch information
Totto16 authored May 21, 2024
2 parents 080eb1b + 961a8f2 commit 082a835
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/components/indicator/settingsMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,16 @@ export class SettingsMenu extends PanelMenuButton {
}

override vfunc_event(event: Clutter.Event) {
if (
this.menu &&
event.type() === Clutter.EventType.BUTTON_PRESS &&
[Clutter.BUTTON_PRIMARY, Clutter.BUTTON_MIDDLE].includes(event.get_button())
) {
this.onToggle();
if (event.type() === Clutter.EventType.BUTTON_PRESS) {
if ([Clutter.BUTTON_PRIMARY, Clutter.BUTTON_MIDDLE].includes(event.get_button())) {
this.onToggle();
return Clutter.EVENT_STOP;
} else if (this.menu && event.get_button() === Clutter.BUTTON_SECONDARY) {
this.menu.toggle();
return Clutter.EVENT_STOP;
}
}

return super.vfunc_event(event);
}

Expand Down

0 comments on commit 082a835

Please sign in to comment.