mate-desktop / atril

A document viewer for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
197 stars 62 forks source link

Multiple atril instances #577

Open braoult opened 1 year ago

braoult commented 1 year ago

For some reasons, if I launch (for example from command-line) twice atril on the same document, the second instance does not open the same document in a new window, but instead the first window is shown.

Expected behaviour

It would be nice to have two windows (or at least to have an option to do so).

Actual behaviour

A document opened a second time activates the first instance window.

Steps to reproduce the behaviour

$ atril foo.pdf &
$ atril foo.pdf &

Atril version: 1.26.0 on Xubuntu 22.10.

Workaround

Launch atril on a copy of the document.

lukefromdc commented 1 year ago

This was most likely an intentional decision made by Evince developers long prior to the MATE fork. Libunique was used to force all invocations to one instance, today GtkApplication is used for that purpose.

braoult commented 1 year ago

This was most likely an intentional decision made by Evince developers long prior to the MATE fork. Libunique was used to force all invocations to one instance, today GtkApplication is used for that purpose.

I am not sure to understand what you say : Launching two atril on different files shows 3 processes: atrild and 2 x atril, and there are two windows. The issue I am referring to is only about opening the same file twice.

lukefromdc commented 1 year ago

Did some digging and some testing Commit 15073fb029c8fc78d7184be7bc0e70d4cbe5ac1b ports atril from libunique to GtkApplication, both of these are normally used to confine all threads and windows of a process to a single process. Note that GtkApplication can be deliberately set to allow multiple instances and on testing it appears this was done, as on opening two different files I get two instances of atril listed in mate-system-monitor.

Thus I do not know what is going on in your case