fix(displays): inability to enable displays
This commit is contained in:
parent
d964b14212
commit
b79e4a250a
1 changed files with 16 additions and 5 deletions
|
|
@ -721,16 +721,15 @@ impl Page {
|
||||||
|
|
||||||
/// Applies a display configuration via `cosmic-randr`.
|
/// Applies a display configuration via `cosmic-randr`.
|
||||||
fn exec_randr(&self, output: &Output, request: Randr) -> Command<app::Message> {
|
fn exec_randr(&self, output: &Output, request: Randr) -> Command<app::Message> {
|
||||||
let Some(current) = output.current.and_then(|id| self.list.modes.get(id)) else {
|
|
||||||
return Command::none();
|
|
||||||
};
|
|
||||||
|
|
||||||
let name = &*output.name;
|
let name = &*output.name;
|
||||||
|
|
||||||
let mut command = tokio::process::Command::new("cosmic-randr");
|
let mut command = tokio::process::Command::new("cosmic-randr");
|
||||||
|
|
||||||
match request {
|
match request {
|
||||||
Randr::Position(x, y) => {
|
Randr::Position(x, y) => {
|
||||||
|
let Some(current) = output.current.and_then(|id| self.list.modes.get(id)) else {
|
||||||
|
return Command::none();
|
||||||
|
};
|
||||||
|
|
||||||
command
|
command
|
||||||
.arg("mode")
|
.arg("mode")
|
||||||
.arg("--pos-x")
|
.arg("--pos-x")
|
||||||
|
|
@ -743,6 +742,10 @@ impl Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
Randr::RefreshRate(rate) => {
|
Randr::RefreshRate(rate) => {
|
||||||
|
let Some(current) = output.current.and_then(|id| self.list.modes.get(id)) else {
|
||||||
|
return Command::none();
|
||||||
|
};
|
||||||
|
|
||||||
command
|
command
|
||||||
.arg("mode")
|
.arg("mode")
|
||||||
.arg("--refresh")
|
.arg("--refresh")
|
||||||
|
|
@ -768,6 +771,10 @@ impl Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
Randr::Scale(scale) => {
|
Randr::Scale(scale) => {
|
||||||
|
let Some(current) = output.current.and_then(|id| self.list.modes.get(id)) else {
|
||||||
|
return Command::none();
|
||||||
|
};
|
||||||
|
|
||||||
command
|
command
|
||||||
.arg("mode")
|
.arg("mode")
|
||||||
.arg("--scale")
|
.arg("--scale")
|
||||||
|
|
@ -791,6 +798,10 @@ impl Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
Randr::Transform(transform) => {
|
Randr::Transform(transform) => {
|
||||||
|
let Some(current) = output.current.and_then(|id| self.list.modes.get(id)) else {
|
||||||
|
return Command::none();
|
||||||
|
};
|
||||||
|
|
||||||
command
|
command
|
||||||
.arg("mode")
|
.arg("mode")
|
||||||
.arg("--transform")
|
.arg("--transform")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue