Fix laggy window resize on Wayland
Title: Fix laggy window resize on Wayland
Description: scale_changed and size_changed are initialized to true, making the conditional assignments inside the function ineffective—they could only ever set true to true.
This causes no issues on X11 (duh it's wayland_thread.cpp, what was i thinking...), however Wayland window resizing struggles big time. Changing the initial variables back to false fixes lag during window resize.
Regression from #101774?
Changing the initial variables back to false fixes lag during window resize.
Are you sure that's the case? On sway I feel no speed difference (debug build), although it looks different because the viewport isn't updated as much ("stretching").
While window_state_update_size does stuff, I doubt that it's the main performance hog. Also, in DisplayServer we have a no-op check too, and I'm sure that also the Vulkan/OGL contexts no-op too, which I assume are the heaviest things.
Changing the initial variables back to false fixes lag during window resize.
Are you sure that's the case? On sway I feel no speed difference (debug build), although it looks different because the viewport isn't updated as much ("stretching").
Yes, and no. On KDE Wayland when I build with them initially false I can resize the windows without them lagging, while leaving them true causes lag.
Am I sure this is the root cause of the problem? Heck no! I got annoyed from laggy window resizing on wayland and decided to look it up myself, tried this, fixed, oh cool MR time.
I can upload videos of both builds in ~12 hours when I'm home from work.
Edit: I should also, very probably, profile it with them set to true, so we can have something to point at.
No rush. Any further investigation, while appreciated, is not necessary to merge this patch as this fixes a very obvious mistake. I'm glad you caught this :D
That said, when you the have time I'd be curious hearing about your setup (OS, GPU, drivers, compositor etc).
Thanks! Congratulations on your first merged contribution! 🎉