mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-09-17 15:21:26 +02:00
fix(wm): match display name / avoid id volatility
This commit replaces all usages of MONITORINFO with MONITORINFOEX in order to retrieve a name for each connected display device. This display device name makes for easier deduping during monitor reconciliation, so that matching display monitor names can simply have their hmonitor id updated instead of trying to figure out which id corresponds to which monitor by looking at the windows currently visible on each. fix #267
This commit is contained in:
@@ -21,6 +21,8 @@ pub struct Monitor {
|
||||
#[getset(get_copy = "pub", set = "pub")]
|
||||
id: isize,
|
||||
#[getset(get = "pub", set = "pub")]
|
||||
name: String,
|
||||
#[getset(get = "pub", set = "pub")]
|
||||
size: Rect,
|
||||
#[getset(get = "pub", set = "pub")]
|
||||
work_area_size: Rect,
|
||||
@@ -32,12 +34,13 @@ pub struct Monitor {
|
||||
|
||||
impl_ring_elements!(Monitor, Workspace);
|
||||
|
||||
pub fn new(id: isize, size: Rect, work_area_size: Rect) -> Monitor {
|
||||
pub fn new(id: isize, size: Rect, work_area_size: Rect, name: String) -> Monitor {
|
||||
let mut workspaces = Ring::default();
|
||||
workspaces.elements_mut().push_back(Workspace::default());
|
||||
|
||||
Monitor {
|
||||
id,
|
||||
name,
|
||||
size,
|
||||
work_area_size,
|
||||
workspaces,
|
||||
|
||||
Reference in New Issue
Block a user