linux: Fix some small issues (#11458)

Fixed various small issues on Linux, mainly on Wayland.

Apart from the first commit (which should be self-describing), the other
commits have a description explaining the issue and what they do.

caadc58bea should fix
https://github.com/zed-industries/zed/issues/11037

Release Notes:

- N/A
This commit is contained in:
apricotbucket28 2024-05-06 17:23:49 -03:00 committed by GitHub
parent fd3831861b
commit 11bc28080f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 21 deletions

View file

@ -299,7 +299,7 @@ impl WaylandWindowStatePtr {
self.set_decoration_state(WaylandDecorationState::Server)
}
WEnum::Value(zxdg_toplevel_decoration_v1::Mode::ClientSide) => {
self.set_decoration_state(WaylandDecorationState::Server)
self.set_decoration_state(WaylandDecorationState::Client)
}
WEnum::Value(_) => {
log::warn!("Unknown decoration mode");
@ -610,11 +610,11 @@ impl PlatformWindow for WaylandWindow {
}
fn set_title(&mut self, title: &str) {
self.borrow_mut().toplevel.set_title(title.to_string());
self.borrow().toplevel.set_title(title.to_string());
}
fn set_app_id(&mut self, app_id: &str) {
self.borrow_mut().toplevel.set_app_id(app_id.to_owned());
self.borrow().toplevel.set_app_id(app_id.to_owned());
}
fn set_background_appearance(&mut self, background_appearance: WindowBackgroundAppearance) {
@ -666,15 +666,20 @@ impl PlatformWindow for WaylandWindow {
}
fn minimize(&self) {
self.borrow_mut().toplevel.set_minimized();
self.borrow().toplevel.set_minimized();
}
fn zoom(&self) {
// todo(linux)
let state = self.borrow();
if !state.maximized {
state.toplevel.set_maximized();
} else {
state.toplevel.unset_maximized();
}
}
fn toggle_fullscreen(&self) {
let state = self.borrow_mut();
let state = self.borrow();
if !state.fullscreen {
state.toplevel.set_fullscreen(None);
} else {