Closed noib3 closed 1 week ago
When you power off your monitor it will be disconnected. Windows bound to a specific monitor will get destroyed when that monitor gets disconnected. Not destroying that window would violate the layer shell protocol and is done automatically by the gtk-layer-shell library.
You need to connect to the monitor added and removed events to recreate the windows:
//create windows for already connected monitors
App.get_monitors().map(Bar)
//create windows for newly connected monitors
App.connect("monitor_added", (_, mon) => Bar(mon))
//remove windows for removed monitors
App.connect("monitor_removed", (_, mon) => {
App.get_windows().forEach(w => {
if(w.gdkmonitor == mon) App.remove_window(w)
})
})
Describe the bug
Astal windows disapper after a monitor is turned off.
To Reproduce
I'm using a single external monitor. I'm not sure if it can be reproduced on a laptop by closing and opening the lid.
ags init
(link to mine)ags bundle
Expected behavior
The bar is still visible after the monitor is turned back on.