LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Switch windows from script without setting _NET_WM_STATE_DEMANDS_ATTENTION (https://www.linuxquestions.org/questions/linux-desktop-74/switch-windows-from-script-without-setting-_net_wm_state_demands_attention-4175508539/)

insectiod 06-19-2014 05:34 PM

Switch windows from script without setting _NET_WM_STATE_DEMANDS_ATTENTION
 
I'm trying to write a script to help me switch between windows. I have tried wmctrl, and xdotool. Both successfully switches between windows. But the window I switch away from starts blinking in the taskbar. Even worse, when a windows has started blinking, it is automatically shown on all desktops.

I've tracked it down to the ewmh hint _NET_WM_STATE_DEMANDS_ATTENTION. The window starts blinking because this hint is set. I have tried to disable it by saving the active window at the beginning of the script and then running:
Code:

wmctrl -i -r $active_window -b remove,demands_attention
at the end.

This works most of the time, but not always. Is there any way to switch windows without ever activating this hint.

Alternatively, is there any way to make kde (im running 4.10.5) ignore this hint. By that I mean don't blink the window in the taskbar, and dont make the window appear on all desktops.

Thanks.

dijetlo 06-22-2014 08:29 PM

I'm not sure that this is current information or how much (if any of it) is implemented in the current iteration of KDE however there are a couple of atom level controls grouped with _NET_WM_STATE_DEMANDS_ATTENTION under "freedesktop.org standards" that might be useful
Quote:

_NET_WM_STATE_SKIP_TASKBAR, ATOM
_NET_WM_STATE_SKIP_PAGER, ATOM

cepheus11 06-30-2014 10:19 AM

KDE has a very cool javascript scripting API. If you cannot solve your problem with DE-agnostic methods, you could use that:

http://techbase.kde.org/Development/...ipting/API_4.9

If you have your to-be-activated window in the variable "client", you can activate it with

Code:

workspace.activeClient = client;
This will activate the window, switch desktop if it is on another desktop, but not set the "seeks attention"-state.


All times are GMT -5. The time now is 09:03 PM.