From 961a8f2aef124f36774517678138bbe9b8fb5492 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Mon, 20 May 2024 17:56:44 +0200 Subject: [PATCH] correctly handle right click on Indicator --- src/components/indicator/settingsMenu.ts | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/indicator/settingsMenu.ts b/src/components/indicator/settingsMenu.ts index b056fff3..38ce9c1a 100644 --- a/src/components/indicator/settingsMenu.ts +++ b/src/components/indicator/settingsMenu.ts @@ -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); }