! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
_NET_WM_STATE_DEMANDS_ATTENTION doesn't work as expected
Status:
RESOLVED: FIXED

Comments

Description Bernhard Walle 2006-12-22 22:03:32 CET
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.2pre) Gecko/20061023 SUSE/2.0.0.1-0.1 Firefox/2.0.0.2pre
Build Identifier: 

_NET_WM_STATE_DEMANDS_ATTENTION doesn't work as expected. I would expect the same behaviour as for the urgent hint. Currently it only works if you with to another desktop and back, then the taskbar entry blinks.

Reproducible: Always

Steps to Reproduce:
1. Download http://www.bwalle.de/temp/attention_test.tar.bz2
2. tar xvfz attention_test.tar.bz2
3. cd attention_test
4. cd srcmoc -o main.moc main.cpp
5. cd -
6. make -f admin/Makefile.common
7. ./configure
8. make
9. src/test
10. focus another application
11. you should see 'flashing' in the console, and now the hint is set and the panel entry should flash
5. 

Actual Results:  
See 'details'

Expected Results:  
Flashing :)
Comment 1 Jasper Huijsmans editbugs 2006-12-23 09:19:06 CET
As far as I can see they are treated exactly the same. I was wondering if perhaps the window manager removes the hint when the window is visible. Olivier, do you have an idea about what could be happening?

Comment 2 Olivier Fourdan editbugs 2006-12-23 13:48:03 CET
NET_WM_STATE_DEMANDS_ATTENTION is removed as soon as the window is focused. 

From the spec: [1]

"_NET_WM_STATE_DEMANDS_ATTENTION indicates that some action in or with the window happened. For example, it may be set by the Window Manager if the window requested activation but the Window Manager refused it, or the application may set it if it finished some work. This state may be set by both the Client and the Window Manager. It should be unset by the Window Manager when it decides the window got the required attention (usually, that it got activated)."

[1] http://standards.freedesktop.org/wm-spec/wm-spec-1.4.html
Comment 3 Bernhard Walle 2006-12-23 14:18:10 CET
Of course, but here it isn't focused before and it doesn't blink. It only blinks if I switch to another workspace and back. 
Comment 4 Olivier Fourdan editbugs 2006-12-23 15:22:04 CET
Should be fixed with rev. 24174.
Comment 5 Bernhard Walle 2006-12-23 18:28:47 CET
Thanks, works.

Is it intended that the 'Window list' doesn't blink as for WM_URGENT?
Comment 6 Bernhard Walle 2006-12-23 19:07:20 CET
There must be something wrong with the fix. Now taskbar entries of windows (e.g. Terminal) flash that never have set the urgent or "needs attention" flag.
Comment 7 Olivier Fourdan editbugs 2006-12-23 19:58:07 CET
The window manager can set NET_WM_STATE_DEMANDS_ATTENTION if focus stealing prevention is triggered, as it is the case with terminal. I see nothing wrong with the patch.
Comment 8 Olivier Fourdan editbugs 2006-12-23 19:59:36 CET
> Is it intended that the 'Window list' doesn't blink as for WM_URGENT?

Urgency and NET_WM_STATE_DEMANDS_ATTENTION are different things.
Comment 9 Bernhard Walle 2006-12-23 20:18:45 CET
(In reply to comment #7)
> The window manager can set NET_WM_STATE_DEMANDS_ATTENTION if focus stealing
> prevention is triggered, as it is the case with terminal. I see nothing wrong
> with the patch.

I didn't enable focus stealing prevention in the settings. 

Here it simply occurs if I show + hide kopete (or another Qt application that has a systray icon) via systray icon.

So to reproduce:
1. Open Kopete and hide it to systray.
2. Open Terminal or Firefox or something else.
3. Click on systray icon -> shows kopete window
4. Klick again on systray icon -> hides Kopete window
5. _Now_ the Firefox (that is already focused!) blinks, I have to klick into Firefox to disable blinking

It doesn't make sense to show _NET_WM_STATE_DEMANDS_ATTENTION on an application that already has the focus. And typing doesn't help, I need to click in the window to disable it.
Comment 10 Bernhard Walle 2006-12-23 20:19:20 CET
(In reply to comment #8)
> > Is it intended that the 'Window list' doesn't blink as for WM_URGENT?
> 
> Urgency and NET_WM_STATE_DEMANDS_ATTENTION are different things.

ok. Just wondered because the comment from Jasper said that they are handled the same way. ;)
Comment 11 Olivier Fourdan editbugs 2006-12-23 20:51:20 CET
The problem with kopete and demands attention should be fixed with rev. 24177.
Comment 12 Bernhard Walle 2006-12-23 21:38:47 CET
(In reply to comment #11)
> The problem with kopete and demands attention should be fixed with rev. 24177.

Confirmed. Thanks. And have a nice Christmas.
Comment 13 Olivier Fourdan editbugs 2006-12-23 21:49:23 CET
(In reply to comment #12)

> Confirmed. Thanks. And have a nice Christmas.

Thanks, you too ;) 

Comment 14 Bernhard Walle 2006-12-28 21:36:46 CET
Again, I discovered another issue with _NET_WM_STATE_DEMANDS_ATTENTION. If an application sets this flag while it already has the focus, wouldn't it make sense to reset _NET_WM_STATE_DEMANDS_ATTENTION after changing the focus from this application to another application?

Ok, we can discuss if that makes much sense, but Kopete does this and it's quite annoying. kwin seems to ignore _NET_WM_STATE_DEMANDS_ATTENTION if a client has the focus.
Comment 15 Olivier Fourdan editbugs 2006-12-30 22:00:06 CET
Ok, rev. 24223. but it sounds a bit like a workaround for broken apps.

Bug #2678

Reported by:
Bernhard Walle
Reported on: 2006-12-22
Last modified on: 2009-07-15

People

Assignee:
Olivier Fourdan
CC List:
1 user

Version

Attachments

Additional information