-
-
Notifications
You must be signed in to change notification settings - Fork 987
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
Some way to disallow windows to render in a different workspace while being animated #8349
Comments
maybe you can check if the workspace is visible instead? I am not sure I understand what you mean here exactly |
Yes, I may have not explained myself very well. I am going to try to go step by step: There is a function,
I want to consider the difference in state from two windows:
When there is no animation, both windows are treated correctly, hyprscroller's will be clipped correctly to WAYLAND-1, and Hyprland's animating window will be shown where it corresponds. None of the windows reach the last Now we consider when these two windows are animated, hyprscroller's maybe because there was a change of focus; Hyprland's because it is moving from one workspace to the other. They both reach the last const CBox monitorBox = {pMonitor->vecPosition, pMonitor->vecSize};
if (!windowBox.intersection(monitorBox).empty())
return true;
I also checked if any of these flags were set when a window was being animated
So none of those other flags help with discerning if a window is genuinely being animated. Both cases show exactly the same state. To fix hyprscroller, I changed the last const CBox monitorBox = {pMonitor->vecPosition, pMonitor->vecSize};
if (!windowBox.intersection(monitorBox).empty() && pWindow->workspaceID() == pMonitor->activeWorkspaceID())
return true; but that of course only shows Hyprland's window in the destination workspace, not rendering it in the workspace from which it's moving...so...fail! And here is when I ask for your opinion:
@vaxerski: Thanks a lot for staying on top of things and helping out. |
Nope.
hm, no, dont think so. What if you just
animatingIn = opening |
None of the two windows are floating, so it will render the hyprscroller window correctly, but it still won't show Hyprland's window in WAYLAND-2, only in WAYLAND-1. Hyprland's window is not floating, just animating its transition from WAYLAND-2 (workspace 2) to WAYLAND-1 (workspace 1). |
maybe set |
OK, #8359 seems to fix it. While a window is moving, its |
Description
The logic to decide whether a window should render for a certain monitor is in
shouldRenderWindow()
For windows being animated, if the window's bounding box touches the extents of the monitor, they will be rendered (last
if
statement. This is to be able to see the animation of a window moving from one workspace to another.This is OK for tiled windows, because they will never have any part outside of their monitor.
However, this creates an unwanted side-effect for cases where windows can exist outside of the monitor extents, but only belong to a workspace. In my plugin hyprscroller, there is an infinite canvas for each workspace. When a window is being animated (focus change, for example), if a part of it overlaps a different monitor, it will be rendered there, creating a very inconvenient glitch for the length of the animation.
I have tried to modify the logic of
CHyprRender::shouldRenderWindow()
and add an extra check in the lastif
statement to verify the monitor's workspace is the same as the window's.But this introduces a problem: windows that are traversing the monitor because of an animation (moved, etc), will not be rendered in that monitor, only in the receiving one.
So I am stuck and think maybe there is a need for some other flag or field that defines when a window is being animated and needs to be shown or not. I tried to use
m_iMonitorMovedFrom
andm_bAnimatingIn
, but they seems to be for other purposes and were not being set for those animated windows that needed to be rendered.The text was updated successfully, but these errors were encountered: