@@ -10,7 +10,7 @@ use gartk_x11::{ |
| 10 | use x11rb::protocol::xproto::ConnectionExt; | 10 | use x11rb::protocol::xproto::ConnectionExt; |
| 11 | | 11 | |
| 12 | use crate::config::{Config, MonitorConfig, Profile}; | 12 | use crate::config::{Config, MonitorConfig, Profile}; |
| 13 | -use crate::randr::{OutputInfo, RandrManager}; | 13 | +use crate::randr::{ModeInfo, OutputInfo, RandrManager}; |
| 14 | use crate::ui::{ | 14 | use crate::ui::{ |
| 15 | Button, DisplayPanel, DisplayPanelResult, Dropdown, DropdownAction, EventResult, MonitorView, | 15 | Button, DisplayPanel, DisplayPanelResult, Dropdown, DropdownAction, EventResult, MonitorView, |
| 16 | TextInput, | 16 | TextInput, |
@@ -122,7 +122,7 @@ impl App { |
| 122 | | 122 | |
| 123 | // Create RandR manager (only in non-demo mode) | 123 | // Create RandR manager (only in non-demo mode) |
| 124 | let (randr, randr_outputs) = if demo { | 124 | let (randr, randr_outputs) = if demo { |
| 125 | - (None, Vec::new()) | 125 | + (None, Self::demo_outputs()) |
| 126 | } else { | 126 | } else { |
| 127 | match RandrManager::new(conn.clone()) { | 127 | match RandrManager::new(conn.clone()) { |
| 128 | Ok(r) => { | 128 | Ok(r) => { |
@@ -249,25 +249,88 @@ impl App { |
| 249 | vec![ | 249 | vec![ |
| 250 | gartk_x11::Monitor { | 250 | gartk_x11::Monitor { |
| 251 | name: "eDP-1".to_string(), | 251 | name: "eDP-1".to_string(), |
| 252 | - rect: Rect::new(0, 0, 2560, 1600), | 252 | + rect: Rect::new(0, 0, 2880, 1800), |
| 253 | primary: true, | 253 | primary: true, |
| 254 | - width_mm: 290, | 254 | + width_mm: 301, |
| 255 | - height_mm: 180, | 255 | + height_mm: 188, |
| 256 | }, | 256 | }, |
| 257 | gartk_x11::Monitor { | 257 | gartk_x11::Monitor { |
| 258 | name: "HDMI-1".to_string(), | 258 | name: "HDMI-1".to_string(), |
| 259 | - rect: Rect::new(2560, 0, 1920, 1080), | 259 | + rect: Rect::new(2880, 0, 1920, 1080), |
| 260 | primary: false, | 260 | primary: false, |
| 261 | width_mm: 530, | 261 | width_mm: 530, |
| 262 | height_mm: 300, | 262 | height_mm: 300, |
| 263 | }, | 263 | }, |
| 264 | gartk_x11::Monitor { | 264 | gartk_x11::Monitor { |
| 265 | name: "DP-1".to_string(), | 265 | name: "DP-1".to_string(), |
| 266 | - rect: Rect::new(2560, 1080, 1920, 1080), | 266 | + rect: Rect::new(2880, 1080, 2560, 1440), |
| 267 | primary: false, | 267 | primary: false, |
| | 268 | + width_mm: 597, |
| | 269 | + height_mm: 336, |
| | 270 | + }, |
| | 271 | + ] |
| | 272 | + } |
| | 273 | + |
| | 274 | + /// Create demo RandR outputs with available modes for UI testing. |
| | 275 | + fn demo_outputs() -> Vec<OutputInfo> { |
| | 276 | + vec![ |
| | 277 | + OutputInfo { |
| | 278 | + name: "eDP-1".to_string(), |
| | 279 | + output: 0, |
| | 280 | + crtc: Some(0), |
| | 281 | + connected: true, |
| | 282 | + modes: vec![ |
| | 283 | + ModeInfo { id: 1, width: 2880, height: 1800, refresh: 60.0 }, |
| | 284 | + ModeInfo { id: 2, width: 2560, height: 1600, refresh: 60.0 }, |
| | 285 | + ModeInfo { id: 3, width: 1920, height: 1200, refresh: 60.0 }, |
| | 286 | + ModeInfo { id: 4, width: 1920, height: 1080, refresh: 60.0 }, |
| | 287 | + ModeInfo { id: 5, width: 1680, height: 1050, refresh: 60.0 }, |
| | 288 | + ModeInfo { id: 6, width: 1440, height: 900, refresh: 60.0 }, |
| | 289 | + ModeInfo { id: 7, width: 1280, height: 800, refresh: 60.0 }, |
| | 290 | + ], |
| | 291 | + current_mode: Some(ModeInfo { id: 1, width: 2880, height: 1800, refresh: 60.0 }), |
| | 292 | + position: Some((0, 0)), |
| | 293 | + width_mm: 301, |
| | 294 | + height_mm: 188, |
| | 295 | + }, |
| | 296 | + OutputInfo { |
| | 297 | + name: "HDMI-1".to_string(), |
| | 298 | + output: 1, |
| | 299 | + crtc: Some(1), |
| | 300 | + connected: true, |
| | 301 | + modes: vec![ |
| | 302 | + ModeInfo { id: 10, width: 3840, height: 2160, refresh: 60.0 }, |
| | 303 | + ModeInfo { id: 11, width: 3840, height: 2160, refresh: 30.0 }, |
| | 304 | + ModeInfo { id: 12, width: 2560, height: 1440, refresh: 60.0 }, |
| | 305 | + ModeInfo { id: 13, width: 1920, height: 1080, refresh: 120.0 }, |
| | 306 | + ModeInfo { id: 14, width: 1920, height: 1080, refresh: 60.0 }, |
| | 307 | + ModeInfo { id: 15, width: 1920, height: 1080, refresh: 30.0 }, |
| | 308 | + ModeInfo { id: 16, width: 1280, height: 720, refresh: 60.0 }, |
| | 309 | + ], |
| | 310 | + current_mode: Some(ModeInfo { id: 14, width: 1920, height: 1080, refresh: 60.0 }), |
| | 311 | + position: Some((2880, 0)), |
| 268 | width_mm: 530, | 312 | width_mm: 530, |
| 269 | height_mm: 300, | 313 | height_mm: 300, |
| 270 | }, | 314 | }, |
| | 315 | + OutputInfo { |
| | 316 | + name: "DP-1".to_string(), |
| | 317 | + output: 2, |
| | 318 | + crtc: Some(2), |
| | 319 | + connected: true, |
| | 320 | + modes: vec![ |
| | 321 | + ModeInfo { id: 20, width: 2560, height: 1440, refresh: 144.0 }, |
| | 322 | + ModeInfo { id: 21, width: 2560, height: 1440, refresh: 120.0 }, |
| | 323 | + ModeInfo { id: 22, width: 2560, height: 1440, refresh: 60.0 }, |
| | 324 | + ModeInfo { id: 23, width: 1920, height: 1080, refresh: 144.0 }, |
| | 325 | + ModeInfo { id: 24, width: 1920, height: 1080, refresh: 120.0 }, |
| | 326 | + ModeInfo { id: 25, width: 1920, height: 1080, refresh: 60.0 }, |
| | 327 | + ModeInfo { id: 26, width: 1280, height: 720, refresh: 60.0 }, |
| | 328 | + ], |
| | 329 | + current_mode: Some(ModeInfo { id: 22, width: 2560, height: 1440, refresh: 60.0 }), |
| | 330 | + position: Some((2880, 1080)), |
| | 331 | + width_mm: 597, |
| | 332 | + height_mm: 336, |
| | 333 | + }, |
| 271 | ] | 334 | ] |
| 272 | } | 335 | } |
| 273 | | 336 | |