linux: Treat fullscreen as tiled on X11 and prevent resizing while maximized (#13990)

Two quick fixes for issues I noticed:

1. Fullscreening an unmaximized X11 window still showed rounded window
corners and allowed resizing
2. Maximized windows still allowed for resizing on corners due to
missing checks

![image](https://github.com/zed-industries/zed/assets/71973804/47df4de2-4013-4e51-88c3-d33b52a909f5)


Release Notes:

- N/A
This commit is contained in:
apricotbucket28 2024-07-09 11:30:30 -03:00 committed by GitHub
parent 29226170f1
commit 23c84f8dc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 7 deletions

View file

@ -1240,7 +1240,9 @@ impl PlatformWindow for X11Window {
match state.decorations {
WindowDecorations::Server => Decorations::Server,
WindowDecorations::Client => {
let tiling = if let Some(edge_constraints) = &state.edge_constraints {
let tiling = if state.fullscreen {
Tiling::tiled()
} else if let Some(edge_constraints) = &state.edge_constraints {
edge_constraints.to_tiling()
} else {
// https://source.chromium.org/chromium/chromium/src/+/main:ui/ozone/platform/x11/x11_window.cc;l=2519;drc=1f14cc876cc5bf899d13284a12c451498219bb2d
@ -1251,7 +1253,6 @@ impl PlatformWindow for X11Window {
right: state.maximized_horizontal,
}
};
Decorations::Client { tiling }
}
}
@ -1262,7 +1263,9 @@ impl PlatformWindow for X11Window {
let dp = (inset.0 * state.scale_factor) as u32;
let insets = if let Some(edge_constraints) = &state.edge_constraints {
let insets = if state.fullscreen {
[0, 0, 0, 0]
} else if let Some(edge_constraints) = &state.edge_constraints {
let left = if edge_constraints.left_tiled { 0 } else { dp };
let top = if edge_constraints.top_tiled { 0 } else { dp };
let right = if edge_constraints.right_tiled { 0 } else { dp };