fix: wallpaper windows on Layer::Bottom to prevent greeter occlusion

Wallpaper-only windows for secondary monitors were on Layer::Top — same
layer as the greeter window. Since they were created after the greeter,
they occluded the login UI, leaving only the wallpaper visible.
This commit is contained in:
nevaforget 2026-03-28 01:30:22 +01:00
parent 96c94f030a
commit 4c9b436978

View File

@ -23,9 +23,9 @@ fn load_css(display: &gdk::Display) {
);
}
fn setup_layer_shell(window: &gtk::ApplicationWindow, keyboard: bool) {
fn setup_layer_shell(window: &gtk::ApplicationWindow, keyboard: bool, layer: gtk4_layer_shell::Layer) {
window.init_layer_shell();
window.set_layer(gtk4_layer_shell::Layer::Top);
window.set_layer(layer);
window.set_exclusive_zone(-1);
if keyboard {
window.set_keyboard_mode(gtk4_layer_shell::KeyboardMode::Exclusive);
@ -60,7 +60,7 @@ fn activate(app: &gtk::Application) {
// Main greeter window (login UI) — compositor picks focused monitor
let greeter_window = greeter::create_greeter_window(&bg_path, &config, app);
if use_layer_shell {
setup_layer_shell(&greeter_window, true);
setup_layer_shell(&greeter_window, true, gtk4_layer_shell::Layer::Top);
}
greeter_window.present();
@ -74,7 +74,7 @@ fn activate(app: &gtk::Application) {
.and_then(|obj| obj.downcast::<gdk::Monitor>().ok())
{
let wallpaper = greeter::create_wallpaper_window(&bg_path, app);
setup_layer_shell(&wallpaper, false);
setup_layer_shell(&wallpaper, false, gtk4_layer_shell::Layer::Bottom);
wallpaper.set_monitor(Some(&monitor));
wallpaper.present();
}