On Thu, 07 Oct 2010 19:04:04 +0200
Colomban Wendling <[email protected]> wrote:

> 2) When trying to open a file on a running instance, ask its workspace
> before actually sending the commands. This needs to list existing
> sockets and add a way to communicate the workspace through it. But then,
> this would look like:
>       socket = None
>       for s in socket_list:
>               if s.workspace == current_workspace:
>                       socket = s
>                       break
>       if socket is not None:
>               socket.send_command(...)
>       else:
>               open_new_instance()

Now that's a good suggestion IMHO. :)

Supposing there will be a preference or command line option
open_on_same_desktop:

        workspace = INT_MAX
        socket = None
        for s in socket_list:
                if abs(s.workspace - current_workspace) < workspace -
current_workspace:
                        socket = s
                        workspace = s.workspace
                        if workspace == current_workspace:
                                break

        if socket is None || (open_on_same_desktop && workspace !=
current_workspace:
                load_default_session = socket is None
                open_new_instance()
                return

        ...continue with socket.c "now we send the command line args"

(Of course, this only takes place if no --socket-name is specified.)

-- 
E-gards: Jimmy
_______________________________________________
Geany-devel mailing list
[email protected]
http://lists.uvena.de/cgi-bin/mailman/listinfo/geany-devel

Reply via email to