option to build with only wayland or x11 support

This commit is contained in:
galister
2024-02-17 19:57:26 +01:00
parent 5bbaf59790
commit f029b9324d
3 changed files with 27 additions and 4 deletions

View File

@@ -10,7 +10,6 @@ use idmap::IdMap;
use crate::{
overlays::{
keyboard::create_keyboard,
screen::{get_screens_wayland, get_screens_x11},
toast::Toast,
watch::{create_watch, WATCH_NAME, WATCH_SCALE},
},
@@ -41,9 +40,9 @@ where
pub fn new(app: &mut AppState) -> Self {
let mut overlays = IdMap::new();
let (screens, extent) = if std::env::var("WAYLAND_DISPLAY").is_ok() {
get_screens_wayland(&app.session)
crate::overlays::screen::get_screens_wayland(&app.session)
} else {
get_screens_x11(&app.session)
crate::overlays::screen::get_screens_x11(&app.session)
};
let mut watch = create_watch::<T>(&app, &screens);