Add display rotation: Rot pill, chandra-ctl rotate, sensor auto-rotate
CI / test (push) Failing after 51s
CI / test (push) Failing after 51s
- Rotate the display 0/90/180/270 degrees in the KMS host, with scanout and libinput touch/pointer coordinates transformed to match - Add a touch "Rot" pill beside "KB": tap turns 90 CW, long-press or right-click flips 180 - Add `chandra-ctl rotate [cw|ccw|flip|0|90|180|270|status]`; CHANDRA_ROTATE sets the initial orientation - Add session/chandra-auto-rotate, which follows iio-sensor-proxy orientation (disable with CHANDRA_AUTO_ROTATE=0) - Advertise window_menu, maximize, fullscreen and minimize via xdg_toplevel.wm_capabilities (xdg_wm_base v5+) - Add docs/handset.md covering handset touch, scaling, OSK and rotation
This commit is contained in:
1 parent
905dab8725
commit
2e00009c79
21 files changed
+669
-63
No files matched your search
@@ -213,6 +213,7 @@ pub fn ChandraCompositor::control_command(self : ChandraCompositor, line : Strin
|
||||
"launch ID start desktop app ID (e.g. org.kde.kwi) as the dock does; a failed start shows its notice",
|
||||
"windows each window: frame, layout, box, shadow, size limits; and what is under the pointer",
|
||||
"screenshot [PATH] save a full-screen PNG directly (without opening the editor)",
|
||||
"rotate [cw|ccw|flip|0|90|180|270|status] rotate or flip the display",
|
||||
"auth-demo [MODE] show the password dialog with a pretend check (password \"demo\"); MODE: " +
|
||||
@polkit.demo_modes.join(", "),
|
||||
"auth-status the password dialog's agent: running, registered, or why not",
|
||||
@@ -359,6 +360,44 @@ pub fn ChandraCompositor::control_command(self : ChandraCompositor, line : Strin
|
||||
}
|
||||
}
|
||||
}
|
||||
"rotate" => {
|
||||
let arg = if words.length() >= 2 { words[1] } else { "cw" }
|
||||
if words.length() > 2 {
|
||||
return (["error usage: rotate [cw|ccw|flip|0|90|180|270|status]"], false)
|
||||
}
|
||||
match arg {
|
||||
"status" => (["ok " + (self.rotation * 90).to_string() + " " + self.output_w.to_string() + "x" + self.output_h.to_string()], true)
|
||||
"cw" | "right" => {
|
||||
self.rotate_cw()
|
||||
(["ok rotate cw"], true)
|
||||
}
|
||||
"ccw" | "left" => {
|
||||
self.rotate_ccw()
|
||||
(["ok rotate ccw"], true)
|
||||
}
|
||||
"flip" => {
|
||||
self.rotate_flip()
|
||||
(["ok rotate flip"], true)
|
||||
}
|
||||
"0" | "normal" => {
|
||||
self.request_rotation(0)
|
||||
(["ok rotate 0"], true)
|
||||
}
|
||||
"90" | "1" => {
|
||||
self.request_rotation(1)
|
||||
(["ok rotate 90"], true)
|
||||
}
|
||||
"180" | "2" => {
|
||||
self.request_rotation(2)
|
||||
(["ok rotate 180"], true)
|
||||
}
|
||||
"270" | "3" => {
|
||||
self.request_rotation(3)
|
||||
(["ok rotate 270"], true)
|
||||
}
|
||||
_ => (["error usage: rotate [cw|ccw|flip|0|90|180|270|status]"], false)
|
||||
}
|
||||
}
|
||||
other => (["error unknown command '" + other + "' (try: help)"], false)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user