diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dbus/mutter_display_config.rs | 3 | ||||
| -rw-r--r-- | src/utils/mod.rs | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/dbus/mutter_display_config.rs b/src/dbus/mutter_display_config.rs index e1d12870..6de56b70 100644 --- a/src/dbus/mutter_display_config.rs +++ b/src/dbus/mutter_display_config.rs @@ -8,6 +8,7 @@ use zbus::{dbus_interface, fdo, SignalContext}; use super::Start; use crate::backend::IpcOutputMap; +use crate::utils::is_laptop_panel; pub struct DisplayConfig { ipc_outputs: Arc<Mutex<IpcOutputMap>>, @@ -63,7 +64,7 @@ impl DisplayConfig { .map(|output| { // Loosely matches the check in Mutter. let c = &output.name; - let is_laptop_panel = matches!(c.get(..4), Some("eDP-" | "LVDS" | "DSI-")); + let is_laptop_panel = is_laptop_panel(c); let display_name = make_display_name(output, is_laptop_panel); let mut properties = HashMap::new(); diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 959a804e..3d40d890 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -224,6 +224,10 @@ pub fn output_matches_name(output: &Output, target: &str) -> bool { name.matches(target) } +pub fn is_laptop_panel(connector: &str) -> bool { + matches!(connector.get(..4), Some("eDP-" | "LVDS" | "DSI-")) +} + pub fn with_toplevel_role<T>( toplevel: &ToplevelSurface, f: impl FnOnce(&mut XdgToplevelSurfaceRoleAttributes) -> T, |
