! 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 !
Window don't take focus automatically when "Use startup notification" is chec...
Status:
RESOLVED: FIXED

Comments

Description zelouille 2012-12-16 00:34:29 CET
System:
    Xubuntu 12.04 32bits (Xfce 4.8 - xfwm)
    Xubuntu 12.10 32bits LiveCD (Xfce 4.10 - xfwm)

Step to reproduce:
    1. Create a launcher with "Use startup notification" checked.
    2. Clic on it.

What happened:
    The window opened is not focused

What I expected to happen:
    This new window would be focused automatically

------

I have tried to change every settings in xfwm4-tweaks-settings without success, windows never take focus when "use startup notification" is checked.
Comment 1 zelouille 2012-12-16 01:31:21 CET
Addendum:
I'm talking about the launchers on the desktop, not on the panel.
Launchers on the panel, with "Use startup notification" works great.


Steps to reproduce (corrected):
    1. Create a launcher on your desktop with "Use startup notification" checked.
    2. Click on it.
Comment 2 Landry Breuil editbugs 2012-12-16 10:21:46 CET
If the bug is with a launcher on the desktop, the bug should probably be assigned to xfdesktop instead of xfwm4, since it might not set the correct properties on the app being launched (contrary to xfce4-panel launchers which works) ?
Comment 3 Landry Breuil editbugs 2012-12-16 10:33:16 CET
Seems to work fine here with xfdesktop 4.10.0. What are your focus settings ? Here's it's "click to focus" + "automatically focus new windows" checked + "prevent focus stealing" unchecked.
Comment 4 Olivier Fourdan editbugs 2012-12-16 11:39:01 CET
When using startup notification, the timestamp used do decide if focus should be set or not is from the startup notification mechanism.

So most likely, what happens is that additional activity occurs with the desktop window after the timestamp is recorded for startup notification... So when the window manager compares last activity timestamp against the startup notification provided timestamp, it finds the latter to be older and therefore won't focus the window.
Comment 5 zelouille 2012-12-16 16:47:37 CET
@Landry Breuil 
My settings are the same :
    "click to focus": ON
    "automatically focus new windows": ON
    "prevent focus stealing": OFF
But I've tried pretty much every settings.

------

@Landry Breuil
I've heard about a mechanism that don't focus the window if the application take too much time to open. In order to not distract the user if he was doing something else during that time.
But my windows don't get focused even with light applications that open immediately (gcalctool...).
Same results by pressing Enter to run the launcher, without touching my mouse.

------

I've just noticed I don't get the cursor animation too, that should play during the opening of a launcher with "Use startup notification" checked.

The same launcher with "use startup application" checked:
    Launcher on panel: Focus works. Hourglass* FAILS 
    Launcher on thunar: Focus works. Hourglass* FAILS
    Launcher on the desktop: Focus FAILS. Hourglass* FAILS

    *Hourglass: By that, I mean the cursor-idle-animation.

xfdesktop : version 4.8.3-2ubuntu7
libstartup-notification0 : version 0.12-1ubuntu1
Comment 6 Landry Breuil editbugs 2014-12-17 14:38:49 CET
*** Bug 11347 has been marked as a duplicate of this bug. ***
Comment 7 Thaddaeus Tintenfisch editbugs 2015-02-23 20:03:39 CET
Created attachment 5985 
patch (thunar)

I've attached an experimental patch which only alters the event timestamp in thunar_file_execute. This seems to fix the window focus bug without breaking anything, but is most likely not a proper fix.
Comment 8 Thaddaeus Tintenfisch editbugs 2015-03-01 20:08:13 CET
Created attachment 6020 
Fix startup id handling for launch requests over D-Bus

This is a proper patch which fixes the missing startup id handling.

Bug #9646

Reported by:
zelouille
Reported on: 2012-12-16
Last modified on: 2015-03-06
Duplicates (1):
  • 11347 [bug] Windows Launched From .desktop Launchers Sometimes Don't Receive Focus

People

Assignee:
Xfce Bug Triage
CC List:
5 users

Version

Attachments

patch (thunar) (1.29 KB, patch)
2015-02-23 20:03 CET , Thaddaeus Tintenfisch
no flags
Fix startup id handling for launch requests over D-Bus (6.03 KB, patch)
2015-03-01 20:08 CET , Thaddaeus Tintenfisch
no flags

Additional information