From 8820fda6388a47a605b17884ee394c893cb73666 Mon Sep 17 00:00:00 2001 From: Georg Sieber Date: Thu, 14 Nov 2024 14:58:21 +0100 Subject: [PATCH] re-aquire focus on click --- .../files/calculator@scollins/desklet.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/calculator@scollins/files/calculator@scollins/desklet.js b/calculator@scollins/files/calculator@scollins/desklet.js index 2bf2db4f6..a7a3584ef 100644 --- a/calculator@scollins/files/calculator@scollins/desklet.js +++ b/calculator@scollins/files/calculator@scollins/desklet.js @@ -944,6 +944,16 @@ RaisedBox.prototype = { return true; } + if ( type == Clutter.EventType.BUTTON_PRESS ) { + // get focus again on click + this.actor.show(); + global.set_stage_input_mode(Cinnamon.StageInputMode.FOCUSED); + global.stage.set_key_focus(this.actor); + this.actor.grab_key_focus(); + global.set_stage_input_mode(Cinnamon.StageInputMode.FULLSCREEN); + return; + } + let target = event.get_source(); if ( target == this.desklet.actor || this.desklet.actor.contains(target) || target == this.contextMenu.actor || this.contextMenu.actor.contains(target) ) return false;