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

add on-screen constraint to wrv2 'move' #3247

Merged
merged 4 commits into from
Sep 12, 2023

Conversation

alaricljs
Copy link
Contributor

Implements an onscreen directive to windowsrulev2 move that causes the window to be fully on the screen (if it is not too large).

My usage for this is:
windowrulev2 = move onscreen cursor -50% -50%,floating:1,class:^(xfce4-terminal|kitty)$
This will place my terminals centered under the mouse unless it's toward the edge of the screen where they will be nudged to remain fully within the screen.

For too-large windows, the bottom right corner is forced onto the screen. It could be top left with additional code.

Ready for merge.

src/events/Windows.cpp Outdated Show resolved Hide resolved
src/events/Windows.cpp Outdated Show resolved Hide resolved
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.

gangsta

@vaxerski vaxerski merged commit 9192b20 into hyprwm:main Sep 12, 2023
8 of 9 checks passed
thejch pushed a commit to thejch/Hyprland that referenced this pull request Sep 13, 2023
* add on-screen constraint to wrv2 'move'

* review changes

* std::clamp

* more parens

---------

Co-authored-by: Leeman <lstrout@enlj.com>
@alaricljs
Copy link
Contributor Author

@vaxerski anything I need to do to get the last check (wlroots buld) to pass so this actually lands?

@vaxerski
Copy link
Member

this is merged

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