Authentication dialog window loses focus easily - Ubuntu 12.04

Bug #946171 reported by Jane Atkinson
28
This bug affects 5 people
Affects Status Importance Assigned to Milestone
policykit-gnome
Won't Fix
Medium
policykit-1-gnome (Debian)
Fix Released
Unknown
policykit-1-gnome (Ubuntu)
Fix Released
Undecided
Unassigned
Precise
Fix Released
Undecided
Unassigned
Quantal
Fix Released
Undecided
Unassigned

Bug Description

[SRU Request]

[Impact]
The policykit authentication dialog sometimes comes up unfocused, which causes users to type in their password into other applications.

[Test Case]
1- Install Precise
2- Log into Unity2d (not 3d, is visible with metacity)
3- Install Synaptic
4- Open Synaptic, authenticate, right lick on launcher to keep synaptic icon there
5- Click on Synaptic icon in launcher and see if policykit authentication dialog comes up unfocused. May take a few tries.

[Regression potential]
A regression in this code would most likely prevent the authentication window from showing up at all, which would be easy to spot and fix.

This is a fresh install of Precise from the beta1 alternate CD, but the problem has been occurring in earlier versions. I originally installed Oneiric and upgraded before the alpha 1 release.

When using an application that needs administrative access, I notice that the password dialog box loses focus easily, and I can end up typing the password in places where it's easily visible. Examples are a nautilus search area, terminal window or draft email.

Mostly I'm using Gnome fallback, though I've observed the same behaviour in Unity 2D as well. I'm still not clear what is causing the loss of focus. Sometimes it's because I've clicked on something else, but not always. Nor does the dialog always lose focus.

An authentication box called by explicitly typing "gksu" doesn't lose focus. The screen dims as well, which is not happening with the other dialogs.

I'm not sure what the proper package to report against is, so feel free to move to wherever it's appropriate.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: metacity 1:2.34.1-1ubuntu7
ProcVersionSignature: Ubuntu 3.2.0-17.27-generic-pae 3.2.6
Uname: Linux 3.2.0-17-generic-pae i686
ApportVersion: 1.94-0ubuntu1
Architecture: i386
Date: Sun Mar 4 21:41:22 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta i386 (20120301)
ProcEnviron:
 LANGUAGE=en_NZ:en
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_NZ.UTF-8
 SHELL=/bin/bash
SourcePackage: metacity
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jane Atkinson (irihapeti) wrote :
affects: ubuntu → policykit-gnome (Ubuntu)
security vulnerability: yes → no
security vulnerability: yes → no
visibility: private → public
visibility: private → public
Revision history for this message
Jane Atkinson (irihapeti) wrote :

I haven't seen this behaviour for a while now, so I'm assuming that it's been fixed.

Revision history for this message
Jane Atkinson (irihapeti) wrote :

Sorry, I spoke too soon. Not fixed yet. I opened GParted, the authentication dialog box was in front a terminal that was already open, and I had to click on the dialog box top bar to get focus.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in policykit-gnome (Ubuntu):
status: New → Confirmed
Revision history for this message
Jeffrey Knockel (jeff250) wrote :

I've submitted the bug upstream with a possible patch to fix it. I believe that this bug is related to metacity's focus-stealing prevention and use of stale X11 timestamps to activate windows. Please see the upstream bug for more details:
https://bugzilla.gnome.org/show_bug.cgi?id=676076

Changed in policykit-gnome:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Joost Van Durme (joostvandurme) wrote :

I'm also experiencing this issue e.g. with opening Synaptic. Thanks for opening this topic.
The password dailog box almost always loses focus immediately.

Don't know if it's the same issue, but when opening Nautilus, the new Nautilus window sits only in the background on my window list panel. It is not showing on top or having focus.

12.04, Gnome fallback, no effects (metacity).

I don't sense too much fixing activity ...

Revision history for this message
Jeffrey Knockel (jeff250) wrote :

I see that issue with nautilus too, but I believe that is a separate bug, although it may be similar in source.

I've uploaded a test policykit-1-gnome package for 12.04 to my ppa here:
https://launchpad.net/~jeff250/+archive/ppa

Please upgrade the policykit-1-gnome package, log out, log in, and test it and report your feedback.

I also tried to upload a 12.10 test package, but launchpad yelled at me since it's essentially the same package as the 12.04 package modulo the changelog (12.10 hasn't changed the package yet since 12.04). But quantal users can still test it by manually adding the precise repository, or by manually installing one of the debs here:
http://ppa.launchpad.net/jeff250/ppa/ubuntu/pool/main/p/policykit-1-gnome/

I'm also attaching the debdiff patches.

Revision history for this message
Jeffrey Knockel (jeff250) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Proposed debdiff for precise" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Joost Van Durme (joostvandurme) wrote :

Well, also Transmission loses focus when it's running and I'm adding a torrent.
The files window opens briefly, then loses focus and I can start looking for the window to click OK.
Seems to be a larger problem with metacity.

Revision history for this message
Jeffrey Knockel (jeff250) wrote :

policykit-gnome presently uses stale timestamps to focus the password dialog--it should use a timestamp that is as fresh as the user input that triggered its focus.

Maybe metacity should be more forgiving with buggy application-provided timestamps, but this report is about policykit-gnome. If you think metacity is buggy, feel free to find/create another report about that.

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Thanks for the fix, and the debdiffs!

ACK.

I'm uploading it to quantal now, with a slight change: I've added headers to your patch as per guidelines: http://dep.debian.net/deps/dep3/

Once it's been in Quantal for a few days, we can SRU it into precise.

Changed in policykit-gnome (Ubuntu Precise):
status: New → Confirmed
Changed in policykit-gnome (Ubuntu Quantal):
status: Confirmed → Fix Committed
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Uploaded to precise-proposed, and subscribed SRU team for processing.

description: updated
Changed in policykit-gnome (Debian):
status: Unknown → New
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Changed bug to actual source package name, and marked quantal as "fix released" since it's in.

affects: policykit-gnome (Ubuntu Quantal) → policykit-1-gnome (Ubuntu Quantal)
Changed in policykit-1-gnome (Ubuntu Quantal):
status: Fix Committed → Fix Released
affects: policykit-gnome (Debian) → policykit-1-gnome (Debian)
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello Jane, or anyone else affected,

Accepted policykit-1-gnome into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/policykit-1-gnome/0.105-1ubuntu3.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in policykit-1-gnome (Ubuntu Precise):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Jeffrey Knockel (jeff250) wrote :

I've tested the precise-proposed package on three different installs, and the issue appears resolved.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package policykit-1-gnome - 0.105-1ubuntu3.1

---------------
policykit-1-gnome (0.105-1ubuntu3.1) precise-proposed; urgency=low

  * debian/patches/08-fresh-x11-timestamps.patch: use fresh X11 timestamps
    when displaying authentication dialog to circumvent focus-stealing
    prevention. (LP: #946171)
 -- Jeffrey Knockel <email address hidden> Fri, 27 Jul 2012 00:41:43 -0600

Changed in policykit-1-gnome (Ubuntu Precise):
status: Fix Committed → Fix Released
Changed in policykit-1-gnome (Debian):
status: New → Fix Released
Changed in policykit-gnome:
status: New → Won't Fix
Revision history for this message
Hồng Quân (ng-hong-quan) wrote :

This bug appears again in Ubuntu 22.04.

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.