Skip to content

Commit

Permalink
correctly handle right click on Indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
Totto16 committed May 20, 2024
1 parent 080eb1b commit 961a8f2
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 961a8f2

Please sign in to comment.