Skip to content

fix(linux): use resize cursor when within the defined inset for an undecorated webkitgtk window - #15701

Merged
amrbashir merged 8 commits into
tauri-apps:devfrom
yobson1:webkitgtk-resize-cursor
Jul 28, 2026
Merged

amrbashir merged 8 commits into
tauri-apps:devfrom
yobson1:webkitgtk-resize-cursor

Conversation

@yobson1

@yobson1 yobson1 commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

while undecorated_resizing.rs handled the event to actually enable the resizing within the defined 5 pixel inset around the window it didn't handle changing the cursor to the appropriate type like w-resize or whichever cursor type for the respective side/corner the cursor is hovering.

this PR fixes that by listening to the connect_motion_notify_event, using the same logic to determine when we should be resizing as the existing code did and then using window.set_cursor to set the appropriate cursor for the resize.

additionally in connect_button_press_event we return Propagation::Stop instead of Propagation::Proceed because we have already determined this event is for resizing the window and claimed it, allowing it to continue to propagate can cause conflicts where the app tries to use the same event for something else like dragging via a custom top bar decoration.

included is also some basic refactors to extract logic that was being shared between the 3 webview event listeners and changing some ifs to guard clauses instead of nesting them a bunch.

i tested this on Kesomannen/gale which is a tauri app that exhibited this behaviour of no cursor type change near the edge for resizing due to it being undecorated and using this patched version of tauri addresses the issue nicely.

before:
the window was able to be resized if you were within the 5 pixel inset but there was no indication that was the case by the cursor changing (the cursor changes you can see in the clip are only AFTER i hold down LMB and begin the resize)

rrKGcjBil.mp4

after:
resizing works as normal and the cursor now correctly updates to reflect where you can resize from

6tXdL4AGl.mp4

ref: Kesomannen/gale#226

@yobson1
yobson1 requested a review from a team as a code owner July 11, 2026 11:44
@github-actions

github-actions Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Package Changes Through 1a2305b

There are 14 changes which include tauri with minor, tauri-cli with minor, @tauri-apps/cli with minor, tauri-runtime with minor, tauri-runtime-wry with minor, tauri-utils with minor, tauri-bundler with minor, tauri-build with minor, tauri-macos-sign with minor, tauri-codegen with minor, tauri-macros with minor, tauri-plugin with minor, tauri-driver with minor, @tauri-apps/api with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.11.1 2.12.0
tauri-utils 2.9.3 2.10.0
tauri-macos-sign 2.3.4 2.4.0
tauri-bundler 2.9.4 2.10.0
tauri-runtime 2.11.3 2.12.0
tauri-runtime-wry 2.11.4 2.12.0
tauri-codegen 2.6.3 2.7.0
tauri-macros 2.6.3 2.7.0
tauri-plugin 2.6.3 2.7.0
tauri-build 2.6.3 2.7.0
tauri 2.11.5 2.12.0
@tauri-apps/cli 2.11.4 2.12.0
tauri-cli 2.11.4 2.12.0
tauri-driver 2.0.6 2.1.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Comment thread .changes/webkitgtk-resize-cursor.md Resolved

@amrbashir amrbashir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@amrbashir
amrbashir merged commit 5a882ec into tauri-apps:dev Jul 28, 2026
23 checks passed
OlympusLedgerOrg added a commit to OlympusLedgerOrg/tauri that referenced this pull request Aug 3, 2026
Completes the 2026-08-03 upstream sync. tauri-apps#15307 bumped
crates/tauri-runtime-wry to tao 0.36.0 / wry 0.56.0, which left
[patch.crates-io] pointing at ports/ trees still at 0.35.3 / 0.55.1. Cargo
did not error on that -- it silently dropped both patches and resolved
stock GTK3 tao/wry from crates.io, bypassing the GTK4/WebKit6 port
entirely. Both ports are now at the required versions and both patches are
back in the crate graph.

Method: each port was reconstructed as a git branch off the upstream commit
it was actually built from (tao 722aad90, wry 09f088e9 -- both on dev, ahead
of their tags, which is why the ports were already much closer to 0.36/0.56
than to 0.35.3/0.55.1), then upstream's release tag was merged in. This kept
the port's own changes as the "ours" side of a real 3-way merge rather than
replaying patches. All of platform_impl/linux -- the GTK4 surface -- merged
without conflict. Per-conflict reasoning is in the two port merge commits.

Also fixes crates/tauri/src/app.rs from the previous commit: resolving that
conflict with --ours took the whole file and so discarded upstream's
tauri-apps#15766 clone reduction in App::run. The file is now upstream's,
with only the fork's supports_multiple_windows early return re-applied.

Lockfiles regenerated:
- Cargo.lock: cargo metadata now resolves tao 0.36.0, wry 0.56.0, muda,
  tray-icon and wayland-scanner to the local paths, with no
  "patch ... was not used" warnings.
- pnpm-lock.yaml: regenerated so the merged pnpm-workspace.yaml overrides
  are reflected, including the fork's brace-expansion, js-yaml and sharp
  audit remediations, which upstream's lockfile did not carry.

NOT COMPILE VERIFIED. This was done on Windows; the GTK4/WebKit6 code is
Linux-only and cannot be built or cross-compiled here. Dependency resolution
is verified, the source is not. Needs a Linux build plus the fork's CI
before merging.

Still deferred: upstream tauri-apps#15701 (resize cursor within the inset
for undecorated webkitgtk windows) remains unported to GTK4 -- see the
previous commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants