GNOME Bugzilla – Bug 770749
Fix launching through mission-control
Last modified: 2016-10-19 17:00:48 UTC
We have been registering Polari as a (potential) channel handler for some time, but in the unlikely case that mission-control wants to handle us a channel while we're not running, we don't start the actual telepathy client and the request times out. Fixing this isn't terribly important - after all, nobody has noticed the issue so far - but it gets us one step closer to running polari in the background, which is a feature we want to offer.
Created attachment 334637 [details] [review] app: Stop using a private property to track the main window We will eventually allow running without open windows, and possibly with multiple windows as well, at which point using a private property to track the main window gets in the way more than it helps, so adapt the code to either use the :active-window or iterate over all windows as appropriate.
Created attachment 334638 [details] [review] telepathyClient: Hold application while running The application runtime is currently tied to having a window, however it can be useful to have only the telepathy client running in the background. In order to support this, hold the application while the client is running.
Created attachment 334639 [details] [review] app: Factor out 'start-client' action The telepathy client is currently started if necessary when the application is activated. However as there are cases for running the client without activating the application (read: creating a window), it makes sense to split out the code. While for now a separate function would do just fine, we'll eventually want the functionality available even when Polari is not running, so add a corresponding action.
Created attachment 334640 [details] [review] data: Fix telepathy client service We register Polari as a Telepathy client so mission-control can launch us to handle channel requests even when not running. However as the specified command does not actually start the telepathy client, the request will fail after a timeout in this case. Fix this by exposing the newly-added 'start-client' action on the command line and use it to launch the telepathy service.
Review of attachment 334637 [details] [review]: looks good to me.
Review of attachment 334638 [details] [review]: looks good to me.
Review of attachment 334639 [details] [review]: looks good to me.
Review of attachment 334640 [details] [review]: looks good to me.
Review of attachment 334640 [details] [review]: ::: src/application.js @@ +35,3 @@ + this.add_main_option('start-client', 0, + GLib.OptionFlags.NONE, GLib.OptionArg.NONE, + _("Start Telephathy client"), null); Note that this breaks the string freeze, unless we (temporarily) remove the gettext call. Not a big deal considering that this would only affect the --help output on the command line, but as this patch set mainly prepares for the background feature in bug 770750 (which is clearly 3.24 material), I'm not sure it's worth landing now anyway ...
Attachment 334637 [details] pushed as 40dd975 - app: Stop using a private property to track the main window Attachment 334638 [details] pushed as fbef7a7 - telepathyClient: Hold application while running Attachment 334639 [details] pushed as 80d8fd0 - app: Factor out 'start-client' action Attachment 334640 [details] pushed as a513364 - data: Fix telepathy client service
*** Bug 773226 has been marked as a duplicate of this bug. ***