! 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 !
popups steals focus
Status:
RESOLVED: FIXED

Comments

Description lennynero 2008-11-26 13:06:48 CET
I'm using emesene and where it show me a popup of a new message i loose focus on my current window...
Comment 1 Yves-Alexis Perez editbugs 2008-11-26 13:26:56 CET
(In reply to comment #0)
> I'm using emesene and where it show me a popup of a new message i loose focus
> on my current window...

Then activate focus stealing prevention?
Comment 2 lennynero 2008-11-26 14:17:45 CET
(In reply to comment #1)
> (In reply to comment #0)
> > I'm using emesene and where it show me a popup of a new message i loose focus
> > on my current window...
> 
> Then activate focus stealing prevention?

Nothing...the problem is that xfce manage popups like new windows opened by me...
Comment 3 Yves-Alexis Perez editbugs 2008-11-26 14:57:20 CET
What is checked in WM settings / focus / Automatically give focus to newly
created windows?
Comment 4 lennynero 2008-11-26 16:44:39 CET
(In reply to comment #3)
> What is checked in WM settings / focus / Automatically give focus to newly
> created windows?

I have checked this option because *i want* focus in new windows opened by me(e.g. file manager...), but i don't want that every (notification)popups steals my focus...
Comment 5 Olivier Fourdan editbugs 2008-11-26 19:30:24 CET
Actually, the algorithm for focus preventions is simple, it compares the NET_WM_USER_TIME  of the two windows, and gives focus to the newly mapped window has a timestamp later than the currrent focused window (there is no special treatment for popup and this the expected behaviour)

It's the application that updates its NET_WM_USER_TIME based on user events. 

That means that if the popup are focused, it's because either the current focused window did not updated its NET_WM_USER_TIME (granted that the user have actually performed an action) or the popup window sets a timestamp that is more current (it is possible to defeat focus stealing prevention by updating the NET_WM_USER_TIME)
Comment 6 lennynero 2008-11-26 20:26:50 CET
I have made some test: the problem is that baloon of emesene are gtk.window and in it there is: 
self.set_property('can-focus', False)
self.set_property('accept-focus', False)

So i don't undestand why my current window loose focus...
The *problem* of xfce is that loose focus of baloon despite there are those options...

With another notify sistem of emesene that use libnotify focus is ok. 
Now i'm using libnotify...
Comment 7 Olivier Fourdan editbugs 2008-11-26 22:55:02 CET
Thiss is because those popup windows have WM_FLAG_INPUT unset and WM_FLAG_TAKEFOCUS which means that the focus will be taken by the app and not set explicitely by the WM.

In that case xfwm4 sets the focus to to an internal window to avoid a race condition with the application that had previously the focus.

As a result, your window looses focus. I am not sure how to properly implement this though.
Comment 8 Olivier Fourdan editbugs 2008-11-26 22:56:14 CET
This is not a major issue, changing back to medium/normal
Comment 9 lennynero 2008-11-27 00:58:47 CET
(In reply to comment #7)
> Thiss is because those popup windows have WM_FLAG_INPUT unset and
> WM_FLAG_TAKEFOCUS which means that the focus will be taken by the app and not
> set explicitely by the WM.
> 
> In that case xfwm4 sets the focus to to an internal window to avoid a race
> condition with the application that had previously the focus.
> 
> As a result, your window looses focus. I am not sure how to properly implement
> this though.

So... can i set this 2 variables, or set some other option of gtk.window, to leave the focus to the current window?
Comment 10 Olivier Fourdan editbugs 2008-11-27 13:44:55 CET
No, there is not much you can from the application.

This should be fixed in rev. 28924. though.

Bug #4652

Reported by:
lennynero
Reported on: 2008-11-26
Last modified on: 2009-07-14

People

Assignee:
Olivier Fourdan
CC List:
1 user

Version

Version:
4.5.92 (4.6 beta 2)

Attachments

Additional information