JonnyHaystack / i3-resurrect

Simple solution to saving and restoring i3 workspaces
GNU General Public License v3.0
369 stars 18 forks source link

Windows get left behind when restoring programs for workspace that is not yet focused #40

Closed JonnyHaystack closed 4 years ago

JonnyHaystack commented 4 years ago

Describe the bug Say you are on workspace 1 and you execute i3-resurrect restore -w 2 --programs-only, sometimes one or more program windows may get launched on workspace 1 instead of workspace 2.

I believe this is because the launching of programs with python's subprocess module is not synchronous with the workspace switching using i3.command(f'workspace --no-auto-back-and-forth {workspace}'). I'm experimenting right now using i3's exec command to launch programs instead and that seems to work, although unfortunately I have to do some slightly hacky things to make it work right..

To Reproduce Described above.

Expected behavior All programs should be launched on the workspace whose programs you are restoring.

System information (please complete the following information):