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

window: move size reporting to animation begin callback #9298

Merged
merged 5 commits into from
Feb 6, 2025

Conversation

PaideiaDilemma
Copy link
Contributor

@PaideiaDilemma PaideiaDilemma commented Feb 2, 2025

Describe your PR, what does it fix/add?

Made so many mistakes in the animation PR...
I removed this from tick when playing around with damage:

// set size and pos if valid, but only if damage policy entire (dont if border for example)
if (validMapped(PWINDOW) && av->m_eDamagePolicy == AVARDAMAGE_ENTIRE && !PWINDOW->isX11OverrideRedirect())
    g_pXWaylandManager->setWindowSize(PWINDOW, PWINDOW->m_vRealSize.goal());

Had the intention to move that to a update callback for the window size, except - well - I didn't.
Worst thing about this is that some xwayland changes probably were only made because this was missing. Sorry for that.
I will go though other size/position related changes since and check if they are redundant tomorrow.

Closes #9269
Closes #9256
Closes #9279

CC @nnyyxxxx wanna verify that it fixes #9256? ✔️

Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

atlauncher import window still works ^^

Is it ready for merging, or does it need work?

Ready.

@nnyyxxxx
Copy link
Contributor

nnyyxxxx commented Feb 2, 2025

sure

@nnyyxxxx
Copy link
Contributor

nnyyxxxx commented Feb 2, 2025

fixed both issues but has minor visual glitches

@PaideiaDilemma
Copy link
Contributor Author

wanna post a vid of the gitches?

@nnyyxxxx
Copy link
Contributor

nnyyxxxx commented Feb 2, 2025

just disregard that, most instant window resizing in hyprland does have visual glitches.

For instance have a browser open alone (very sad) in one workspace and then open a terminal. The browser will have weird behaviour when adjusting. this is probably normal

Remove the size argument from sendWindowSize, since it is now a member of the Window class
and we don't want any mismatches between m_vRealSize and what we report.

Remove sendWindowSize from mapWindow, since we shouldn't need it.
@nnyyxxxx
Copy link
Contributor

nnyyxxxx commented Feb 3, 2025

what happened?

@PaideiaDilemma
Copy link
Contributor Author

I am trying out jujutsu and pushed the wrong bookmark after a rebase. Leaving my main to be in sync with Hyprland main and that seems to autoclose a PR ^^

@PaideiaDilemma PaideiaDilemma reopened this Feb 3, 2025
@nnyyxxxx
Copy link
Contributor

nnyyxxxx commented Feb 5, 2025

this is finished right?

@PaideiaDilemma
Copy link
Contributor Author

PaideiaDilemma commented Feb 5, 2025

Ok so in the latest commit i moved most of the sendWindowSize calls to the animation begin update. (Also gets called when animations are disabled)

I think that makes sense because

  • the animation begin corresponds to actual visual size changes
  • it is easier to maintain

Caveats:

  • setValueAndWarp does NOT trigger the animation begin cb. If size updates should still be sent, call it afterwards (like on window drag resizes without animations)
  • position updates don't use the same mechanism, but sendWindowSize configures x11 windows with position and size. would be nice to decouple it like the TODO mentions, but idk where and how we want to configure the x11 surface in that case.

sendWindowSize is still manually called in the following places:

  • layout/IHyprLayout.cpp in onMouseMove
  • events/Windows.cpp in listener_unmanagedSetGeometry for fullscreen with force = true
  • Compositor.cpp in setWindowFullscreenState with force = true
  • managersXwaylandManager.cpp in activateWindow with force = true
  • desktop/Window.cpp in onX11Configure when dragging with force=true
  • desktop/Workspace.cpp in forceResportSizesToWindows with force=true

@PaideiaDilemma PaideiaDilemma changed the title window: fix resizes with an update callback window: move size reporting to animation begin callback Feb 5, 2025
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.

39

@vaxerski vaxerski merged commit ff9e059 into hyprwm:main Feb 6, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants