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

x11: set_inner_size after set_fullscreen(None) from Fullscreen::Exlusive is ignored #1552

Open
rijenkii opened this issue Apr 30, 2020 · 3 comments
Labels
B - bug Dang, that shouldn't have happened C - needs investigation Issue must be confirmed and researched DS - x11

Comments

@rijenkii
Copy link

rijenkii commented Apr 30, 2020

Situation: Window has been set to Some(Fullscreen::Exclusive) with a resolution, that differs from default one (monitor_handle.video_modes().nth(x)). Then, fullscreen is set to None, and window is resized with set_inner_size.

Expected: Window is in windowed mode and resized as expected.

Actual behavior:
Window mode is set to windowed, but window size is set to

  • WM: awesomewm: default_video_mode.size() * scale_factor
  • WM: xfwm4: size that window had before entering fullscreen
  • WM: openbox, plasma: size that window had before entering fullscreen * scale_factor

As if set_inner_size was never called


gist (Press F to enter fullscreen, W to try to enter windowed, ESC to exit)

Note: Everything is working as expected, if window has been set to a default video mode (monitor_handle.video_modes().next())

@rijenkii rijenkii changed the title x11: set_inner_size after set_fullscreen(None) from Fullscreen::Exlusive doesn't work x11: set_inner_size after set_fullscreen(None) from Fullscreen::Exlusive is ignored Apr 30, 2020
@rijenkii
Copy link
Author

rijenkii commented Apr 30, 2020

Funny observation - If you add std::thread::sleep after set_inner_size, window actually gets resized to expected size, but after sleep ends - it resizes to resolutions stated in the OP

@rijenkii
Copy link
Author

rijenkii commented May 1, 2020

I have added mode selection and logging of ScaleFactorChanged into the gist
Another interesting observation - when going in and out of fullscreen, winit on x11 sends TWO ScaleFactorChanged events - one from here and second one from here, while on Windows it sends none

@rijenkii
Copy link
Author

rijenkii commented May 1, 2020

Another funny observation - if WINIT_X11_SCALE_FACTOR env variable is set to any number - winit behaves just as on Windows - does not send ScaleFactorChanged events when changing modes, and properly resizes window after exiting fullscreen

@murarth murarth added DS - x11 C - needs investigation Issue must be confirmed and researched B - bug Dang, that shouldn't have happened labels May 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B - bug Dang, that shouldn't have happened C - needs investigation Issue must be confirmed and researched DS - x11
Development

No branches or pull requests

2 participants