GtkApplication handling command line



hi, folks. I'm trying to port vinagre from old gtkapplication to the new
implementation, based on totem code. there's an issue (totem is affected
too).

if I create the app object with HANDLE_COMMAND_LINE flag, the command
line will always be passed to the primary instance.

We (totem, vinagre and others) are using GOptionContext to parse command
line arguments. So, if the user has already totem running, open a
terminal and type 'totem --help', this will be passed to the primary
instance, which will output the help and exit the program.

Try yourself by running totem master. The code is here:
http://git.gnome.org/browse/totem/tree/src/totem.c

so, what should we do to handle this case? We want to parse things like
'--help' locally, but the rest we want to pass to the primary instance -
and we want to use GOptionContext.

Perhaps we can do something by subclassing gtkapplication and
overwriting local_command_line method, and do some workaround to still
be able to use GOptionContext both local and remotely.

As this is a typical use case in gnome applications, we should have a
better/easier way to integrate gtkapplication and goptioncontext, agree?

cheers,
-- 
Jonh Wendell
http://www.bani.com.br



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