0.6.0 #1

Merged
pogmommy merged 89 commits from 0.6.0 into main 2025-07-04 20:29:26 -07:00
3 changed files with 12 additions and 1 deletions
Showing only changes of commit 696135a6bb - Show all commits

View file

@ -8,6 +8,7 @@ pub use platform_x11::{set_xprops, X11Backend};
pub trait DisplayBackend: Send + Sync + 'static {
const IS_X11: bool;
const IS_WAYLAND: bool;
fn initialize_window(window_init: &WindowInitiator, monitor: gdk::Rectangle, x: i32, y: i32) -> Option<Window>;
}
@ -16,6 +17,7 @@ pub struct NoBackend;
impl DisplayBackend for NoBackend {
const IS_X11: bool = false;
const IS_WAYLAND: bool = false;
fn initialize_window(_window_init: &WindowInitiator, _monitor: gdk::Rectangle, x: i32, y: i32) -> Option<Window> {
Some(Window::new(gtk::WindowType::Toplevel, x, y))
@ -34,6 +36,7 @@ mod platform_wayland {
impl DisplayBackend for WaylandBackend {
const IS_X11: bool = false;
const IS_WAYLAND: bool = true;
fn initialize_window(window_init: &WindowInitiator, monitor: gdk::Rectangle, x: i32, y: i32) -> Option<Window> {
let window = Window::new(gtk::WindowType::Toplevel, x, y);
@ -134,6 +137,7 @@ mod platform_x11 {
pub struct X11Backend;
impl DisplayBackend for X11Backend {
const IS_X11: bool = true;
const IS_WAYLAND: bool = false;
fn initialize_window(window_init: &WindowInitiator, _monitor: gdk::Rectangle, x: i32, y: i32) -> Option<Window> {
let window_type =

View file

@ -54,11 +54,15 @@ fn main() {
}
#[allow(unused)]
let use_wayland = opts.force_wayland || detect_wayland();
let detected_wayland = detect_wayland();
#[allow(unused)]
let use_wayland = opts.force_wayland || detected_wayland;
#[cfg(all(feature = "wayland", feature = "x11"))]
let result = if use_wayland {
log::info!("Running on wayland. force_wayland={}, detected_wayland={}", opts.force_wayland, detected_wayland);
run(opts, eww_binary_name, display_backend::WaylandBackend)
} else {
log::info!("Running on X11. force_wayland={}, detected_wayland={}", opts.force_wayland, detected_wayland);
run(opts, eww_binary_name, display_backend::X11Backend)
};

View file

@ -68,6 +68,9 @@ pub fn initialize_server<B: DisplayBackend>(
}
});
if B::IS_WAYLAND {
std::env::set_var("GDK_BACKEND", "wayland")
}
gtk::init()?;
log::debug!("Initializing script var handler");