aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2023-09-29 13:54:15 +0400
committerIvan Molodetskikh <yalterz@gmail.com>2023-09-29 13:54:15 +0400
commitc7057ca0d8f1af0296b19aac733adf874e285984 (patch)
tree9cc99026d53c38a53239027505c7740e89613f4b /src
parent5cdd188d4b05f65a81689568f770f29356757b87 (diff)
downloadniri-c7057ca0d8f1af0296b19aac733adf874e285984.tar.gz
niri-c7057ca0d8f1af0296b19aac733adf874e285984.tar.bz2
niri-c7057ca0d8f1af0296b19aac733adf874e285984.zip
Extract initial_configure_sent
Diffstat (limited to 'src')
-rw-r--r--src/handlers/xdg_shell.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/handlers/xdg_shell.rs b/src/handlers/xdg_shell.rs
index b666d7c2..252ca0ac 100644
--- a/src/handlers/xdg_shell.rs
+++ b/src/handlers/xdg_shell.rs
@@ -211,7 +211,13 @@ impl KdeDecorationHandler for State {
delegate_kde_decoration!(State);
pub fn send_initial_configure_if_needed(toplevel: &ToplevelSurface) {
- let initial_configure_sent = with_states(toplevel.wl_surface(), |states| {
+ if !initial_configure_sent(toplevel) {
+ toplevel.send_configure();
+ }
+}
+
+fn initial_configure_sent(toplevel: &ToplevelSurface) -> bool {
+ with_states(toplevel.wl_surface(), |states| {
states
.data_map
.get::<XdgToplevelSurfaceData>()
@@ -219,11 +225,7 @@ pub fn send_initial_configure_if_needed(toplevel: &ToplevelSurface) {
.lock()
.unwrap()
.initial_configure_sent
- });
-
- if !initial_configure_sent {
- toplevel.send_configure();
- }
+ })
}
impl State {