GNOME Bugzilla – Bug 721304
GtkApplicationX11: read the startup ID from the platform data
Last modified: 2015-07-05 19:30:20 UTC
If the platform data passed with actions and activations includes a startup notify ID, we should read it and pass it down to GDK. This ensures that the right startup notify is completed after the signal emission, and that the user time of the GdkDisplay is properly updated (which in turn makes sure the windows are not subjected to focus-stealing-prevention)
Created attachment 265105 [details] [review] GtkApplicationX11: read the startup ID from the platform data
Created attachment 265106 [details] [review] GtkApplicationX11: try to reuse the startup ID when remote If the application is remote, but initialized gdk already (thus clearing the DESKTOP_STARTUP_ID variable), try to obtain a startup ID from the GdkDisplay and pass that on.
Review of attachment 265105 [details] [review]: This one is fine. It's pretty much what we had before the re-factor, but it was accidentally dropped. Thanks for the catch.
Review of attachment 265106 [details] [review]: Not so happy about this one. What kind of apps are calling gtk_init() themselves? That's just wrong... Even if we were to accept this, I'd want it to be done via the impl backend anyway -- if gtk_init() has run then we already have a default display and then we'd be capable of choosing the backend based on that so we could move up the creating of the impl. I still think it's incorrect, however.
If it is incorrect, shouldn't gtk_application_run issue a warning if gtk_init has already been called ? I think we have to evaluate what causes people to call gtk_init ahead of time - what gtk calls are needed before entering gtk_application_run ?
That's a good suggestion. Probably just a critical message (with no return) would be enough to get most people to notice, and then we might also get some bugs from people about it (and can help them through their perceived problem, or discover their legitimate need).
Calling gtk_init (e.g. through gtk_get_option_group() and pre-parsing args) should be supported, IMO. E.g. gnome-terminal first parses args, then creates a GtkApplication and runs it (with NULL passed as argv).
Doesn't e.g. clutter_gtk_init or cheese_gtk_init or others (GStreamer?) require that gtk_init be called first?
Comment on attachment 265105 [details] [review] GtkApplicationX11: read the startup ID from the platform data Attachment 265105 [details] pushed as cecb2fa - GtkApplicationX11: read the startup ID from the platform data Jasper, in theory all the _init() stuff should be called from GtkApplication::startup. The problem, if any, is init() stuff that is called behind your back (like pygobject's Gtk module)
This was left open by accident, it seems.