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 697197 - Empathy ignores the platform-data when activated
Empathy ignores the platform-data when activated
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: General
3.8.x
Other Linux
: Normal major
: ---
Assigned To: Marco Trevisan (Treviño)
empathy-maint
Depends on: 697254
Blocks:
 
 
Reported: 2013-04-03 16:52 UTC by Marco Trevisan (Treviño)
Modified: 2013-04-05 12:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Empathy: Use g_application_activate to pass platform-data to the GtkApplication (3.98 KB, patch)
2013-04-03 16:52 UTC, Marco Trevisan (Treviño)
committed Details | Review
empaty.desktop: enable StartupNotify (809 bytes, patch)
2013-04-04 10:30 UTC, Marco Trevisan (Treviño)
committed Details | Review
EmpatyApp: Use GAction to pass the command-line to main instance (3.03 KB, patch)
2013-04-04 11:49 UTC, Marco Trevisan (Treviño)
reviewed Details | Review
EmpatyApp: Use GAction to pass the command-line to main instance (2.50 KB, patch)
2013-04-04 16:27 UTC, Marco Trevisan (Treviño)
none Details | Review
EmpathyAccounts-use-GApplication-activate.patch (3.25 KB, patch)
2013-04-04 21:09 UTC, Marco Trevisan (Treviño)
committed Details | Review
EmpathyChat-pass-platform-data-when-activating.patch (1.55 KB, patch)
2013-04-04 21:09 UTC, Marco Trevisan (Treviño)
committed Details | Review
EmpathyDebugger-Use-application-activate-and-keep-platform-data.patch (4.09 KB, patch)
2013-04-04 21:10 UTC, Marco Trevisan (Treviño)
reviewed Details | Review
EmpathyApp: Use GAction to pass the command-line to main instance (2.50 KB, patch)
2013-04-04 21:15 UTC, Marco Trevisan (Treviño)
none Details | Review
EmpathyApp: Use GAction to pass the command-line to main instance (2.53 KB, patch)
2013-04-04 21:48 UTC, Marco Trevisan (Treviño)
committed Details | Review
EmpathyDebugger-Use-application-activate-and-keep-platform-data.patch (4.07 KB, patch)
2013-04-05 11:37 UTC, Marco Trevisan (Treviño)
committed Details | Review

Description Marco Trevisan (Treviño) 2013-04-03 16:52:56 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).
Comment 1 Marco Trevisan (Treviño) 2013-04-04 10:30:30 UTC
Created attachment 240579 [details] [review]
empaty.desktop: enable StartupNotify
Comment 2 Marco Trevisan (Treviño) 2013-04-04 11:49:17 UTC
Created attachment 240589 [details] [review]
EmpatyApp: Use GAction to pass the command-line to main instance
Comment 3 Guillaume Desmottes 2013-04-04 15:08:09 UTC
Review of attachment 240504 [details] [review]:

++
Comment 4 Guillaume Desmottes 2013-04-04 15:09:39 UTC
Review of attachment 240579 [details] [review]:

++
Comment 5 Guillaume Desmottes 2013-04-04 15:18:58 UTC
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);".
Comment 6 Guillaume Desmottes 2013-04-04 15:22:47 UTC
(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.
Comment 7 Marco Trevisan (Treviño) 2013-04-04 16:27:32 UTC
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.
Comment 8 Marco Trevisan (Treviño) 2013-04-04 17:15:17 UTC
Review of attachment 240504 [details] [review]:

Pushed!
Comment 9 Marco Trevisan (Treviño) 2013-04-04 17:15:40 UTC
Review of attachment 240579 [details] [review]:

Pushed
Comment 10 Marco Trevisan (Treviño) 2013-04-04 17:16:47 UTC
(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.
Comment 11 Marco Trevisan (Treviño) 2013-04-04 21:09:11 UTC
Created attachment 240659 [details] [review]
EmpathyAccounts-use-GApplication-activate.patch
Comment 12 Marco Trevisan (Treviño) 2013-04-04 21:09:40 UTC
Created attachment 240660 [details] [review]
EmpathyChat-pass-platform-data-when-activating.patch
Comment 13 Marco Trevisan (Treviño) 2013-04-04 21:10:24 UTC
Created attachment 240661 [details] [review]
EmpathyDebugger-Use-application-activate-and-keep-platform-data.patch
Comment 14 Marco Trevisan (Treviño) 2013-04-04 21:15:46 UTC
Created attachment 240662 [details] [review]
EmpathyApp: Use GAction to pass the command-line to main instance
Comment 15 Marco Trevisan (Treviño) 2013-04-04 21:48:39 UTC
Created attachment 240664 [details] [review]
EmpathyApp: Use GAction to pass the command-line to main instance
Comment 16 Guillaume Desmottes 2013-04-05 06:59:15 UTC
Review of attachment 240664 [details] [review]:

++ for master.
Comment 17 Guillaume Desmottes 2013-04-05 07:01:41 UTC
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().
Comment 18 Guillaume Desmottes 2013-04-05 07:02:32 UTC
Review of attachment 240660 [details] [review]:

++
Comment 19 Guillaume Desmottes 2013-04-05 07:03:14 UTC
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 :)
Comment 20 Guillaume Desmottes 2013-04-05 07:04:11 UTC
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.
Comment 21 Guillaume Desmottes 2013-04-05 07:05:00 UTC
Did you check empathy-call as well?
Comment 22 Marco Trevisan (Treviño) 2013-04-05 11:32:26 UTC
(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.
Comment 23 Marco Trevisan (Treviño) 2013-04-05 11:37:05 UTC
Created attachment 240722 [details] [review]
EmpathyDebugger-Use-application-activate-and-keep-platform-data.patch
Comment 24 Guillaume Desmottes 2013-04-05 12:06:38 UTC
Review of attachment 240722 [details] [review]:

++
Comment 25 Marco Trevisan (Treviño) 2013-04-05 12:21:31 UTC
Review of attachment 240659 [details] [review]:

Pushed!
Comment 26 Marco Trevisan (Treviño) 2013-04-05 12:21:42 UTC
Review of attachment 240660 [details] [review]:

Pushed!
Comment 27 Marco Trevisan (Treviño) 2013-04-05 12:22:33 UTC
Review of attachment 240722 [details] [review]:

Pushed!
Comment 28 Marco Trevisan (Treviño) 2013-04-05 12:23:49 UTC
Review of attachment 240664 [details] [review]:

Pushed!
Comment 29 Marco Trevisan (Treviño) 2013-04-05 12:24:23 UTC
Review of attachment 240659 [details] [review]:

Pushed!