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:
Pedro Côrte-Real 2017-08-28 00:22:26 +01:00
parent a4052b8693
commit 1d97a2a506
8 changed files with 81 additions and 14 deletions

View file

@ -359,6 +359,12 @@ pub struct MonitorId {
ctxt: Arc<WaylandContext>
}
impl PartialEq for MonitorId {
fn eq(&self, other: &MonitorId) -> bool {
self.id == other.id
}
}
impl MonitorId {
pub fn get_name(&self) -> Option<String> {
let mut guard = self.ctxt.evq.lock().unwrap();

View file

@ -54,7 +54,7 @@ impl Window {
*(decorated.handler()) = Some(DecoratedHandler::new());
// set fullscreen if necessary
if let Some(PlatformMonitorId::Wayland(ref monitor_id)) = attributes.monitor {
if let Some(PlatformMonitorId::Wayland(ref monitor_id)) = attributes.fullscreen.get_monitor() {
ctxt.with_output(monitor_id.clone(), |output| {
decorated.set_fullscreen(Some(output))
});