Skip to content

Commit

Permalink
native/linux_x11: Fullscreen toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
bolphen authored and not-fl3 committed Jun 23, 2024
1 parent 01e8200 commit 47bf58f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/native/linux_x11.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,18 @@ impl X11Display {
// TODO: right now it just exits early if fullscreen is false.
// should be able to able to go back from fullscreen to windowed instead
unsafe fn set_fullscreen(&mut self, window: Window, fullscreen: bool) {
if !fullscreen {
return;
}
let wm_state = (self.libx11.XInternAtom)(
self.display,
b"_NET_WM_STATE\x00" as *const u8 as *const _,
false as _,
);
let wm_fullscreen = (self.libx11.XInternAtom)(
self.display,
b"_NET_WM_STATE_FULLSCREEN\x00" as *const u8 as *const _,
if fullscreen {
b"_NET_WM_STATE_FULLSCREEN\x00" as *const u8 as *const _
} else {
b"\x00" as *const u8 as *const _
},
false as _,
);

Expand Down

0 comments on commit 47bf58f

Please sign in to comment.