Implement Windowed Fullscreen
There are two kinds of fullscreen. One where you take over the whole output the other where you just set the window size to the screen size and get rid of decorations. The first one already existed, implement the second which is more common for normal desktop apps. Use an enum to consolidate all the fullscreen states.
This commit is contained in:
parent
a4052b8693
commit
1d97a2a506
8 changed files with 81 additions and 14 deletions
|
|
@ -97,7 +97,7 @@ pub enum DeviceId {
|
|||
Wayland(wayland::DeviceId)
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
#[derive(Clone, PartialEq)]
|
||||
pub enum MonitorId {
|
||||
#[doc(hidden)]
|
||||
X(x11::MonitorId),
|
||||
|
|
@ -317,6 +317,14 @@ impl Window2 {
|
|||
&Window2::Wayland(ref _w) => {},
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_fullscreen_windowed(&self, fullscreen: bool) {
|
||||
match self {
|
||||
&Window2::X(ref w) => w.set_fullscreen_windowed(fullscreen),
|
||||
&Window2::Wayland(ref _w) => {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn x_error_callback(dpy: *mut x11::ffi::Display, event: *mut x11::ffi::XErrorEvent)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue