GNOME Bugzilla – Bug 697197
Empathy ignores the platform-data when activated
Last modified: 2013-04-05 12:24:47 UTC
Created attachment 240504 [details] [review] Empathy: Use g_application_activate to pass platform-data to the GtkApplication When launching Empathy with g_app_info_launch, it completely ignores the platform-data passed to it through the GAppLaunchContext such as the desktop-startup-id that window managers uses to focus or not the given application. This can lead to focus issues in both gnome-shell and unity. The problem is that Empathy is considered as a CommandLine Application, while it should use g_application_open or g_application_activate. I've attached here a patch that fixes this issue, by using g_application_activate instead of the manual command-line handling. Also we make sure that the DESKTOP_STARTUP_ID env variable is not unset when initializing gtk (using the nautilus-way, see https://git.gnome.org/browse/nautilus/commit/?id=6b5ffd4).
Created attachment 240579 [details] [review] empaty.desktop: enable StartupNotify
Created attachment 240589 [details] [review] EmpatyApp: Use GAction to pass the command-line to main instance
Review of attachment 240504 [details] [review]: ++
Review of attachment 240579 [details] [review]: ++
Review of attachment 240589 [details] [review]: ::: src/empathy.c @@ +345,3 @@ + { + if (!self->start_hidden) + empathy_window_present (GTK_WINDOW (self->window)); Could you record this a separated patch so I can backport it to 3.8? Also, include "https://bugzilla.gnome.org/show_bug.cgi?id=697254" in the commit message so you'll be credited in the NEWS file. @@ +387,3 @@ + + g_free (self->preferences_tab); + EmpathyApp *self = EMPATHY_APP (data); This can be removed... @@ +392,3 @@ + + if (length > 0) + ... and you can just use "self->preferences_tab = g_value_dup_string (tab);".
(In reply to comment #0) > Created an attachment (id=240504) [details] [review] > Empathy: Use g_application_activate to pass platform-data to the GtkApplication Also could you please check/fix the other binaries: empathy-chat, empathy-call, empathy-accounts and empathy-debugger.
Created attachment 240637 [details] [review] EmpatyApp: Use GAction to pass the command-line to main instance Third patch updated, it needs patch attached to Bug 697254 to apply correctly.
Review of attachment 240504 [details] [review]: Pushed!
Review of attachment 240579 [details] [review]: Pushed
(In reply to comment #6) > (In reply to comment #0) > > Created an attachment (id=240504) [details] [review] [details] [review] > > Empathy: Use g_application_activate to pass platform-data to the GtkApplication > > Also could you please check/fix the other binaries: empathy-chat, empathy-call, > empathy-accounts and empathy-debugger. Yes, sure... I'll give them a look. First two patches pushed, though. The last one updated as you suggested.
Created attachment 240659 [details] [review] EmpathyAccounts-use-GApplication-activate.patch
Created attachment 240660 [details] [review] EmpathyChat-pass-platform-data-when-activating.patch
Created attachment 240661 [details] [review] EmpathyDebugger-Use-application-activate-and-keep-platform-data.patch
Created attachment 240662 [details] [review] EmpathyApp: Use GAction to pass the command-line to main instance
Created attachment 240664 [details] [review] EmpathyApp: Use GAction to pass the command-line to main instance
Review of attachment 240664 [details] [review]: ++ for master.
Review of attachment 240659 [details] [review]: ::: src/empathy-accounts.c @@ +142,3 @@ TpAccountManager *account_manager; + empathy_gtk_init (); why did you move this here? It's a bit where to split empathy_init() and empathy_gtk_init().
Review of attachment 240660 [details] [review]: ++
Review of attachment 240659 [details] [review]: ++ ::: src/empathy-accounts.c @@ +142,3 @@ TpAccountManager *account_manager; + empathy_gtk_init (); Ok ignore that, it's explained in another patch :)
Review of attachment 240661 [details] [review]: ::: src/empathy-debugger.c @@ +45,3 @@ } + if (service != NULL && !tp_str_empty (service)) you can remove service != NULL, tp_str_empty() checks it.
Did you check empathy-call as well?
(In reply to comment #21) > Did you check empathy-call as well? Yes, but it's already fine. At least, it uses the GApplication activate, but probably there gtk init will steal the platform data. I can't move gtk initialization, though since clutter needs it, so I'd prefer not change it too much.
Created attachment 240722 [details] [review] EmpathyDebugger-Use-application-activate-and-keep-platform-data.patch
Review of attachment 240722 [details] [review]: ++
Review of attachment 240659 [details] [review]: Pushed!
Review of attachment 240660 [details] [review]: Pushed!
Review of attachment 240722 [details] [review]: Pushed!
Review of attachment 240664 [details] [review]: Pushed!