User Tools

Site Tools


linux:terminal-focus

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:terminal-focus [2026/04/27 13:44] Wufflinux:terminal-focus [2026/04/27 13:55] (current) Wuff
Line 1: Line 1:
 ====== Terminal focus ====== ====== Terminal focus ======
  
-On Linux mint 22.3 the terminal does not get focus when opened via taskbar button.+On Linux mint 22.3 the terminal does not get focus when opened via taskbar button due to an issue with underlying mutter.
  
 Workaround as described here: https://github.com/linuxmint/cinnamon/issues/13382 Workaround as described here: https://github.com/linuxmint/cinnamon/issues/13382
  
-System Settings -> Windows -> Behaviour, set Window focus mode to sloppy+settings -> windows -> behaviour -> window focus mode sloppy
-Possibly also "Bring windows which require attention to the current workspace" and "location of newly opened windows to cursor"+
  
 +<code bash>sudo vi /usr/share/cinnamon/js/ui/windowAttentionHandler.js</code>
 +
 +Search for the initialization block. It looks like this:
 +
 +<code javascript>
 +Mainloop.timeout_add_seconds(4, () => {
 +    log("Enabling WindowAttentionHandler");
 +    global.display.connect('window-demands-attention', Lang.bind(this, this._onWindowDemandsAttention));
 +    global.display.connect('window-marked-urgent', Lang.bind(this, this._onWindowDemandsAttention));
 +
 +    return GLib.SOURCE_REMOVE;
 +})
 +</code>
 +Add this line inside that block:
 +<code javascript>
 +global.display.connect('window-created', Lang.bind(this, this._onWindowDemandsAttention));
 +</code>
 +The result should look like this:
 +<code javascript>
 +Mainloop.timeout_add_seconds(4, () => {
 +    log("Enabling WindowAttentionHandler");
 +    global.display.connect('window-demands-attention', Lang.bind(this, this._onWindowDemandsAttention));
 +    global.display.connect('window-marked-urgent', Lang.bind(this, this._onWindowDemandsAttention));
 +    // START FIX
 +    global.display.connect('window-created', Lang.bind(this, this._onWindowDemandsAttention));
 +    // END FIX
 +
 +    return GLib.SOURCE_REMOVE;
 +})
 +</code>
 +Save and Exit
 +
 +Then add to whitelist:
 +Check settings:
 +<code>settings get org.cinnamon demands-attention-passthru-wm-classes</code>
 +<code>['gnome-screenshot', 'lxterminal', 'xfce4-terminal', 'firefox', 'libreoffice', 'soffice']</code>
 +Then add gnome terminal or other to the list. Check with xprop if unsure what the wm classes would be:
 +<code>gsettings set org.cinnamon demands-attention-passthru-wm-classes "['gnome-screenshot', 'lxterminal', 'xfce4-terminal', 'firefox', 'libreoffice', 'soffice', 'gnome-terminal-server', 'Gnome-terminal']"
 +</code>
 +May need cinnamon restart.
linux/terminal-focus.1777293855.txt.gz · Last modified: by Wuff