Score:2

How to prevent Gedit from opening a launched file in an instance on another workspace

in flag

Using Ubuntu 21.04 with pure Gnome Shell 3.38.

Consider this example scenario: I have 2 workspaces open, workspace-1 and workspace-2. In workspace-2, the Gedit app is open. In workspace-1, the Gedit app is not open.

While in workspace-1, I enter Nautilus app and double-click on a saved Gedit text file. Gedit opens the file but auto-moves to workspace-2 to present the opened file. WTHeck! Why isn't it opening Gedit in the workspace I am in? What is the point of workspaces if you can't create the stuff you want to work with in that workspace?

Terrance avatar
id flag
Sounds like it might be a bug in 21.04. I am using GNOME 3.36 in 20.04 and I can't seem to duplicate your issue.
Terrance avatar
id flag
@vanadium Well, if it is not a bug, then it would be useful for the OP to file one anyways for a feature if this cannot be done in the newer version.
vanadium avatar
cn flag
@Terrance Interesting! Indeed, in 20.04, it behaves differently, the way you describe and the OP wants!
vanadium avatar
cn flag
Not a bug, but how it works/is designed: by default the new file is opened in an existing instance. Still, I agree that for users who which to separate workspaces it is desired to have a new window opened in the current workspace. There might be tricks to change that behaviour, so useful question indeed!
vanadium avatar
cn flag
Interesting answer here, likely pinpointing where this behaviour may have been changed in recent gedit versions: https://askubuntu.com/questions/75671/why-does-gedit-keep-randomly-opening-new-instances-when-opening-files-from-nauti?rq=1
raj avatar
cn flag
raj
Did you try `gedit --new-window filename.txt` or `gedit -s filename.txt` ?
Davide Sangalli avatar
ng flag
`gedit --new-window filename` does open in a new window, but this is not the expected behaviour. The behaviour should be "new-window" *if* "there is not another open window in the present workspace". If it is not a bug, it is a very bad design.
Davide Sangalli avatar
ng flag
This gnome shell extension apparently could do the job: https://micheleg.github.io/dash-to-dock/ However, the option "isolate workspaces" is not available in ubuntu 22.04 and reports `Managed by GNOME Multitasking's application switcher`. However under `Settings --> Multitasking` there is not an option to isolate workspaces ...
Score:0
us flag

This behaviour has been added with the migration to Wayland only, instead of keeping support for X11, as discussed here.

But because this has been bugging me too, and I still use X11, I reverted the commits in question: Similar as here explained, you need to revert commits C1, C2 and finally, most importantly C3.

My patchfile for Gedit 40.1 you can find in my Gentoo overlay.

Davide Sangalli avatar
ng flag
Same issue here. Ubuntu 22.04, gedit 41.0. Even if I set <pre>gsettings set org.gnome.gedit.preferences.ui show-tabs-mode 'never'</pre> the new window opens in the other worskapce. gedit -s filename works. But it is not a solution in my opinione.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.