Skip to content

Commit

Permalink
Work around crash when opening window
Browse files Browse the repository at this point in the history
See the included comment for an explanation.
  • Loading branch information
hannobraun committed May 30, 2023
1 parent c458c71 commit 0f572d0
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion crates/fj-window/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,26 @@ impl Window {
let window = WindowBuilder::new()
.with_title("Fornjot")
.with_maximized(true)
.with_decorations(true)
// When the window decorations are enabled, I'm seeing the following
// error on Gnome/Wayland, in response to a `ScaleFactorChange`
// event:
// ```
// wl_surface@24: error 2: Buffer size (1940x45) must be an integer multiple of the buffer_scale (2).
// ```
//
// This is happening most of the time. Very rarely, the window will
// open as expected.
//
// I believe that there is a race condition somewhere low in the
// stack, that will cause the buffer size for the window decorations
// to not be updated before the check that produces the above error.
// I failed to track down where this is happening, so I decided to
// deploy this workaround instead of spending more time.
//
// Window decorations should be re-enabled once possible. This is
// being tracked in this issue:
// https://github.com/hannobraun/fornjot/issues/1848
.with_decorations(false)
.with_transparent(false)
.build(event_loop)?;

Expand Down

0 comments on commit 0f572d0

Please sign in to comment.