After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 168812 - gnome-terminal should attempt to handle not being launched with startup-notification
gnome-terminal should attempt to handle not being launched with startup-notif...
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
git master
Other Linux
: Urgent normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-02-28 19:57 UTC by Elijah Newren
Modified: 2005-02-28 23:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Do all the stuff I said above (3.89 KB, patch)
2005-02-28 19:58 UTC, Elijah Newren
none Details | Review

Description Elijah Newren 2005-02-28 19:57:56 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.
Comment 1 Elijah Newren 2005-02-28 19:58:42 UTC
Created attachment 38067 [details] [review]
Do all the stuff I said above
Comment 2 Elijah Newren 2005-02-28 23:27:39 UTC
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)