fix(linux): prevent firing duplicate mouse events (fixes #939) - #941
Conversation
|
Thanks for help fix this issue! Could you add a change file before it can be merged? |
|
Should be good now 👍 |
Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
|
@jbolda Do you know why covector returned error here? It seems fine for me. |
|
This is because, PR is from a fork, it is a known issue, wet can ignore it for now |
| } | ||
| } | ||
| glib::Propagation::Proceed | ||
| glib::Propagation::Stop |
There was a problem hiding this comment.
How does this change affects Widgets added inside the window, do they still receive events? or will be swallowed by these handlers here?
There was a problem hiding this comment.
Is there a way I can easily test that?
There was a problem hiding this comment.
you can get the gtk window created by tao using https://docs.rs/tao/latest/tao/platform/unix/trait.WindowExtUnix.html#tymethod.gtk_window and then you can create a gtk Button https://docs.rs/gtk/latest/gtk/struct.Button.html and add it to the window using gtk_window.add(), then you will need to add these same handlers on the button you created, and ensure:
- the button can be clicked normally
- the handlers on the button are triggered
There was a problem hiding this comment.
The button worked fine, I checked all three event handlers and they fire correctly as well. Should be good to go!
This reverts tauri-apps#941, which broke CSD event handling on Wayland. A new fix for tauri-apps#939 might now be needed. Fixes tauri-apps/tauri#13440 Might fix (unconfirmed) tauri-apps/tauri#11856
…cessary (#1218) * fix(wayland): remove broken custom CSD The default client side decoration handling of GTK is now used once again. Custom CSD don't make any sense when no custom widgets are added to the title bar. Futhermore, the custom CSD didn't work correctly and introduced multiple bugs regarding the titlebar and server-side rendering on Wayland. This is mostly a revert of #979. Fixes #1046, tauri-apps/tauri#13749, tauri-apps/tauri#14251, tauri-apps/tauri#14748 Supersedes #1055 * fix(wayland): propagate window events for CSD This reverts #941, which broke CSD event handling on Wayland. A new fix for #939 might now be needed. Fixes tauri-apps/tauri#13440 Might fix (unconfirmed) tauri-apps/tauri#11856 * fix(wayland): ensure compositors don't force decorations This enables CSD for undecorated windows to ensure that compositors with server-side decoration support (e.g. KDE Plasma) do not apply them when decorations are disabled for the window. Changing the decoration state for existing windows is however still not supported. This is a workaround for a GTK bug: https://gitlab.gnome.org/GNOME/gtk/-/work_items/5479 Fixes #899, tauri-apps/tauri#6562 * chore: add changelog entry for Wayland CSD fixes * fix(linux): reapply maximize fix from #979 This ensures that the window is resizable before maximizing it to avoid unexpected behavior. * Revert "fix(wayland): propagate window events for CSD" This reverts commit 25edb8e. * Reapply "fix(wayland): propagate window events for CSD" This reverts commit 6b11c08. * enable min/max buttons * prevent crash on wsl/weston when maximizing undecorated window * prevent duplicate mouse events * keep default decorations --------- Co-authored-by: Fabian-Lars <30730186+FabianLars@users.noreply.github.com>
Prevents the press, release, and motion events from firing twice on Linux, fixing #939.