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

Throw window to any space across multiple screens. #1209

Merged
merged 6 commits into from
May 7, 2022

Conversation

dozzman
Copy link
Contributor

@dozzman dozzman commented Mar 1, 2022

This PR adjusts the behaviour of throwing windows between spaces such that:

  • You can throw a window to another space by using the space/desktop number visible from Mission Control.
  • Throwing windows between spaces on different screens now works as expected (least surprise, matching XMonad behaviour).

Currently throwing windows between spaces only works between spaces on the same screen. You cannot throw a window to a space belonging to a different screen. This is confusing when managing windows in a multi-screen setup i.e. instead of throwing a window to space X (where X is the Mission Control space number) which exists on screen A directly, you must first throw the window to screen A and then throw it to space X' which is the index of space X local to screen A. It creates more steps when issuing keyboard commands as explained in the example. Its also confusing from the fact that the space numbers shown in Mission Control do not reflect the space numbers used when throwing windows in a multi-screen setup. Finally the current behaviour deviates from the existing XMonad behaviour which allows throwing windows to arbitrary workspaces, regardless of which screen it is currently visible on.

Currently throwing windows to spaces given the space number only works
for a single screen. You cannot throw a window to a space belonging to a
different screen. This is confusing when managing windows in a
multi-screen setup as you need to think about screen numbers locally to
the screen as well as globally across all screens. It creates more steps
when issuing keyboard commands i.e. instead of throwing a window to
space X on which exists on screen A directly, you must first throw the
window to screen A and then throw it to space X' which is the index of
screen X local to screen A. Finally the current behaviour deviates from
the existing XMonad behaviour which allows throwing windows to arbitrary
globally indexed workspaces.
@dozzman
Copy link
Contributor Author

dozzman commented Mar 1, 2022

I think adding this behaviour makes sense but I appreciate it would break the existing behaviour for folks as a result. I think the best thing is to hide the behaviour behind a flag in preferences but I haven't looked into how to do that. I'd appreciate if anyone with experience in modifying the preferences code could make that change.

@dozzman
Copy link
Contributor Author

dozzman commented Mar 1, 2022

I also need to reflow the recipient space as it will not tile correctly if the space is already visible on a screen. Will drop an update shortly.

@dozzman
Copy link
Contributor Author

dozzman commented Mar 1, 2022

I've sorted reflow when moving windows between spaces on different screens.

@ianyh
Copy link
Owner

ianyh commented Mar 12, 2022

Very cool. Much appreciated contribution. I'll think about how it fits into settings.

@ianyh ianyh merged commit 359cd23 into ianyh:development May 7, 2022
ianyh added a commit to reyk/Amethyst that referenced this pull request May 7, 2022
* development:
  Throw window to any space across multiple screens. (ianyh#1209)
  Make TwoPane layout adaptive to screen orientation (ianyh#1182)
  Minor fix (line 69) (ianyh#1230)
  Bump cocoapods-downloader from 1.5.1 to 1.6.3 (ianyh#1226)
  Fix the layout HUD when multiple screen are arranged vertically (ianyh#1162) (ianyh#1163)
  Bump version to 0.15.6 (ianyh#1205)
  Remove errant link (ianyh#1207)
  Replace gitter with GitHub Discussions (ianyh#1206)
  Update Window.swift (ianyh#1203)
  Fix setup.sh so that it correctly checks for rbenv (ianyh#1198)
  add regex suuport to floating windows title matching (ianyh#1166)
  Get the build going (ianyh#1185)
  Fix for move to window to space - ianyh#1174 (ianyh#1184)
  Update cocoapods in Gemfile (ianyh#1159)
  Remove travis file (ianyh#1158)
  Create GitHub Action for running tests (ianyh#1157)
  Add some common macOS agents to ignored list (ianyh#1156)
  Bump addressable from 2.7.0 to 2.8.0 (ianyh#1136)
ianyh added a commit that referenced this pull request May 21, 2022
* development:
  Fix swapping with two windows visible for two-pane layout (#1241)
  Add 4Column layout for ultra-wide screens (#1154)
  Throw window to any space across multiple screens. (#1209)
  Make TwoPane layout adaptive to screen orientation (#1182)
  Minor fix (line 69) (#1230)
  Bump cocoapods-downloader from 1.5.1 to 1.6.3 (#1226)
  Fix the layout HUD when multiple screen are arranged vertically (#1162) (#1163)
@schulzf
Copy link

schulzf commented Jun 17, 2022

this is neat, I just ran the development branch, it makes a world of difference for me
When will this be released @ianyh ?

@zmheiko
Copy link

zmheiko commented Sep 12, 2022

Great! This also fixes issue #856 (closed it).

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

Successfully merging this pull request may close these issues.

4 participants