Skip to content

fix(wayland): [Workaround] disable WebGTK legacy rendering tech#2124

Open
M3TIOR wants to merge 5 commits intosafing:developmentfrom
M3TIOR:webgtk-wayland-patch
Open

fix(wayland): [Workaround] disable WebGTK legacy rendering tech#2124
M3TIOR wants to merge 5 commits intosafing:developmentfrom
M3TIOR:webgtk-wayland-patch

Conversation

@M3TIOR
Copy link
Copy Markdown

@M3TIOR M3TIOR commented Feb 6, 2026

Disabled incompatible WebGTK rendering pipelines outside known X11 sessions. For a more detailed writeup on the issue see:
flusterIO/fluster#11

This project inherits the same bugs thanks to using Taury and depending on the system's webview (in this case WebGTK) implementation.

NOTE: This is untested code, I couldn't run a test build because your build system requires I be authenticated to Github for some reason! Also, it seemed like it scanned my LAN for SSH targets? I'm going to assume good faith but I know that's a bad idea. Really bums me out I can't validate this build for you before pushing it.

On my own rig I've done a temporary fix by wrapping the .desktop UI execution lines with a call to /usr/bin/env. But the below method is more maintainable in the event you encounter systems which run another system session like Ubuntu tried to implement at one point. Hopefully my POSIX shell script doesn't contain any errors.

Summary by CodeRabbit

  • Chores

    • Linux packaging updated so the app launcher now delegates to a new UI wrapper for improved startup behavior.
    • Installer now conditionally relocates the app binary, ensures the wrapper is executable, and updates the launcher symlink to use it.
    • Added a shared packaging asset for consistent installs across Debian and RPM.
  • Stability

    • Launch routine auto-adjusts rendering and compositing for X11 vs Wayland to improve compatibility and reduce startup issues.

Disabled incompatible WebGTK rendering pipelines outside known X11 sessions.
For a more detailed writeup on the issue see:
        flusterIO/fluster#11

This project inherits the same bugs thanks to using Taury and depending on
the system's webview (in this case WebGTK) implementation.
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 6, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 6, 2026

📝 Walkthrough

Walkthrough

Adds a new Linux UI wrapper script and installs it via updated Tauri packaging; postinst now conditionally relocates an existing /usr/bin/portmaster (if it is not a symlink or is missing), ensures the wrapper is executable, and forcefully symlinks /usr/bin/portmaster to /usr/lib/portmaster/ui-wrapper. The wrapper detects session type (via loginctl when available) and adjusts WebKit/compositing environment before launching portmaster-ui.

Changes

Cohort / File(s) Summary
Tauri packaging config
desktop/tauri/src-tauri/tauri.conf.json5
Added file mappings to install /usr/lib/portmaster/ui-wrapper into both Debian and RPM package file lists.
Installer script
packaging/linux/postinst
Changed relocation logic: only move /usr/bin/portmaster when it's not a symlink or doesn't exist at the target location; make /usr/lib/portmaster/ui-wrapper executable and create a forceful symlink /usr/bin/portmaster/usr/lib/portmaster/ui-wrapper. Comments added to clarify conditional behavior.
UI wrapper script
packaging/linux/ui-wrapper
New shell wrapper that queries loginctl (if present) for session type; for X11 it execs portmaster-ui directly, otherwise (or when loginctl is absent) it sets WEBKIT_DISABLE_DMABUF_RENDERING=1 and WEBKIT_DISABLE_COMPOSITING_MODE=1 before exec'ing portmaster-ui.

Sequence Diagram(s)

mermaid
sequenceDiagram
participant Installer as Installer (postinst)
participant FS as Filesystem
participant User as User / Launcher
participant Wrapper as /usr/lib/portmaster/ui-wrapper
participant loginctl as loginctl (systemd)
participant App as portmaster-ui
Installer->>FS: check if /usr/bin/portmaster is a symlink / exists
alt not a symlink or target missing
Installer->>FS: move /usr/bin/portmaster -> /usr/lib/portmaster/portmaster-ui
end
Installer->>FS: chmod +x /usr/lib/portmaster/ui-wrapper
Installer->>FS: ln -srf ../lib/portmaster/ui-wrapper /usr/bin/portmaster
User->>FS: run /usr/bin/portmaster (symlink)
FS->>Wrapper: invoke ui-wrapper
Wrapper->>loginctl: query session type (if available)
alt session == X11
Wrapper->>App: exec portmaster-ui
else session != X11 or loginctl unavailable
Wrapper->>Wrapper: export WEBKIT_DISABLE_DMABUF_RENDERING=1\nexport WEBKIT_DISABLE_COMPOSITING_MODE=1
Wrapper->>App: exec portmaster-ui
end

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title focuses on disabling WebGTK legacy rendering for Wayland compatibility, which directly matches the main change: adding a ui-wrapper script with conditional rendering behavior and updating packaging to use it.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
desktop/tauri/src-tauri/tauri.conf.json5 (1)

96-123: ⚠️ Potential issue | 🔴 Critical

RPM files section is missing the ui-wrapper mapping — RPM postinst will break.

The ui-wrapper was added to deb.files (line 82) but not to rpm.files. Since both package types share the same postinst script (which runs chmod +x /usr/lib/portmaster/ui-wrapper and ln -srf … ui-wrapper …), RPM installs will fail because the file won't exist on disk.

Proposed fix — add the mapping to rpm.files
          "/var/lib/portmaster/intel/news.yaml"         : "intel/news.yaml",

+         // Scripts
+         "/usr/lib/portmaster/ui-wrapper": "../../../packaging/linux/ui-wrapper",
+
          // Shortcut
          "/etc/xdg/autostart/portmaster.desktop": "../../../packaging/linux/portmaster-autostart.desktop"
🤖 Fix all issues with AI agents
In `@packaging/linux/postinst`:
- Around line 66-68: Guard the move of the original binary and make the symlink
idempotent: before calling mv /usr/bin/portmaster
/usr/lib/portmaster/portmaster-ui ensure the source is a regular file (e.g. test
-f /usr/bin/portmaster) so the mv only runs when there is something to move, and
change the ln invocation creating /usr/bin/portmaster to use -srf (or at least
-sr -f) so creating the symlink to /usr/lib/portmaster/ui-wrapper is forced and
won’t fail if the symlink already exists; keep the chmod +x
/usr/lib/portmaster/ui-wrapper step as-is.

In `@packaging/linux/ui-wrapper`:
- Line 17: Fix the typo in the shell comment that currently reads
"compatability" by replacing it with "compatibility" in the line starting with
"# Assume worst case scenario for compatability with Wayland in" so the comment
correctly reads "compatibility".
- Line 5: The conditional uses incorrect redirection in the line `if command -v
"loginctl" 1>&2 2>/dev/null; then` which causes stdout to leak to stderr; change
the redirection order so both stdout and stderr are discarded (e.g., redirect
stdout to /dev/null then redirect stderr to stdout) by replacing that
redirection sequence with the standard form that silences both streams for the
`command -v "loginctl"` check.
- Around line 1-22: The script uses a shebang with -e which causes the script to
exit if the loginctl invocation fails, preventing the else fallback; change to
remove the -e behavior and defensively capture the session type into a variable
(e.g., SESSION_TYPE="$(loginctl -P Type show-session auto 2>/dev/null || true)")
then test SESSION_TYPE in the case statement, and keep the single export/exec
path that sets WEBKIT_DISABLE_DMABUF_RENDERER and
WEBKIT_DISABLE_COMPOSITING_MODE before exec /usr/lib/portmaster/portmaster-ui
"$@" so failures in loginctl fall through to the Wayland-compatible defaults
rather than aborting the script.

Comment thread packaging/linux/postinst Outdated
Comment thread packaging/linux/ui-wrapper
Comment thread packaging/linux/ui-wrapper Outdated
Comment thread packaging/linux/ui-wrapper Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@packaging/linux/postinst`:
- Line 69: Fix the typo in the shell comment that reads "# Checksum command
nomrally dumps other info besides the actual checksum" by changing "nomrally" to
"normally" so the comment reads "# Checksum command normally dumps other info
besides the actual checksum" (update the comment in the postinst script where
that line appears).
- Around line 68-77: The checksum guard is fragile and can mis-trigger when
/usr/bin/portmaster is missing; replace it with a robust file-type and existence
check: detect if /usr/bin/portmaster exists and is a symlink pointing to
/usr/lib/portmaster/ui-wrapper (use readlink -f or test -L plus comparison) and
only skip the mv when that is true; otherwise, if /usr/bin/portmaster exists and
is not the symlink, move it to /usr/lib/portmaster/portmaster-ui (ensure you
test -e before invoking mv to avoid errors). Ensure you remove or stop using the
cksum() function and update the conditional that currently compares "$(cksum
/usr/bin/portmaster)" to "$(cksum /usr/lib/portmaster/ui-wrapper)" to the new
existence/symlink check.

Comment thread packaging/linux/postinst Outdated
Comment thread packaging/linux/postinst Outdated
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