diff options
| author | alex-huff <alexhuff@bakahuff.com> | 2025-05-18 00:50:20 -0500 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-05-21 07:25:22 -0700 |
| commit | 2415346caaa4121ed202b8e376fb40b2a44eb61f (patch) | |
| tree | 421c819d34d9d4b28fc56cd593e293944d979884 /src | |
| parent | 3f2b7e63ba15cf33475116d32e8b7d22208a8438 (diff) | |
| download | niri-2415346caaa4121ed202b8e376fb40b2a44eb61f.tar.gz niri-2415346caaa4121ed202b8e376fb40b2a44eb61f.tar.bz2 niri-2415346caaa4121ed202b8e376fb40b2a44eb61f.zip | |
layer-shell: properly handle re-map
According to the zwlr_layer_surface_v1 documentation: Unmapping a
layer_surface means that the surface cannot be shown by the compositor
until it is explicitly mapped again. The layer_surface returns to the
state it had right after layer_shell.get_layer_surface. The client can
re-map the surface by performing a commit without any buffer attached,
waiting for a configure event and handling it as usual.
Before this commit, no configure event was sent when a client performed
a commit without any buffer attached.
Diffstat (limited to 'src')
| -rw-r--r-- | src/handlers/layer_shell.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/handlers/layer_shell.rs b/src/handlers/layer_shell.rs index 7678ccc1..c1b00c30 100644 --- a/src/handlers/layer_shell.rs +++ b/src/handlers/layer_shell.rs @@ -176,6 +176,20 @@ impl State { } else { self.niri.mapped_layer_surfaces.remove(layer); self.niri.unmapped_layer_surfaces.insert(surface.clone()); + + // After layer surface unmaps it has to perform the initial commit-configure + // sequence again. This is a workaround until Smithay properly resets + // initial_configure_sent upon the surface unmapping itself as it does for + // toplevels. + with_states(surface, |states| { + let mut data = states + .data_map + .get::<LayerSurfaceData>() + .unwrap() + .lock() + .unwrap(); + data.initial_configure_sent = false; + }); } } else { let scale = output.current_scale(); |
