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

feat: add a new dispatcher that can move windows in and out of groups, or swap windows #3006

Merged
merged 21 commits into from
Sep 10, 2023

Conversation

memchr
Copy link
Contributor

@memchr memchr commented Aug 17, 2023

[Breaking change] Add a new dispatcher movewindoworgroup that implements the behaviour of moveintowindow, swapwindow and moveoutofwindow.

Partial implementation of #2851

Beehaviour

active window window in direction default / ignore group lock implemented notes
group group moveIntoGroup ✔️ Because the direction of moveoutofgroup is not currently controllable, new dispatcher will not behave as moveOutOfGroup until directional control is implemented
group locked group moveWindowTo / moveIntoGroup ✔️
window group moveIntoGroup ✔️
group / group locked / window group locked moveWindowTo / moveIntoGroup ✔️
group window moveOutOfGroup ✔️
group locked window moveWindowTo / moveOutOfGroup ✔️
window window moveWindowTo ✔️
group null moveOutOfGroup ✔️ By default, the window retains its floating state for consistency. The name of a possible configuration flag is up for discussion.
group locked null no-op / moveOutOfGroup ✔️
window null no-op ✔️

legend:

  • group: The window is in a group.
  • group locked: m_sGroupData.pNextWindow is true.
  • window: The window is not in a group.
  • null: No window in direction

NOTE:

  • Window in direction is not null implies active window is not floating.
  • Alternative behaviour is toggled via binds:ignore_group_lock

TODO:

  • Give the dispatcher a meaningful name.
  • Give configuration variable a meaningful name.
  • moveWindowOutOfGroup: Make call to focusWindow configurable.
  • Remove debug logging in the dispatcher when PR is complete.
  • Implement alternative behaviour.
  • Toggle group lock checking using setignoregrouplock dispatcher

Other Changes

  • Move the behaviour code of moveIntoGroup and moveOutOfGroup to standalone functions.
  • Call g_pCompositor->focusWindow in moveWindowOutOfGroup.
  • Fix moveintogroup locking check.
  • Remove moveintogroup_lock_check, moveintogroup will check binds:ignore_group_lock instead
  • misc:group_focus_removed_window

@memchr memchr force-pushed the feat_2851 branch 6 times, most recently from ee38dda to b306b52 Compare August 17, 2023 10:49
@memchr memchr changed the title [WIP] feat: add a new dispatcher that can move windows in and out of groups, or swap windows feat: add a new dispatcher that can move windows in and out of groups, or swap windows Aug 17, 2023
@memchr memchr marked this pull request as ready for review August 17, 2023 15:29
@vaxerski
Copy link
Member

request my review when ready

@memchr
Copy link
Contributor Author

memchr commented Aug 21, 2023

request my review when ready

PR is ready for review (I removed the draft status 3 days ago). However, I would not be able to respond until around 6 UTC tomorrow.

side notes:

  • IIRC, Github doesn't allow non-collaborators to request reviews.

@vaxerski
Copy link
Member

IIRC, Github doesn't allow non-collaborators to request reviews.

didn't know that? I've had a review requested from me a buncha times, iirc.

However, I would not be able to respond until around 6 UTC tomorrow.

Just because I reply within minutes if awake doesnt mean you have to. No pressure, lol

@memchr
Copy link
Contributor Author

memchr commented Aug 21, 2023

didn't know that? I've had a review requested from me a buncha times, iirc

¿¿, I think its on the docs.

Pull request authors can't request reviews unless they are either a repository owner or collaborator with write access to the repository

src/managers/KeybindManager.cpp Show resolved Hide resolved
src/managers/KeybindManager.cpp Outdated Show resolved Hide resolved
src/config/ConfigManager.cpp Show resolved Hide resolved
@memchr
Copy link
Contributor Author

memchr commented Sep 9, 2023

All right, I'm going to ask for another round of review. I hope this is not very discourteous.
@vaxerski

@vaxerski
Copy link
Member

fix the conflict and then request my review :)

@memchr
Copy link
Contributor Author

memchr commented Sep 10, 2023

Conflict with #3229 resolved, ready.

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just needs a wiki mr.

@vaxerski vaxerski merged commit ac2f1a9 into hyprwm:main Sep 10, 2023
8 checks passed
memchr added a commit to memchr/Hyprland that referenced this pull request Sep 12, 2023
In addition:

- Implement directional moveWindowOutOfGroup for `movewindoworgroup`
  when using dwindle layout. (augmentation of hyprwm#3006)
- Replace `DWindleLayout::OneTimeFocus` with `IHyprLayout::eDirection`.
- Slight formatting change (clang-format).
vaxerski pushed a commit that referenced this pull request Sep 13, 2023
* feat(layout): add direction parameter to onWindowCreated and friends

In addition:

- Implement directional moveWindowOutOfGroup for `movewindoworgroup`
  when using dwindle layout. (augmentation of #3006)
- Replace `DWindleLayout::OneTimeFocus` with `IHyprLayout::eDirection`.
- Slight formatting change (clang-format).

* fix: nullptr dereference in dwindle window creation

* refactor: generalized eDirection

* refactor: eliminate DIRECTION_NONE

* Update IHyprLayout.hpp
thejch pushed a commit to thejch/Hyprland that referenced this pull request Sep 13, 2023
…m#3269)

* feat(layout): add direction parameter to onWindowCreated and friends

In addition:

- Implement directional moveWindowOutOfGroup for `movewindoworgroup`
  when using dwindle layout. (augmentation of hyprwm#3006)
- Replace `DWindleLayout::OneTimeFocus` with `IHyprLayout::eDirection`.
- Slight formatting change (clang-format).

* fix: nullptr dereference in dwindle window creation

* refactor: generalized eDirection

* refactor: eliminate DIRECTION_NONE

* Update IHyprLayout.hpp
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.

None yet

2 participants