You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All major platforms now support workspaces (virtual desktops), we should probably add a set of workspace related API, so it can:
get the workspace of window;
list available workspaces;
choose which workspace to put the new window;
move windows between workspaces.
Reacted by Josh Olson, Steffen Bruchmann, Samuel Attard, Andrea Parodi, zakaria ridouh, Dave Jeffery, Sergey Sova, Neko Hz, Kevin Sawicki, lawnzapper and 148 more
Reacted by Alec Armbruster, Felix Binder, molikto, Denis Loginov, Johannes Sattler, S V, sgilflores3, hansol, park and Rome Abuziarov
Reacted by Mihai Codoban, limichange, joaomlemos, Alec Armbruster, molikto, Denis Loginov, Johannes Sattler, S V, Gavin Wood, hansol, park and 2 more
On windows 10 (creators update), a new window I opened (not the main window), also is present on all virtual windows desktops when always on top is set. This might be a windows issue of course, but should be tested when more control is made possible
How is going this issue ? There are still problems on atom which uses electron: each time we open a new atom window, it is created on the previous atom window's worspace instead of the current workspace. It seems this issue is needed for them to fix that problem.
I managed to solve this with a workaround for my specific case where I need to open/move my app on my current workspace. ( tested on macOs High Sierra, electron 1.7.9)
Just set window visible in all workspaces, then show it, then set visible on all workspaces back as false
The behaviour where one opens an Electron app in one Desktop (in macOS), then goes into another desktop, the app calls the window.show() and the user is brought to the Desktop where the app is running, does not happen on Windows 10.
Is it impossible to that now, or is there a workaround for this?
So on macOS, the workspaces related APIs are private, using them would get the apps rejected by App Store. Of course not every app goes to App Store, but still due to this we are very unlikely to provide workspace APIs in Electron until Apple provides public APIs.
@codebytere to clarify, there is no error as far as I can tell. The ask here is how would an Electron application that supports multiple windows be able to restore the windows to their OS spaces/workspaces after a restart? We restore window locations on screen and sizes because we can get that information from Electron, but as far as I can tell, I cannot figure out which workspaces where setup and how to restore them.
This could be as simple as having every window expose a workspaceID string or something for the workspace it is on. We can figure out how to work with that for our apps, but please do give us something to work with.
Activity
matthiasg commentedon Apr 9, 2017
On windows 10 (creators update), a new window I opened (not the main window), also is present on all virtual windows desktops when always on top is set. This might be a windows issue of course, but should be tested when more control is made possible
pelallemant commentedon Feb 5, 2018
Hello.
How is going this issue ? There are still problems on atom which uses electron: each time we open a new atom window, it is created on the previous atom window's worspace instead of the current workspace. It seems this issue is needed for them to fix that problem.
lawnzapper commentedon Feb 28, 2018
I managed to solve this with a workaround for my specific case where I need to open/move my app on my current workspace. ( tested on macOs High Sierra, electron 1.7.9)
Just set window visible in all workspaces, then show it, then set visible on all workspaces back as false
andrew-morris-orbis commentedon Mar 14, 2018
@lawnzapper sounds like you meant:
lawnzapper commentedon Mar 14, 2018
@andrew-morris-orbis oh yeah sorry!
spoike commentedon Mar 27, 2018
@lawnzapper's method doesn't work when you're opening the window while on a fullscreen app in macOS High Sierra.
kasper9n commentedon Jul 2, 2019
@zcbenz It would also be nice to fire an event when the user switches to a different workspace. Maybe add that to your issue description?
In my scenario, I'd like to hide a window whenever the user switches workspace.
RoderickQiu commentedon Apr 1, 2020
So is this feature still being working around on Windows as Microsoft truly has related APIs?
rpsfonseca commentedon Apr 24, 2020
The behaviour where one opens an Electron app in one Desktop (in macOS), then goes into another desktop, the app calls the
window.show()and the user is brought to the Desktop where the app is running, does not happen on Windows 10.Is it impossible to that now, or is there a workaround for this?
joaomlemos commentedon Jul 20, 2020
@rpsfonseca - I think you're looking for a workaround like this #5362 (comment)
zcbenz commentedon Nov 18, 2020
So on macOS, the workspaces related APIs are private, using them would get the apps rejected by App Store. Of course not every app goes to App Store, but still due to this we are very unlikely to provide workspace APIs in Electron until Apple provides public APIs.
dinvlad commentedon Dec 1, 2021
Any updates on this for Windows?
xgdgsc commentedon Jun 16, 2022
Why not just provide empty functions on macOS and add them later if Apple provide the API? Please support the majority of users first.
UlyssesZh commentedon Sep 22, 2022
Any updates on this for Linux desktops?
gavofyork commentedon Mar 3, 2023
Any updates on this for OS X?
bpasero commentedon Oct 11, 2023
Currently VS Code cannot properly restore OS workspace layouts for windows on any platform. Users have to reconfigure workspaces after restart.
fyi @codebytere
codebytere commentedon Oct 11, 2023
@bpasero when did this start? is there an error message or other information you're seeing when this happens?
bpasero commentedon Oct 11, 2023
@codebytere to clarify, there is no error as far as I can tell. The ask here is how would an Electron application that supports multiple windows be able to restore the windows to their OS spaces/workspaces after a restart? We restore window locations on screen and sizes because we can get that information from Electron, but as far as I can tell, I cannot figure out which workspaces where setup and how to restore them.
Mugane commentedon Feb 1, 2024
8 years. EIGHT. YEARS.
yangm97 commentedon Feb 21, 2024
🎂🥳🥳🥳
gdamiaN538 commentedon Feb 29, 2024
sami-azzam commentedon Apr 8, 2024
Can someone please take a look at this?
vojtabohm commentedon Jul 17, 2024
Is this abandoned completely or?
gushogg-blake commentedon Aug 20, 2024
Solution for Linux: https://gushogg-blake.com/p/blog-linux-electron-open-new-window-if-none-in-current-workspace/
iyobo commentedon Aug 20, 2024
This could be as simple as having every window expose a
workspaceIDstring or something for the workspace it is on. We can figure out how to work with that for our apps, but please do give us something to work with.Thanks 🙏
winetree94 commentedon Oct 24, 2024
here's my solutions
For bringing a window from another Virtual Desktop to the current Virtual Desktop in Windows:
For bringing a window from another Workspace to the current Workspace in macOS: