mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
Fix no outputs case handling in a few places
This commit is contained in:
@@ -24,11 +24,17 @@ impl WlrLayerShellHandler for State {
|
|||||||
_layer: Layer,
|
_layer: Layer,
|
||||||
namespace: String,
|
namespace: String,
|
||||||
) {
|
) {
|
||||||
let output = wl_output
|
let output = if let Some(wl_output) = &wl_output {
|
||||||
.as_ref()
|
Output::from_resource(wl_output)
|
||||||
.and_then(Output::from_resource)
|
} else {
|
||||||
.or_else(|| self.niri.layout.active_output().cloned())
|
self.niri.layout.active_output().cloned()
|
||||||
.unwrap();
|
};
|
||||||
|
let Some(output) = output else {
|
||||||
|
warn!("no output for new layer surface, closing");
|
||||||
|
surface.send_close();
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
let mut map = layer_map_for_output(&output);
|
let mut map = layer_map_for_output(&output);
|
||||||
map.map_layer(&LayerSurface::new(surface, namespace))
|
map.map_layer(&LayerSurface::new(surface, namespace))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|||||||
+1
-1
@@ -288,7 +288,7 @@ impl SessionLockHandler for State {
|
|||||||
|
|
||||||
fn new_surface(&mut self, surface: LockSurface, output: WlOutput) {
|
fn new_surface(&mut self, surface: LockSurface, output: WlOutput) {
|
||||||
let Some(output) = Output::from_resource(&output) else {
|
let Some(output) = Output::from_resource(&output) else {
|
||||||
error!("no Output matching WlOutput");
|
warn!("no Output matching WlOutput");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,13 @@ where
|
|||||||
overlay_cursor,
|
overlay_cursor,
|
||||||
output,
|
output,
|
||||||
} => {
|
} => {
|
||||||
let output = Output::from_resource(&output).unwrap();
|
let Some(output) = Output::from_resource(&output) else {
|
||||||
|
trace!("screencopy client requested non-existent output");
|
||||||
|
let frame = data_init.init(frame, ScreencopyFrameState::Failed);
|
||||||
|
frame.failed();
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
let buffer_size = output.current_mode().unwrap().size;
|
let buffer_size = output.current_mode().unwrap().size;
|
||||||
let region_loc = Point::from((0, 0));
|
let region_loc = Point::from((0, 0));
|
||||||
|
|
||||||
@@ -116,7 +122,13 @@ where
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let output = Output::from_resource(&output).unwrap();
|
let Some(output) = Output::from_resource(&output) else {
|
||||||
|
trace!("screencopy client requested non-existent output");
|
||||||
|
let frame = data_init.init(frame, ScreencopyFrameState::Failed);
|
||||||
|
frame.failed();
|
||||||
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
let output_transform = output.current_transform();
|
let output_transform = output.current_transform();
|
||||||
let output_physical_size =
|
let output_physical_size =
|
||||||
output_transform.transform_size(output.current_mode().unwrap().size);
|
output_transform.transform_size(output.current_mode().unwrap().size);
|
||||||
|
|||||||
Reference in New Issue
Block a user