config: add move-to-output action
This commit is contained in:
parent
2a517f437a
commit
fecfd24ba0
15 changed files with 357 additions and 76 deletions
|
|
@ -4,7 +4,7 @@ use {
|
|||
crate::{
|
||||
_private::{
|
||||
bincode_ops,
|
||||
ipc::{ClientMessage, InitMessage, Response, ServerMessage},
|
||||
ipc::{ClientMessage, InitMessage, Response, ServerMessage, WorkspaceSource},
|
||||
logging, Config, ConfigEntry, ConfigEntryGen, PollableId, WireMode, VERSION,
|
||||
},
|
||||
exec::Command,
|
||||
|
|
@ -421,6 +421,13 @@ impl Client {
|
|||
self.send(&ClientMessage::DisablePointerConstraint { seat });
|
||||
}
|
||||
|
||||
pub fn move_to_output(&self, workspace: WorkspaceSource, connector: Connector) {
|
||||
self.send(&ClientMessage::MoveToOutput {
|
||||
workspace,
|
||||
connector,
|
||||
});
|
||||
}
|
||||
|
||||
pub fn set_fullscreen(&self, seat: Seat, fullscreen: bool) {
|
||||
self.send(&ClientMessage::SetFullscreen { seat, fullscreen });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -424,6 +424,16 @@ pub enum ClientMessage<'a> {
|
|||
SetIdle {
|
||||
timeout: Duration,
|
||||
},
|
||||
MoveToOutput {
|
||||
workspace: WorkspaceSource,
|
||||
connector: Connector,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub enum WorkspaceSource {
|
||||
Seat(Seat),
|
||||
Explicit(Workspace),
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ use {
|
|||
input::{acceleration::AccelProfile, capability::Capability},
|
||||
keyboard::Keymap,
|
||||
Axis, Direction, ModifiedKeySym, Workspace,
|
||||
_private::DEFAULT_SEAT_NAME,
|
||||
_private::{ipc::WorkspaceSource, DEFAULT_SEAT_NAME},
|
||||
video::Connector,
|
||||
},
|
||||
serde::{Deserialize, Serialize},
|
||||
std::time::Duration,
|
||||
|
|
@ -319,6 +320,11 @@ impl Seat {
|
|||
pub fn disable_pointer_constraint(self) {
|
||||
get!().disable_pointer_constraint(self)
|
||||
}
|
||||
|
||||
/// Moves the currently focused workspace to another output.
|
||||
pub fn move_to_output(self, connector: Connector) {
|
||||
get!().move_to_output(WorkspaceSource::Seat(self), connector);
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns all seats.
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
)]
|
||||
|
||||
use {
|
||||
crate::keyboard::ModifiedKeySym,
|
||||
crate::{_private::ipc::WorkspaceSource, keyboard::ModifiedKeySym, video::Connector},
|
||||
serde::{Deserialize, Serialize},
|
||||
std::{
|
||||
fmt::{Debug, Display, Formatter},
|
||||
|
|
@ -159,6 +159,13 @@ impl Workspace {
|
|||
let get = get!();
|
||||
get.set_workspace_capture(self, !get.get_workspace_capture(self));
|
||||
}
|
||||
|
||||
/// Moves this workspace to another output.
|
||||
///
|
||||
/// This has no effect if the workspace is not currently being shown.
|
||||
pub fn move_to_output(self, output: Connector) {
|
||||
get!().move_to_output(WorkspaceSource::Explicit(self), output);
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the workspace with the given name.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue