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

eframe window changes size constantly on Hyprland #3628

Closed
RegenJacob opened this issue Nov 24, 2023 · 7 comments · Fixed by #3643
Closed

eframe window changes size constantly on Hyprland #3628

RegenJacob opened this issue Nov 24, 2023 · 7 comments · Fixed by #3643
Labels
bug Something is broken native-linux Problem specific to Linux
Milestone

Comments

@RegenJacob
Copy link

RegenJacob commented Nov 24, 2023

Describe the bug
I'm on Hyprland and when I open an eframe app this happens:

2023-11-24.20-28-00.mp4

It worked in 0.23 without those issues. Maybe related to #3625 ?

To Reproduce
Steps to reproduce the behavior:

  1. Be on Hyprland (possibly on other Wayland Compositors too?)
  2. Run eframe app in debug mode (didn't test release yet)
  3. The window resizes like shown in the video

Expected behavior
Window shouldn't change the size

Desktop (please complete the following information):

  • OS: Linux arch 6.6.2-zen1-1-zen (Hyprland on wayland)
  • Version: eframe 0.24
@RegenJacob RegenJacob added the bug Something is broken label Nov 24, 2023
@RegenJacob RegenJacob changed the title eframe window changes size constantly eframe window changes size constantly on Hyprland Nov 24, 2023
@zeozeozeo
Copy link
Contributor

Probably related to #3620

@RegenJacob
Copy link
Author

Also doesn't work on wgpu feature enabled

@emilk emilk added this to the 0.24.1 milestone Nov 27, 2023
@emilk emilk added the native-linux Problem specific to Linux label Nov 27, 2023
@emilk
Copy link
Owner

emilk commented Nov 27, 2023

Does RUST_LOG=trace give you any clues?

@ItsEthra
Copy link
Contributor

ItsEthra commented Nov 27, 2023

This only happens when x11 feature is enabled.

EDIT: Happens because of this code

// TODO remove this in winit 0.29
// This hack make the window outer_position and size to be valid, X11 Only
// That was happending because winit get the window state before the compositor adds decorations!
#[cfg(all(feature = "x11", target_os = "linux"))]
window.set_maximized(window.is_maximized());
When commented out window behaves normally.

EDIT2: As a workaround you could just disable x11 feature. I don't know if it's safe to just remove this line because of the comment above and I don't have a x11 compositor to make a proper fix. Maybe @emilk have a better idea about this.

EDIT3: I guess this can be fixed by disabling this hack when wayland feature is enabled.

@emilk
Copy link
Owner

emilk commented Nov 27, 2023

Nice find @ItsEthra - @konkitoman wrote that set_maximized - Do we really need it @konkitoman ? It seems like a bad idea. Maybe it should be moved to window initialization instead of running it each frame?

emilk added a commit that referenced this issue Nov 27, 2023
Added by @konkitoman in #3172

I'm not sure what the hack is supposed to solve, but calling it
every frame is a bad idea, as @ItsEthra reported in
#3628 (comment)

* Closes #3620
* Closes #3628
@emilk
Copy link
Owner

emilk commented Nov 27, 2023

Potential fix: #3643

@konkitoman
Copy link
Contributor

Nice find @ItsEthra - @konkitoman wrote that set_maximized - Do we really need it @konkitoman ? It seems like a bad idea. Maybe it should be moved to window initialization instead of running it each frame?

Is not really needed, that can be removed.

But the position will be off by 2..12 pixels on X11 Plasma

emilk added a commit that referenced this issue Nov 27, 2023
This was caused by a hack added by @konkitoman in
#3172

The solution was reported by @ItsEthra in
#3628 (comment)

* Closes #3620
* Closes #3628
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken native-linux Problem specific to Linux
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants