Authentication dialog doesn't get focus

Bug #433851 reported by David Prieto on 2009-09-21
This bug affects 24 people
Affects Status Importance Assigned to Milestone
PolicyKit GNOME
policykit-1-gnome (Ubuntu)
software-center (Ubuntu)

Bug Description

Binary package hint: software-store

When I click on "install", an authentication dialog appears. Many times it does not get focus, so I have to manually click on it before being able to enter my password.

István Nyitrai (sianis) wrote :

I've tried to reproduce this bug, doesn't affect me. Could you try again with the version in trunk?

Changed in software-store (Ubuntu):
status: New → Incomplete

István, I don't really know how to compile and run trunk versions. Is is OK if I just try again with the next released version? Will you guys be releasing any more versions before Karmic goes final?

István Nyitrai (sianis) wrote :

You can run it without any packaging. Just download the branch, get in the directory and run ./software-store.

Changed in software-store (Ubuntu):
status: Incomplete → Confirmed
Matthew Paul Thomas (mpt) wrote :

This happens intermittently, perhaps because of Compiz's focus-stealing-prevention heuristics.

I had asked Robert Ancell about this some weeks ago, and he told me it was bug 165161, but that bug has apparently been fixed for the past week. Robert, can you please fix this? The Store passes its window ID to Aptdaemon deliberately so that Aptdaemon can tell PolicyKit to make its window modal to the Store window. Therefore, if the Store window was focused when the PolicyKit window is opened, the PolicyKit window should reliably take focus from the Store window.

Robert Ancell (robert-ancell) wrote :

I also cannot reproduce this problem. I've tried clicking the install button ~30 times with the window in various states and between restarted software-store and the window always pops up above the application. It used to have this problem for me in older versions of compiz.

What version of compiz do you have? ($ dpkg -s compiz), I have:

Robert Ancell (robert-ancell) wrote :

Of course the easy way to find the compiz version is to search for it in software-store...

Matthew Paul Thomas (mpt) wrote :

This screencast shows the bug happening repeatedly with Ubuntu Software Store 0.3.9 and compiz 1:0.8.3+git20090917-0ubuntu1.

Matthew Paul Thomas (mpt) wrote :
Robert Ancell (robert-ancell) wrote :

Reproduced in Compiz.

Also partially reproducable in Metacity:
1. Open software store
2. Choose application to install
3. Click install - The authentication dialog does not have focus.
4. Close authentication dialog
5. Click install - The authentication dialog has focus
(repeats from step 4)

You can also reset to step 3 by switching windows on the panel then returning to the software store.

I can't see any code in PolicyKit GNOME to handle making the authentication dialogs transient. Also note that software-store passes the XID to software-properties-gtk not gksu.

Robert Ancell (robert-ancell) wrote :

Looking more shows a software-store install operation produces an AptTransaction. There doesn't appear to be any code to pass the window ID to the APT daemon.

Robert Ancell (robert-ancell) wrote :

I've opened an upstream report against PolicyKit-GNOME:

Travis Watkins (amaranth) wrote :

Note that the next upload of compiz will have a workaround for this problem (bug 436852) so you'll have to undo that workaround to test this if compiz gets another upload before a fix for this is uploaded. You can see the details in that bug report.

Brownout (brownout) wrote :

I'm not using Compiz and I'm experiencing this issue, I can reproduce it changing the frequency scaling from the gnome applet.
This is extremely annoying since you can easily send your password to the wrong window (chat, IM, command line, ...)

Michael Vogt (mvo) wrote :

I close the software-center task, this is not something that can be fixed in s-c

Changed in software-center (Ubuntu):
status: Confirmed → Invalid
Matteo Rossi (teo-red90) wrote :

The bug is still present in up-to-date Lucid

Omer Akram (om26er) on 2010-05-22
Changed in policykit-gnome (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Changed in policykit-1-gnome:
importance: Unknown → High
status: Unknown → In Progress
Changed in policykit-gnome (Ubuntu):
assignee: nobody → Robert Ancell (robert-ancell)
Martin Pitt (pitti) wrote :

This was fixed recently in Natty, just not autoclosed because the task was against the wrong package.

policykit-1-gnome (0.99-0ubuntu1) natty; urgency=low

  * New upstream release
  * debian/control:
    - Build-depend on dh-autoreconf, gnome-common
    - Bump build-depends on libpolkit-agent-1-dev, libpolkit-gobject-1-dev
    - Drop build-depends on quilt, autotools
    - Use Standards-Version 3.9.1
    - Add Vcs-Bzr link
  * debian/rules:
    - Use
  * debian/source:
    - Use source version 3.0
  * debian/patches/00git-hide-agent-autostart.patch:
    - Applied upstream
  * debian/patches/05-dialog-focus:
    - Make PolicyKit dialogs associate with the application that
      launched them (LP: #433851)
  * debian/patches/99_autoreconf.patch:
    - Obsolete

 -- Robert Ancell <email address hidden> Tue, 02 Nov 2010 17:09:07 +1100

affects: policykit-gnome (Ubuntu) → policykit-1-gnome (Ubuntu)
Changed in policykit-1-gnome (Ubuntu):
status: Triaged → Fix Released
Robert Ancell (robert-ancell) wrote :

Re-opening software-center task - there will be a required code change to make software-center use this. In the case of C the code is:

      details = polkit_details_new ();
      window = gtk_widget_get_toplevel (GTK_WIDGET (button));
      xid = g_strdup_printf ("%lu", gdk_x11_drawable_get_xid (GDK_DRAWABLE (gtk_widget_get_window (window))));
      polkit_details_insert (details, "toplevel_xid", xid);
      g_free (xid);

Changed in software-center (Ubuntu):
status: Invalid → New
Robert Ancell (robert-ancell) wrote :

I've had to drop the patch due to bug 685655 - the PolicyKit daemon doesn't allow non-root clients to set details (which is how the window ID was being passed).

Changed in policykit-1-gnome (Ubuntu):
status: Fix Released → Triaged
Jim Tarvid (tarvid) wrote :

I still see the bug in an up-to-date Natty.

The "Install" button also disappeared.

"More info" quit working too.

The "progress" icon keeps spinning.

@Jim Tarvid: it sounds like you have a different and more severe problem. You should probably get some help with that separate from this bug report. Try something from

Guntbert Reiter (guntbert) wrote :

On a freshly updated (from maverick) natty, that behaviour persists, I tried it several times, the authentication window never got the focus (I still don't understand the relations between the targets, why is that bug "new" in software center?)

The reason it's marked as NEW in software center is because this issue has been identified as being caused (or at least solvable) in the policykit package - as far as the software-center package goes it is currently unsure or not researched whether this can be solved there. The status of this bug in software-center has changed several times. You can see a full log of changes by clicking the link 'See full activity log' at the bottom of the comments list.

Also I notice that this is only marked as affecting 8 people - please remember to add yourself if you're affected by this. It helps developers prioritize their time.

Josh (majik) wrote :

This happens in Natty when using the Ubuntu Classic No Effects shell.

I can't test on other shells because I don't have a super fast computer where I can afford to throw away half my system resources on making the desktop spin around as a cube.

Changed in software-center (Ubuntu):
status: New → Confirmed
Gary Lasker (gary-lasker) wrote :

I cannot reproduce this error at all using Ubuntu Precise beta 2 and Ubuntu Software Center The authentication dialog is correctly focused each time. Also, the most recent duplicate is from July of 2011. So, I will close this task for Software Center.

If anyone encounters this problem again in Precise, please feel free to reopen the task.

Many thanks, all!

Changed in software-center (Ubuntu):
status: Confirmed → Invalid
John Cottier (j-cottier) wrote :

It is doing this on the release version of 12.04 Unity desktop with nouveau driver.

When you start Synaptic and start typing in the password, a little box appears in the bottom right of the screen and shows the text for the password for all to see. Just a slight security issue! When you click to get the focus on the password text entry, the box disappears.

Changed in policykit-1-gnome (Ubuntu):
assignee: Robert Ancell (robert-ancell) → nobody
Changed in policykit-1-gnome:
status: In Progress → Expired
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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