From ce2414fe0cdec18cf2df65ae2f9fc5581609673f Mon Sep 17 00:00:00 2001 From: Adrien Prokopowicz <6529475+prokopyl@users.noreply.github.com> Date: Wed, 26 Aug 2026 15:50:48 +0200 Subject: [PATCH 1/2] X11: Do not report a parent window change back to the host --- examples/plugin_clack/src/gui.rs | 2 ++ src/platform/x11/event_loop.rs | 17 +++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/examples/plugin_clack/src/gui.rs b/examples/plugin_clack/src/gui.rs index f3d58cda..54263011 100644 --- a/examples/plugin_clack/src/gui.rs +++ b/examples/plugin_clack/src/gui.rs @@ -77,6 +77,8 @@ impl PluginGuiImpl for ExamplePluginMainThread<'_> { fn can_resize(&mut self) -> bool { let Some(gui) = &self.gui else { return false }; + dbg!("can_resize", gui.handle.is_resizable()); + gui.handle.is_resizable() } diff --git a/src/platform/x11/event_loop.rs b/src/platform/x11/event_loop.rs index 2813d7b4..9aad89fe 100644 --- a/src/platform/x11/event_loop.rs +++ b/src/platform/x11/event_loop.rs @@ -171,6 +171,7 @@ impl EventLoop { } fn handle_coalesced_resize_events(&mut self) -> Result<(), FatalError> { + let mut comes_from_parent = false; if let Some(new_parent_size) = self.new_parent_size.take() { if new_parent_size != self.window.get_size() { // The parent was resized, which means we should resize ourselves too. @@ -180,6 +181,7 @@ impl EventLoop { // Makes the rest of this function run on the new parent size immediately (without waiting for a ConfigureNotify round-trip) // Also overrides any new sizes we may have received this event loop iteration,it would probably be invalidated anyway self.new_size = Some(new_parent_size); + comes_from_parent = true; } } } @@ -198,21 +200,24 @@ impl EventLoop { warn!("Window Handler failed to resize: {}", e); self.window.store_size(previous); self.window.xcb_window.resize(previous.cast())?.check_warn(); - } else { - // Host requests use resize_immediately, which stops the previous == new_size condition - // So if we're here, it's guaranteed not to be from a host request + return Ok(()); + } + + // Host requests use resize_immediately, which stops the previous == new_size condition + // So if we're here, it's guaranteed not to be from a host request + if !comes_from_parent { if let Some(host) = self.main_thread.as_mut() { host.send(HostCallback::Resized { new_size, previous: WindowSize::from_physical(previous.cast(), scale_factor), })?; } - - // Immediately schedule a redraw, do not wait for an "expose" event - self.exposed = true; } + // Immediately schedule a redraw, do not wait for an "expose" event + self.exposed = true; + Ok(()) } From f740515315f42b84612cdb14a5cb63ad8703e3c8 Mon Sep 17 00:00:00 2001 From: Adrien Prokopowicz <6529475+prokopyl@users.noreply.github.com> Date: Wed, 26 Aug 2026 15:51:45 +0200 Subject: [PATCH 2/2] remove dbg --- examples/plugin_clack/src/gui.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/plugin_clack/src/gui.rs b/examples/plugin_clack/src/gui.rs index 54263011..f3d58cda 100644 --- a/examples/plugin_clack/src/gui.rs +++ b/examples/plugin_clack/src/gui.rs @@ -77,8 +77,6 @@ impl PluginGuiImpl for ExamplePluginMainThread<'_> { fn can_resize(&mut self) -> bool { let Some(gui) = &self.gui else { return false }; - dbg!("can_resize", gui.handle.is_resizable()); - gui.handle.is_resizable() }