Re: Problems with GApplicationCommanLine printing to wrong instance



On 27 May 2016 at 23:48, Christian Stadelmann
<chris privat genodeftest de> wrote:
Hi

I have a trivial application (see below). I expect it to print "Foo" on
the first instance it is running and "Second" on each successive
instance.

Instead, only the first instance is printing stuff and the second
doesn't do anything before it exits.

Am I doing something wrong? Or did I run into a bug?


You appear to have missed some of the documentation on GioApplication.

Quoting from the relevant sections

"Another feature that Gio.Application (optionally) provides is process
uniqueness. Applications can make use of this functionality by
providing a unique application ID. If given, only one application with
this ID can be running at a time per session."

and

"The ::command-line signal is emitted on the primary instance when a
commandline is not handled locally."

Since you are providing an applciation ID ("org.test"), and the only
command-line handling is in the "command-line" signal handler,
everything looks like it behaving as documented to me.

-- 
Neil Muller
drnlmuller gmail com

I've got a gmail account. Why haven't I become cool?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]