Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 183203 - DESKTOP_STARTUP_ID makes window started from terminal appear in background on KDE
Summary: DESKTOP_STARTUP_ID makes window started from terminal appear in background on...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Sven Wegener
URL: http://standards.freedesktop.org/star...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-25 23:03 UTC by Martin von Gagern
Modified: 2011-11-23 09:50 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2007-06-25 23:03:24 UTC
I just got a bit annoyed by pinentry appearing in the background sometimes. I found ot this depended on current environment; and by checking environment variables one after the other I found DESKTOP_STARTUP_ID as the culprit.

When DESKTOP_STARTUP_ID is set, then pinentry-gtk-2 from app-crypt/pinentry-0.7.2-r4 will start in the background, and anything you type will still go to the currently selected application unless you switch window focus to pinentry.

The exact value of the variable seems unimportant, as long as it matches the regular expression _TIME[0-9].

It might be that my terminal, x11-terms/rxvt-unicode-8.2, should remove this variable from the environment before passing it to the shell.

I must say I don't fully understand what's going on here, but I believe that this is at least one bug. Candidates are pinentry, rxvt-unicode and KDE.

Steps to reproduce:
1. Start KDE session
2. Start urxvt
3. pinentry << $'GETPIN\nBYE'

Expected result:
Pinentry dialog started in the foreground, grabbing the keyboard.

Actual result:
Pinentry started in the background, blinking, without grabbing keyboard.
Comment 1 Martin von Gagern 2007-06-25 23:33:36 UTC
Another possible solution might be to unset that environment variable in shell
startup scripts like /etc/bash/bashrc.
Comment 2 Martin von Gagern 2007-06-26 01:07:13 UTC
I found a reference and set it as the URL for this bug here:
http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt

There it reads "It is suggested to unset this environment variable in the launchee as soon as it's read, to avoid possible reuse by some process started later by launchee."
Comment 3 Martin von Gagern 2007-06-26 02:07:59 UTC
Had a chat with the urxvt dev. He claims the startup notification specification is flawed, and will not implement it until it gets corrected.
As a result, I created an upstream bug for the specification:
https://bugs.freedesktop.org/show_bug.cgi?id=11375

While I assume a clean solution upstream will take considerable time, I'd like to see Gentoo implement some more pragmatic solution that works in most cases. I guess I'm in favour of my own comment #1, even though this would not benefit non-terminal applications that start other applications interactively. I can only hope that most of those do use some library that already takes care of unsetting DESKTOP_STARTUP_ID.
Comment 4 Martin von Gagern 2007-06-26 10:11:40 UTC
There is also a related KDE bug at http://bugs.kde.org/show_bug.cgi?id=108618 which has been resolved WONTFIX on the kde level. They suggest to
- not use such terminal apps                (not a viable option imho)
- ask their developers to fix it            (would mean a patch to urxvt)
- unset the env.var. in some startup script (like comment #1)
Comment 5 Sven Wegener gentoo-dev 2007-06-26 18:37:04 UTC
So, it seems to me this is a bug in KDE, not in pinentry?
Comment 6 Martin von Gagern 2007-06-26 20:17:11 UTC
(In reply to comment #5)
> So, it seems to me this is a bug in KDE, not in pinentry?

Yes, KDE or rxvt-unicode, or it might even be the GTK-libs used by pinentry, but not a bug in pinentry itself. I hadn't understood the issue enough at the time I posted the bug report. Changing the summary to reflect my current knowledge.
Comment 7 Martin von Gagern 2011-11-23 09:50:21 UTC
(In reply to comment #0)
> Steps to reproduce:
> 1. Start KDE session
> 2. Start urxvt
> 3. pinentry << $'GETPIN\nBYE'
> 
> Actual result:
> Pinentry started in the background, blinking, without grabbing keyboard.

Can't reproduce this any longer with KDE 4. Guess someone fixed something. $DESKTOP_STARTUP_ID is still set. Will close this as OBSOLETE. By the way, step 3 above should use <<< not <<.