aboutsummaryrefslogtreecommitdiff
path: root/src/handlers
diff options
context:
space:
mode:
Diffstat (limited to 'src/handlers')
-rw-r--r--src/handlers/compositor.rs17
-rw-r--r--src/handlers/layer_shell.rs18
-rw-r--r--src/handlers/mod.rs12
-rw-r--r--src/handlers/xdg_shell.rs5
4 files changed, 14 insertions, 38 deletions
diff --git a/src/handlers/compositor.rs b/src/handlers/compositor.rs
index 034ee0d0..cf2efaaf 100644
--- a/src/handlers/compositor.rs
+++ b/src/handlers/compositor.rs
@@ -14,7 +14,7 @@ use smithay::wayland::compositor::{
SurfaceAttributes,
};
use smithay::wayland::dmabuf::get_dmabuf;
-use smithay::wayland::shell::xdg::XdgToplevelSurfaceData;
+use smithay::wayland::shell::xdg::ToplevelCachedState;
use smithay::wayland::shm::{ShmHandler, ShmState};
use smithay::{delegate_compositor, delegate_shm};
@@ -286,13 +286,14 @@ impl CompositorHandler for State {
.buffer_delta
.take();
- let role = states
- .data_map
- .get::<XdgToplevelSurfaceData>()
- .unwrap()
- .lock()
- .unwrap();
- (role.configure_serial, buffer_delta)
+ let serial = states
+ .cached_state
+ .get::<ToplevelCachedState>()
+ .current()
+ .last_acked
+ .as_ref()
+ .map(|c| c.serial);
+ (serial, buffer_delta)
});
if serial.is_none() {
error!("commit on a mapped surface without a configured serial");
diff --git a/src/handlers/layer_shell.rs b/src/handlers/layer_shell.rs
index fd2c592f..7678ccc1 100644
--- a/src/handlers/layer_shell.rs
+++ b/src/handlers/layer_shell.rs
@@ -174,24 +174,8 @@ impl State {
self.niri.layer_shell_on_demand_focus = Some(layer.clone());
}
} else {
- let was_mapped = self.niri.mapped_layer_surfaces.remove(layer).is_some();
+ 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.
- if was_mapped {
- 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();
diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs
index 5878e3be..8518f8f9 100644
--- a/src/handlers/mod.rs
+++ b/src/handlers/mod.rs
@@ -19,7 +19,6 @@ use smithay::input::pointer::{
use smithay::input::{keyboard, Seat, SeatHandler, SeatState};
use smithay::output::Output;
use smithay::reexports::rustix::fs::{fcntl_setfl, OFlags};
-use smithay::reexports::wayland_protocols::xdg::shell::server::xdg_toplevel;
use smithay::reexports::wayland_protocols_wlr::screencopy::v1::server::zwlr_screencopy_manager_v1::ZwlrScreencopyManagerV1;
use smithay::reexports::wayland_server::protocol::wl_data_source::WlDataSource;
use smithay::reexports::wayland_server::protocol::wl_output::WlOutput;
@@ -92,7 +91,7 @@ use crate::protocols::virtual_pointer::{
VirtualPointerInputBackend, VirtualPointerManagerState, VirtualPointerMotionAbsoluteEvent,
VirtualPointerMotionEvent,
};
-use crate::utils::{output_size, send_scale_transform, with_toplevel_role};
+use crate::utils::{output_size, send_scale_transform};
use crate::{
delegate_ext_workspace, delegate_foreign_toplevel, delegate_gamma_control,
delegate_mutter_x11_interop, delegate_output_management, delegate_screencopy,
@@ -543,15 +542,6 @@ impl ForeignToplevelHandler for State {
fn set_fullscreen(&mut self, wl_surface: WlSurface, wl_output: Option<WlOutput>) {
if let Some((mapped, current_output)) = self.niri.layout.find_window_and_output(&wl_surface)
{
- let has_fullscreen_cap = with_toplevel_role(mapped.toplevel(), |role| {
- role.current
- .capabilities
- .contains(xdg_toplevel::WmCapabilities::Fullscreen)
- });
- if !has_fullscreen_cap {
- return;
- }
-
let window = mapped.window.clone();
if let Some(requested_output) = wl_output.as_ref().and_then(Output::from_resource) {
diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs
index 970dcb5b..5d8adc06 100644
--- a/src/handlers/xdg_shell.rs
+++ b/src/handlers/xdg_shell.rs
@@ -1259,8 +1259,9 @@ pub fn add_mapped_toplevel_pre_commit_hook(toplevel: &ToplevelSurface) -> HookId
.unwrap()
.lock()
.unwrap();
+ let serial = role.last_acked.as_ref().map(|c| c.serial);
- (got_unmapped, dmabuf, role.configure_serial)
+ (got_unmapped, dmabuf, serial)
});
let mut transaction_for_dmabuf = None;
@@ -1305,7 +1306,7 @@ pub fn add_mapped_toplevel_pre_commit_hook(toplevel: &ToplevelSurface) -> HookId
}
animate = mapped.should_animate_commit(serial);
- } else {
+ } else if !got_unmapped {
error!("commit on a mapped surface without a configured serial");
};