About X11's WM_HINTS.UrgencyHint and KF5's NET::DemandsAttention

Martin Gräßlin mgraesslin at kde.org
Tue Sep 16 10:26:50 BST 2014


On Wednesday 03 September 2014 14:36:48 Paulo Lieuthier wrote:
> Hello everyone,
> 
> I'm a LXQt contributor and I've been working on getting it rid of Xlib calls
> by using KF5's WindowSystem. It looks nice so far.
> 
> The problem I'm having now is that I can't get the taskbar to indicate a
> window needs attention by using the KWindowInfo class.
> 
> This is how it worked before:
> 
>         XWMHints *hints = XGetWMHints(QX11Info::display(), window);
>         ...
>         bool urgencyHint = hints->flags & UrgencyHint;
>         ...
> 
> And that's how I've been trying:
> 
>         KWindowInfo info(window, NET::WMState | NET::XAWMState);
>         bool urgencyHint = info.hasState(NET::DemandsAttention);
> 
> Isn't NET::DemandsAttention supposed to be equal to WM_HINTS.UrgencyHint?
> What am I missing?

Small additional update after trying to integrate the UrgencyHint into 
DemandsAttention: some window managers (at least KWin and openbox) set the 
state DemandsAttention on a window which has the UrgencyHint set. So for all 
applications which are not a window manager the following code will return the 
correct state:

KWindowInfo info(window, NET::WMState);
bool demandsAttention = info.hasState(NET::DemandsAttention);

please be aware of the highly async nature of the setup though. It's not an 
intermediate change after a window set the urgency hint, it needs the wm to 
pick it up first.

Cheers
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20140916/67bfb2e4/attachment.sig>


More information about the kde-core-devel mailing list