Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work well with workspaces #600

Open
ghost opened this issue Nov 17, 2022 · 6 comments
Open

Does not work well with workspaces #600

ghost opened this issue Nov 17, 2022 · 6 comments

Comments

@ghost
Copy link

ghost commented Nov 17, 2022

Using retext 8.0.0 under Linux Mint 21 Cinnamon with Nemo 5.4.3.

Retext does not work well with Cinnamon workspaces.

If I open file a.md in workspace 1, then go into workspace 2 and enter retext b.md on the command line, I get a message Opening the file(s) in the existing window of ReText., but in fact the file is not opened at all.

If I double click on the b.md icon in a Nemo window in workspace 2, the file is silently opened in the existing window in workspace 1. The result is that nothing appears to happen at all until I switch back to workspace 1 and find the file open there.

On the other hand if I start Retext either from the command line or the panel menu in workspace 2, it opens a new empty window in workspace 2.

My preference is that opening b.md in workspace 2, either on the command line or from Nemo, should cause it to open in a new window in workspace 2.

@mitya57
Copy link
Member

mitya57 commented Dec 18, 2022

Workspaces are implementation detail of the window manager that you use. The application does not know which workspace it's open in, and whether the other window is opened on the same workspace or not (at least in X11).

However, I just tried your scenario in GNOME Flashback (Metacity) and GNOME Shell.

  • With Metacity, when you open a file in a different workspace environment, it shows you a new item on the panel and highlights it, and when you click it, it brings you to the first workspace where ReText is open:
    Screenshot from 2022-12-18 20-13-49
  • With GNOME Shell, it shows a pop-up message like in this screenshot. When you click it, it also brings it to the first workspace.
    Screenshot from 2022-12-18 20-10-21

To me, this behavior makes sense. If it does not work in Cinnamon, it means that Cinnamon does not have a feature for notifying you about window being ready in another workspace.

If you want to open a file in a new window, you have the following options:

  • Open a new ReText window and then open a file from it.
  • Use the --new-window command line option.
  • Set openFilesInExistingWindow=false in the configuration file (see configuration.md for details).

@ghost
Copy link
Author

ghost commented Dec 18, 2022

  • It is not only that sometimes it opens in another workspace with no indication. Sometimes it fails to open at all:

If I open file a.md in workspace 1, then go into workspace 2 and enter retext b.md on the command line, I get a message Opening the file(s) in the existing window of ReText., but in fact the file is not opened at all.

  • Behavior in Cinnamon can be made better. For example see Google Chrome. If I have Chrome open in workspace 1, then go into workspace 2 and either double click on an HTML file or enter google-chrome file.html on the command line, the HTML file is opened in the window in workspace 1 and Cinnamon focus changes to that window in that workspace.

@mitya57
Copy link
Member

mitya57 commented Dec 18, 2022

If I open file a.md in workspace 1, then go into workspace 2 and enter retext b.md on the command line, I get a message Opening the file(s) in the existing window of ReText., but in fact the file is not opened at all.

This is weird and shouldn't happen. Can you launch the first ReText instance from terminal and see if it prints something at that moment?

Also, you say ‘sometimes’, but when exactly? I cannot reproduce it, maybe there is some specific step that I should do?

If I have Chrome open in workspace 1, then go into workspace 2 and either double click on an HTML file or enter google-chrome file.html on the command line, the HTML file is opened in the window in workspace 1 and Cinnamon focus changes to that window in that workspace.

This is your issue #601. I tried to look how Chrome does it, but the code is too complicated.

@ghost
Copy link
Author

ghost commented Dec 18, 2022

This is weird and shouldn't happen. Can you launch the first ReText instance from terminal and see if it prints something at that moment?

Unsupported return type 4097 QPixmap in method "grab"
Unsupported return type 4097 QPixmap in method "grab"

but see below.

Also, you say ‘sometimes’, but when exactly?

Always, if the second file is opened from the command line. But not if it is double clicked in Cinnamon. However the above "Unsupported return type" error appears (twice) in either case, so seems not to be relevant to the issue.

@mitya57
Copy link
Member

mitya57 commented Dec 21, 2022

Unsupported return type 4097 QPixmap in method "grab"
Unsupported return type 4097 QPixmap in method "grab"

I think this can be safely ignored. When we want to open a file in another ReText window, we use org.qtproject.Qt.QWidget interface, and the introspection code tries to generate an XML with all available methods. One of the methods, QWidget::grab, returns an unsupported type, so it's not included in the XML. But we don't need it.

Always, if the second file is opened from the command line. But not if it is double clicked in Cinnamon. However the above "Unsupported return type" error appears (twice) in either case, so seems not to be relevant to the issue.

It is probably issue #594, which is already fixed in master (commit 6f6e5f3). As a workaround, you can pass an absolute path.

@ghost
Copy link
Author

ghost commented Dec 21, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant