New Windows Launched From Desktop Don't Receive Focus

Bug #1396716 reported by Sajan Parikh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Thunar File Manager
Fix Released
Medium
thunar (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Using Xubuntu 14.10.

The following setting is checked:

Settings Manager -> Window Manager -> Focus -> "Automatically give gocus to newly created windows"

When launching from whisker menu, focus is given to new window/application as expected.
When an application creates a new window, focus is given as expected.
When applications are launched from a launcher on a panel, focus is given as expected.

The problem is when an application is launched from a .desktop icon launcher on the desktop (/home/user/Desktop). I have multiple icons on my desktop, and whenever I launch and application from them, the new window does not receive focus.

The icons were created by finding the application on the whisker menu, right clicking, and select "Add To Desktop".

➜ ~ lsb_release -rd
Description: Ubuntu 14.10
Release: 14.10

➜ ~ sudo apt-cache policy xfwm4
[sudo] password for sajan:
xfwm4:
  Installed: 4.11.2-0ubuntu2
  Candidate: 4.11.2-0ubuntu2
  Version table:
 *** 4.11.2-0ubuntu2 0
        500 http://mirrors.gigenet.com/ubuntuarchive/ utopic/universe amd64 Packages
        100 /var/lib/dpkg/status

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: xfwm4 4.11.2-0ubuntu2
ProcVersionSignature: Ubuntu 3.16.0-25.33-generic 3.16.7
Uname: Linux 3.16.0-25-generic x86_64
ApportVersion: 2.14.7-0ubuntu8
Architecture: amd64
CurrentDesktop: XFCE
Date: Wed Nov 26 12:09:42 2014
InstallationDate: Installed on 2014-11-25 (1 days ago)
InstallationMedia: Xubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
SourcePackage: xfwm4
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
In , Zelouille-g (zelouille-g) wrote :

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.

Revision history for this message
In , Zelouille-g (zelouille-g) wrote :

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.

Revision history for this message
In , Landry-o (landry-o) wrote :

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) ?

Revision history for this message
In , Landry-o (landry-o) wrote :

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.

Revision history for this message
In , Olivier Fourdan (fourdan) wrote :

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.

Revision history for this message
In , Zelouille-g (zelouille-g) wrote :

@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

Revision history for this message
Sajan Parikh (sajanparikh) wrote :
Revision history for this message
Sajan Parikh (sajanparikh) wrote :

I looked at this again and noticed that of the .desktop icons I have on my Desktop, only Firefox and Thunderbird are affected by this. So...not sure what to do about that.

Revision history for this message
Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

Did you add the "Web Browser" or "Firefox Web Browser" launcher to your desktop? Do both app launchers trigger the problem?

Revision history for this message
Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

Disabling the "Use startup notification" option (right click on the desktop icon > Properties > Launcher) resolves the focus behavior for all the applications which I have tested.

Can you please file a report on the Xfce bug tracker to inform the upstream developers? I suggest that you file it against xfdesktop which seems to trigger the problem in the first place.

https://bugzilla.xfce.org/

Revision history for this message
Sajan Parikh (sajanparikh) wrote :

Thaddäus Tintenfisch, I had added Firefox Web Browser.

You are right, when this issue presents itself, disabling 'Use startup notification' fixes it.

I will file the bug upstream with these details.

Thanks.

Revision history for this message
In , Sajan Parikh (sajanparikh) wrote :

Overview
===========

I am using Xubuntu 14.10, the xfdesktop4 package shows version 4.11.8.

Here is the bug at launchpad for the xfdesktop4 package - https://bugs.launchpad.net/ubuntu/+source/xfwm4/+bug/1396716

Steps To Reproduce
======================
Enable Settings Manager -> Window Manager -> Focus -> "Automatically give gocus to newly created windows"

Create desktop launcher for Firefox Web Browser (/home/user/Desktop/firefox.desktop).

Launch Firefox from created desktop launcher.

Actual Results
=================

Newly created window does not receive focus automatically.

Expected Results
====================

Newly created Firefox window should have focus.

Additional Information
=========================

This does not happen with all applications. I keep a limited number of icons on my desktop so have only noticed this with Firefox and Thunderbird.

A work around seems to be disabling "Use startup notification" on the launcher. Once disabled on the Firefox Web Browser and Thunderbird launchers, they receive focus when launched as expected.

There are other applications with "Use startup notification" enabled, that receive focus when launched as expected.

affects: xfwm4 (Ubuntu) → xfdesktop4 (Ubuntu)
Changed in xfdesktop:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Landry-o (landry-o) wrote :

Duplicate of 9646

*** This bug has been marked as a duplicate of bug 9646 ***

Revision history for this message
In , Landry-o (landry-o) wrote :

*** Bug 11347 has been marked as a duplicate of this bug. ***

Changed in xfdesktop:
status: Confirmed → Invalid
Changed in xfdesktop:
importance: Medium → Unknown
status: Invalid → Unknown
Changed in xfdesktop:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

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.

Revision history for this message
In , Thaddaeus Tintenfisch (thad-fisch-deactivatedaccount) wrote :

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.

Revision history for this message
In , Hjudt-l (hjudt-l) wrote :
affects: xfdesktop → thunar
affects: xfdesktop4 (Ubuntu) → thunar (Ubuntu)
Changed in thunar:
status: Confirmed → Fix Released
Revision history for this message
Theo Linkspfeifer (lastonestanding) wrote :

Fixed in thunar 1.6.7+

Changed in thunar (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.