flathub / net.codeindustry.MasterPDFEditor

https://flathub.org/apps/details/net.codeindustry.MasterPDFEditor
0 stars 4 forks source link

Files opened as new windows instead of opening in a tab #16

Closed kuang-da closed 3 years ago

kuang-da commented 3 years ago

Hi,

I noticed that the MasterPDF could not open a file in the new tab even though I have checked the corresponding entry in the setting page and restarted the software as follows.

image

It seems that WPS has a similar issue but not sure whether there are similar problems under the hood.

Maybe I should tweak the flatseal? But I am not sure which knob shall I touch.

Any advice on this? Thank you very much!

raffaem commented 3 years ago

I was going to ask the same.

I have the exact same issue.

What may be the cause of this behaviour?

muelli commented 3 years ago

Maybe a socket that cannot be found. I guess it leaves the socket somewhere and, when a new instance starts, it checks whether the socket exists in the well-known path. A popular locations is /tmp/ which, by default, is not shared among multiple instances.

hfiguiere commented 3 years ago

usually there is a --env=TMPDIR=/var/tmp to make this work with Qt apps. Not sure if that would work in that case, but it's clearly not there.

kuang-da commented 3 years ago

For me, I switched to .deb installation and it works. But still curious about how to fix it under Flathub.

muelli commented 3 years ago

At least there is a socket in /tmp/:

[📦 net.codeindustry.MasterPDFEditor ~]$ ls -la /tmp/
total 0
drwxr-xr-x  3 muelli muelli 100 Mai 14 13:19 .
drwxr-xr-x 12 muelli muelli 340 Mai 14 13:19 ..
srwxr-xr-x  1 muelli muelli   0 Mai 14 13:19 mastersingleapp-master-534c-3e8
-rw-r--r--  1 muelli muelli   0 Mai 14 13:19 mastersingleapp-master-534c-3e8-lockfile
drwxr-xr-x  2 muelli muelli  60 Mai 14 13:19 .X11-unix
[📦 net.codeindustry.MasterPDFEditor ~]$ 

so yeah, overriding TMPDIR could work well. Best to specify an application specific directory to not leak other data into the app.

raffaem commented 3 years ago

So what's the fix for this?

muelli commented 3 years ago

you can try to run with --env=TMPDIR=/var/tmp

raffaem commented 3 years ago

I have added that to /var/lib/flatpak/app/net.codeindustry.MasterPDFEditor/current/active/export/share/applications/net.codeindustry.MasterPDFEditor.desktop but now MasterPDF doesn't run at all.

Here is the content of the file now:

[Desktop Entry]
Name=Master PDF Editor 5
Comment=Edit PDF files
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=masterpdfeditor5 --file-forwarding net.codeindustry.MasterPDFEditor --env=TMPDIR=/var/tmp @@ %f @@
Terminal=false
Icon=net.codeindustry.MasterPDFEditor
Type=Application
Categories=Office;Graphics;
MimeType=application/pdf;application/x-bzpdf;application/x-gzpdf;
X-Flatpak=net.codeindustry.MasterPDFEditor
hfiguiere commented 3 years ago

you shouldn't be editing the .desktop. I believe the command doesn't work as it doesn't expect --env= where you put it.

Use Flatseal instead to change that kind of parameter. https://flathub.org/apps/details/com.github.tchx84.Flatseal

raffaem commented 3 years ago

you shouldn't be editing the .desktop. I believe the command doesn't work as it doesn't expect --env= where you put it.

Use Flatseal instead to change that kind of parameter. https://flathub.org/apps/details/com.github.tchx84.Flatseal

It works! Thank you :)

Can we put that in the YAML file under `finish-args:'?