virtual-output: add support for virtual outputs
This commit is contained in:
parent
c25d17514d
commit
530e66ef78
27 changed files with 1480 additions and 9 deletions
|
|
@ -183,6 +183,12 @@ pub enum Action {
|
|||
name: String,
|
||||
latch: bool,
|
||||
},
|
||||
CreateVirtualOutput {
|
||||
name: String,
|
||||
},
|
||||
RemoveVirtualOutput {
|
||||
name: String,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
|
|
|
|||
|
|
@ -480,6 +480,20 @@ impl ActionParser<'_> {
|
|||
latch: true,
|
||||
})
|
||||
}
|
||||
|
||||
fn parse_create_virtual_output(&mut self, ext: &mut Extractor<'_>) -> ParseResult<Self> {
|
||||
let (name,) = ext.extract((str("name"),))?;
|
||||
Ok(Action::CreateVirtualOutput {
|
||||
name: name.value.to_string(),
|
||||
})
|
||||
}
|
||||
|
||||
fn parse_remove_virtual_output(&mut self, ext: &mut Extractor<'_>) -> ParseResult<Self> {
|
||||
let (name,) = ext.extract((str("name"),))?;
|
||||
Ok(Action::RemoveVirtualOutput {
|
||||
name: name.value.to_string(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl Parser for ActionParser<'_> {
|
||||
|
|
@ -539,6 +553,8 @@ impl Parser for ActionParser<'_> {
|
|||
"copy-mark" => self.parse_copy_mark(&mut ext),
|
||||
"push-mode" => self.parse_push_mode(&mut ext),
|
||||
"latch-mode" => self.parse_latch_mode(&mut ext),
|
||||
"create-virtual-output" => self.parse_create_virtual_output(&mut ext),
|
||||
"remove-virtual-output" => self.parse_remove_virtual_output(&mut ext),
|
||||
v => {
|
||||
ext.ignore_unused();
|
||||
return Err(ActionParserError::UnknownType(v.to_string()).spanned(ty.span));
|
||||
|
|
|
|||
|
|
@ -50,10 +50,10 @@ use {
|
|||
},
|
||||
toggle_float_above_fullscreen, toggle_show_bar, toggle_show_titles,
|
||||
video::{
|
||||
ColorSpace, Connector, DrmDevice, Eotf, connectors, drm_devices,
|
||||
ColorSpace, Connector, DrmDevice, Eotf, connectors, create_virtual_output, drm_devices,
|
||||
on_connector_connected, on_connector_disconnected, on_graphics_initialized,
|
||||
on_new_connector, on_new_drm_device, set_direct_scanout_enabled, set_gfx_api,
|
||||
set_tearing_mode, set_vrr_cursor_hz, set_vrr_mode,
|
||||
on_new_connector, on_new_drm_device, remove_virtual_output, set_direct_scanout_enabled,
|
||||
set_gfx_api, set_tearing_mode, set_vrr_cursor_hz, set_vrr_mode,
|
||||
},
|
||||
window::Window,
|
||||
workspace::set_workspace_display_order,
|
||||
|
|
@ -476,6 +476,8 @@ impl Action {
|
|||
state.set_mode(new, latch);
|
||||
})
|
||||
}
|
||||
Action::CreateVirtualOutput { name } => b.new(move || create_virtual_output(&name)),
|
||||
Action::RemoveVirtualOutput { name } => b.new(move || remove_virtual_output(&name)),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue