Skip to content

Commit

Permalink
re-aquire focus on click
Browse files Browse the repository at this point in the history
  • Loading branch information
schorschii committed Nov 14, 2024
1 parent 4af72ea commit 8820fda
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions calculator@scollins/files/calculator@scollins/desklet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8820fda

Please sign in to comment.