GNOME Bugzilla – Bug 168812
gnome-terminal should attempt to handle not being launched with startup-notification
Last modified: 2005-02-28 23:27:39 UTC
If gnome-terminal is not launched with startup-notification, then it doesn't know the timestamp of the user interaction that caused it to launch. It then falls back to the gtk+ default, which is to assume that any new window of an app was launched by the user's most recent interaction with that app. That tends to be a time that is way too old for gnome-terminal, since it does the forward-request-to-open-a-new-window-to-a-previous-instance thing. gnome-terminal should instead provide a better approximation to the timestamp that caused the launch than what gtk+ is able to come up with. Doing this will fix the gnome-terminal-doesn't-get-focused-when-launched-without-startup-notification bug. It causes gnome-terminal to sometimes steal focus when it shouldn't, but it's much better default behavior in the face of buggy launcher (such as nautilus or perhaps gnome_url_show--see bug 162424 and bug 166722). I'll attach a patch in a minute. If I can get approval here, I'll run it by the release team.
Created attachment 38067 [details] [review] Do all the stuff I said above
Since this is important to get it and people tell me that Mariano is on vacation, I'm committing. Kick me if I was wrong to do so. :-) 2005-02-28 Elijah Newren <newren@gmail.com> Approximate the time that gnome-terminal was launched if not launched with startup-notification. Fixes #168812. * src/terminal.c: (slowly_and_stupidly_obtain_timestamp): new function, (main): get a timestamp from the xserver to approximate launch time if no DESKTOP_STARTUP_ID is provided * src/terminal-window.c: (terminal_window_show): only do sn_launchee_context_setup_window() if the startup_id is valid, remove an error that shouldn't happen (well, unless using an out-of-date startup-notification launcher, but that's someone else's problem)