mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-04-22 16:48:33 +02:00
feat(wm): adapt to scaling and resolution changes
This commit expands the reconcile_monitors fn to also update resolution and work area sizes if they are different from what is stored in the window manager state. Another WindowManagerEvent has been added as a polling mechanism for monitor-related changes (scaling, dpi, resolution etc.), and this will now also trigger the reconcile_monitors fn in the existing event pre-processing block. resolve #36
This commit is contained in:
@@ -19,8 +19,9 @@ use crate::workspace::Workspace;
|
||||
pub struct Monitor {
|
||||
#[getset(get_copy = "pub", set = "pub")]
|
||||
id: isize,
|
||||
monitor_size: Rect,
|
||||
#[getset(get = "pub")]
|
||||
#[getset(get = "pub", set = "pub")]
|
||||
size: Rect,
|
||||
#[getset(get = "pub", set = "pub")]
|
||||
work_area_size: Rect,
|
||||
workspaces: Ring<Workspace>,
|
||||
#[serde(skip_serializing)]
|
||||
@@ -30,13 +31,13 @@ pub struct Monitor {
|
||||
|
||||
impl_ring_elements!(Monitor, Workspace);
|
||||
|
||||
pub fn new(id: isize, monitor_size: Rect, work_area_size: Rect) -> Monitor {
|
||||
pub fn new(id: isize, size: Rect, work_area_size: Rect) -> Monitor {
|
||||
let mut workspaces = Ring::default();
|
||||
workspaces.elements_mut().push_back(Workspace::default());
|
||||
|
||||
Monitor {
|
||||
id,
|
||||
monitor_size,
|
||||
size,
|
||||
work_area_size,
|
||||
workspaces,
|
||||
workspace_names: HashMap::default(),
|
||||
|
||||
Reference in New Issue
Block a user