Synchronous notifications briefly steal focus

Bug #694224 reported by Dylan McCall
38
This bug affects 9 people
Affects Status Importance Assigned to Milestone
notify-osd (Ubuntu)
Confirmed
High
Unassigned

Bug Description

It appears synchronous notifications (at least those for volume and brightness) briefly steal focus when they appear. This is quite problematic for games and some other applications that pause as soon as they lose focus. The focus stealing does not happen with normal, asynchronous notifications.

Here's a quick Python program to reproduce this:

#!/usr/bin/python
import gtk
import time
def cb (wid, ev):
 evtime = time.strftime ("%H:%M:%S", time.localtime())
 print ("%s: Lost focus!" % evtime)
win = gtk.Window()
win.connect ("focus-out-event", cb)
win.show_all()
gtk.main()

You could also just start playing Quadrapassel, then adjust your volume :)

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

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

affects: notify-osd → notify-osd (Ubuntu)
Changed in notify-osd (Ubuntu):
status: New → Confirmed
Changed in notify-osd (Ubuntu):
status: New → Confirmed
Revision history for this message
David Baucum (maxolasersquad) wrote :

This is generally problematic with day-to-day use of Ubuntu. For example, if I'm typing out some code in vim, then the song changes, Rhythmbox pops up a notification which steals focus. So I have to click back in the terminal to continue typing.

Just to drive home the point, while I was typing this out a notification popped up which halted my typing.

Revision history for this message
Olivier Tilloy (osomon) wrote :

This causes webbrowser-app to exit fullscreen mode when adjusting volume with media keys (see bug #1477308). Pretty annoying when watching a fullscreen video.

Changed in notify-osd (Ubuntu):
importance: Undecided → High
kevin gunn (kgunn72)
Changed in notify-osd (Ubuntu):
assignee: nobody → Mirco Müller (macslow)
Bill Filler (bfiller)
Changed in canonical-devices-system-image:
milestone: none → ww40-2015
assignee: nobody → kevin gunn (kgunn72)
status: New → Confirmed
importance: Undecided → Medium
Changed in canonical-devices-system-image:
importance: Medium → High
Revision history for this message
Mirco Müller (macslow) wrote :

This lost-focus is not caused by notify-osd itself.

You can verify this by running Dylan's provided python-script and triggering lp:notify-osd/examples/icon-value.py in another terminal (with a "sleep 10" before that, so you've enough time to focus Dylan's running python-script and its output). icon-value.py is triggering the exact same type of notification that a regular volume-up/down would be made of.

What's actually stealing the focus is the process handling the multimedia-keys input. That's the media-keys-manager part (libmedia-keys.so) of lp:gnome-settings-daemon iirc.

kevin gunn (kgunn72)
Changed in notify-osd (Ubuntu):
assignee: Mirco Müller (macslow) → nobody
kevin gunn (kgunn72)
Changed in canonical-devices-system-image:
milestone: ww40-2015 → ww46-2015
Revision history for this message
kevin gunn (kgunn72) wrote :

not a phone thing

no longer affects: canonical-devices-system-image
Revision history for this message
Sean Dague (sdague) wrote :

I'm definitely seeing this as new behavior after the 15.10 upgrade. In 15.04 this was fine for me on the destkop, now things that generate notifications steal my focus so that things like F1 no longer get sent to the window manager for things like show/hide of Tilda.

Revision history for this message
Bhajneet Kohli (bhajneet) wrote :

Hello from 2019. This is still a problem for me on Ubuntu 18.10. Is this bug still being worked on? Could it be a related problem to gnome notifications in general?

I can be typing in a chat room and often times the enter key will go to the notification that popped up because a song track has changed and the enter key instead forwards to the next track.

This also steals focus when notifications from GSConnect come up. Awkardly typing a reply to SMS/WhatsApp messages.

The volume OSD does not take focus.

I apologize if this is the incorrect program to provide this bug-report for. This is my first report.

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

Ubuntu 18.04 and later do not use notify-osd by default. Any problem with “gnome notifications in general” is in gnome-shell, not notify-osd.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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