Skip to content

Add Linux preview with native monitoring and MangoHud FPS support - #68

Closed
Crispyuxd wants to merge 7 commits into
mainfrom
feat/linux-support
Closed

Crispyuxd wants to merge 7 commits into
mainfrom
feat/linux-support

Conversation

@Crispyuxd

@Crispyuxd Crispyuxd commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Cleanmeter currently relies on Windows-only hardware and frame monitoring. This adds a Linux x86-64 preview with native CPU/RAM/network monitoring, available AMD/Intel sysfs and NVIDIA driver readings, and sampled game FPS/frametime through MangoHud 0.7+.

Linux builds produce DEB, RPM, and AppImage packages without the Windows sidecar. X11/XWayland supports overlay positioning and global shortcuts; native Wayland uses a separate monitor window. The preview includes Linux autostart, controls for desktops without a tray, a game launcher, and a --diagnose command.

Validation

  • Successful Linux workflow for this head: 131 frontend tests, 32 Rust tests, and 5 launcher tests; lint and production build passed.
  • All three packages built; native sensor monitoring started under X11 and native Wayland.
  • A real Vulkan cube launched through the extracted AppImage's AppRun entry point supplied live FPS and frametime through MangoHud 0.7.2 on a software renderer.
  • Five pre-existing TypeScript diagnostics remain; physical GPU drivers, real Steam/Proton games, and Fedora installation still need testing.

Testing requested

@saadah7, please review and test this Linux preview on real hardware before merging.

  1. Download and extract cleanmeter-linux-x86_64, then install the DEB/RPM or make the AppImage executable and launch it.
  2. Check CPU, RAM, network, and available GPU readings against your usual monitoring tools. Check GPU selection, overlay visibility/positioning, shortcuts, and start at login.
  3. Install MangoHud 0.7.0 or newer. For host-installed Steam, use cleanmeter-run %command%; with AppImage, use "/absolute/path/Cleanmeter_2.2.17_amd64.AppImage" --run %command%. Keep Cleanmeter open separately.
  4. Test a native game and a Proton game, including switching the selected game, quitting/restarting it, and checking that FPS does not remain stale.
  5. If available, test both X11/XWayland and native Wayland. Confirm settings can be restored after minimizing and the app remains usable without a tray icon.

Setup guide and hardware coverage · Live FPS test evidence

Preview limitations

FPS/frametime are sampled, so percentile lows and benchmark recording are disabled. CPU power is not collected, and GPU sensor availability depends on the driver. Native Wayland cannot provide absolute overlay placement/global shortcuts; fullscreen visibility depends on the compositor. Flatpak/Snap Steam and Gamescope are not validated. Linux updates require manually installing a new package.


Note

Medium Risk
Large cross-platform branching in startup, monitoring, and overlay behavior increases regression risk on Windows if cfg gates are wrong; Linux preview relies on distro drivers, MangoHud, and compositor behavior not fully covered in CI.

Overview
Adds a Linux x86-64 preview that ships DEB/RPM/AppImage builds and documents setup in docs/linux.md, with a new Linux preview GitHub Actions workflow (lint/tests, package build, X11 and headless Wayland smoke tests, and a follow-up job that validates live MangoHud FPS via vkcube).

On Linux, the app stops using the Windows HardwareMonitor pipe/sidecar and instead runs a native Rust monitor (linux_sensors, linux_monitor) that reads /proc//sys, optional nvidia-smi, and MangoHud 0.7+ CSV logs for sampled game FPS/frametime. A bundled cleanmeter-run launcher (plus cleanmeter --run / --diagnose entry points) wraps games for Steam/native launches; XDG autostart replaces the Windows scheduled-task path.

Tauri bundling is split so Linux packages exclude Windows sidecar resources (tauri.linux.conf.json / tauri.windows.conf.json). The UI and Rust shell gain a get_platform_info capability layer: native Wayland drops global shortcuts and absolute overlay positioning (decorated monitor window), percentile lows and in-app updates are disabled on Linux, tray failures are tolerated, and settings/overlay show Linux-specific controls and dashes for missing sensors.

Reviewed by Cursor Bugbot for commit abf6e59. Bugbot is set up for automated code reviews on this repo. Configure here.

@Crispyuxd
Crispyuxd requested a review from saadah7 September 7, 2026 13:52
@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_bcc6b72f-642f-406f-b651-81a8c1b6b506)

@coderabbitai

coderabbitai Bot commented Sep 7, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This change adds Linux support for hardware monitoring and MangoHud-based FPS sampling. It adds Linux sensor, FPS, monitoring, diagnostics, autostart, and launcher modules. The Tauri runtime and frontend now detect platform capabilities and adapt Wayland behavior, overlay controls, sensor display, shortcuts, settings, and updates. Linux DEB, RPM, and AppImage bundles are configured. Documentation and GitHub Actions jobs cover builds, smoke tests, and live FPS validation.

Merge Risk: 🟡 Moderate · up to abf6e

Linux preview behavior can be incorrect under valid Wayland configurations, interrupted games may outlive telemetry cleanup, and some cache layouts or persistent sensor failures can disrupt monitoring. These material issues should be addressed before merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 71 functions across 27 files. (8 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: Linux preview support, native monitoring, and MangoHud FPS integration.
Description check ✅ Passed The description directly explains the Linux preview, monitoring implementation, MangoHud integration, packaging, validation, testing requests, and known limitations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 40.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 71 functions across 27 files. (8 skipped: 8 unsupported.)

  • Fix all pre-merge checks with AI

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

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

⚠️ Outside diff range comments (1)
tauri-app/src/OverlayApp.tsx (1)

319-319: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Disable the drag cursor when positioning is unavailable.

On native Wayland, Line 319 can show a grab cursor for a saved useCustomPosition value, but Line 234 rejects the drag. Include canPosition in draggable.

Proposed fix
-  const draggable = settings.useCustomPosition;
+  const draggable = canPosition && settings.useCustomPosition;

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 458dc327-5511-4782-b312-031fcdcc458a

📥 Commits

Reviewing files that changed from the base of the PR and between 59c5bda and abf6e59.

📒 Files selected for processing (35)
  • .github/workflows/linux.yml
  • README.md
  • docs/linux.md
  • tauri-app/src-tauri/Cargo.toml
  • tauri-app/src-tauri/linux/cleanmeter-run
  • tauri-app/src-tauri/linux/test_launcher.py
  • tauri-app/src-tauri/src/commands.rs
  • tauri-app/src-tauri/src/lib.rs
  • tauri-app/src-tauri/src/linux_autostart.rs
  • tauri-app/src-tauri/src/linux_fps.rs
  • tauri-app/src-tauri/src/linux_monitor.rs
  • tauri-app/src-tauri/src/linux_sensors.rs
  • tauri-app/src-tauri/src/main.rs
  • tauri-app/src-tauri/src/platform.rs
  • tauri-app/src-tauri/src/shortcuts.rs
  • tauri-app/src-tauri/src/tray.rs
  • tauri-app/src-tauri/tauri.conf.json
  • tauri-app/src-tauri/tauri.linux.conf.json
  • tauri-app/src-tauri/tauri.windows.conf.json
  • tauri-app/src/App.tsx
  • tauri-app/src/OverlayApp.tsx
  • tauri-app/src/components/overlay/CpuSection.tsx
  • tauri-app/src/components/overlay/FpsSection.tsx
  • tauri-app/src/components/overlay/GpuSection.tsx
  • tauri-app/src/components/settings/LinuxSupport.tsx
  • tauri-app/src/components/settings/TopBar.tsx
  • tauri-app/src/components/settings/help/FaqSection.tsx
  • tauri-app/src/components/settings/settings/SettingsTab.tsx
  • tauri-app/src/components/settings/stats/FpsSection.tsx
  • tauri-app/src/components/settings/stats/StatsTab.tsx
  • tauri-app/src/components/settings/style/PositionGrid.tsx
  • tauri-app/src/hooks/useHotkey.ts
  • tauri-app/src/hooks/useSensorData.ts
  • tauri-app/src/lib/tauri.ts
  • tauri-app/src/stores/platform-store.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.

Comment on lines +21 to +22
- uses: actions/checkout@v4
- uses: actions/setup-node@v4

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- workflow ---'
cat -n .github/workflows/linux.yml
printf '%s\n' '--- action-pinning policy references ---'
rg -n -i 'pin|sha|action' .github .yamllint.yml .pre-commit-config.yaml 2>/dev/null || true

Repository: SupaStellar/Cleanmeter

Length of output: 8770


Security Misconfiguration (CWE-829): Inclusion of Functionality from Untrusted Control Sphere

Reachability: External · Exploitability: Moderate

Pin each GitHub Action to a commit SHA.

@v4, @v2, and @stable are mutable references. A retargeted or compromised tag can execute arbitrary code in the runner with workspace access and the read-only GITHUB_TOKEN. Pin every action to a full commit SHA and retain the release version in a comment.

🧰 Tools
🪛 zizmor (1.29.0)

[warning] 21-21: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 21-21: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 22-22: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)

Source: Linters/SAST tools

child=
cleanup() { rm -rf -- "$session"; }
trap cleanup EXIT
trap 'if [ -n "$child" ]; then kill -TERM "$child" 2>/dev/null || true; fi' INT TERM

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/sh
# Verify that a trapped signal interrupts wait before a TERM-ignoring child exits.
set -eu
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT

cat > "$tmp/probe.sh" <<'SH'
#!/bin/sh
child=
cleanup() { printf 'cleanup\n'; }
trap cleanup EXIT
trap 'if [ -n "$child" ]; then kill -TERM "$child" 2>/dev/null || true; fi' INT TERM
sh -c 'trap "" TERM; sleep 2' &
child=$!
status=0
wait "$child" || status=$?
printf 'wait-status=%s\n' "$status"
SH
chmod +x "$tmp/probe.sh"

"$tmp/probe.sh" >"$tmp/output" &
wrapper=$!
sleep 1
kill -INT "$wrapper"
wait "$wrapper" || true
cat "$tmp/output"

Repository: SupaStellar/Cleanmeter

Length of output: 182


🤖 get_repo_knowledge executed:

get_repo_knowledge SupaStellar/Cleanmeter /tmp/coderabbit-repo-knowledge/supastellar-cleanmeter-bf513fbf

Length of output: 1195


🏁 Script executed:

#!/bin/sh
set -eu
printf '%s\n' '--- target file ---'
cat -n tauri-app/src-tauri/linux/cleanmeter-run
printf '%s\n' '--- related references ---'
rg -n --glob '!node_modules' 'cleanmeter-run|forward_and_wait|mangohud|session=' tauri-app/src-tauri tauri-app 2>/dev/null | head -120

Repository: SupaStellar/Cleanmeter

Length of output: 6731


🏁 Script executed:

#!/bin/sh
set -eu
cat -n tauri-app/src-tauri/linux/cleanmeter-run
printf '%s\n' '--- related references ---'
rg -n --glob '!node_modules' 'cleanmeter-run|mangohud|session=' tauri-app/src-tauri tauri-app 2>/dev/null | head -120

Repository: SupaStellar/Cleanmeter

Length of output: 6711


🏁 Script executed:

#!/bin/sh
set -eu
printf '%s\n' '--- target file ---'
sed -n '1,140p' tauri-app/src-tauri/linux/cleanmeter-run
printf '%s\n' '--- references ---'
rg -n --glob '!node_modules' 'cleanmeter-run|mangohud|session' tauri-app/src-tauri tauri-app 2>/dev/null | head -120

Repository: SupaStellar/Cleanmeter

Length of output: 10186


🏁 Script executed:

#!/bin/sh
set -eu
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
cat >"$tmp/probe.sh" <<'SH'
#!/bin/sh
set -u
start=$(date +%s)
child=
cleanup() { printf 'cleanup-at=%s\n' "$(( $(date +%s) - start ))"; }
trap cleanup EXIT
trap 'if [ -n "$child" ]; then printf "handler-at=%s\n" "$(( $(date +%s) - start )); kill -TERM "$child" 2>/dev/null || true; fi' INT TERM
sh -c 'trap "" TERM; sleep 4' &
child=$!
status=0
wait "$child" || status=$?
printf 'wait-status=%s elapsed=%s\n' "$status" "$(( $(date +%s) - start ))"
SH
chmod +x "$tmp/probe.sh"
"$tmp/probe.sh" >"$tmp/output" &
wrapper=$!
sleep 1
kill -INT "$wrapper"
wait "$wrapper" || true
cat "$tmp/output"

Repository: SupaStellar/Cleanmeter

Length of output: 197


🌐 Web query:

POSIX sh trapped signal wait command interrupted wait semantics dash trap wait

💡 Result:

According to the POSIX standard (IEEE Std 1003.1), when a shell is executing the wait utility and receives a signal for which a trap has been set, the wait utility must return immediately with an exit status greater than 128, after which the trap action associated with that signal is executed [1]. This requirement ensures that the shell can respond to asynchronous events even while blocked waiting for child processes. In practice, implementation behavior can vary significantly: 1. POSIX Requirement: The shell's wait command is required to be interrupted by a trapped signal [1]. This interruption triggers the execution of the trap action, allowing scripts to handle signals promptly [1]. 2. Dash Behavior: It has been documented that the dash shell historically does not interrupt the wait command when a trapped signal is received [2]. This deviates from the expected POSIX behavior, meaning the shell will continue to wait for the child process even if a signal handler is triggered or pending [2]. 3. Other Shells: Many other shells, such as bash, zsh, and mksh, generally adhere to the POSIX requirement, interrupting the wait command upon receipt of a trapped signal [2]. If you are developing portable shell scripts, you cannot rely on wait being interrupted by signals across all POSIX-compliant shells due to these implementation differences in shells like dash [2]. Using wait within a loop or employing other mechanisms to monitor process state and signals may be necessary if immediate responsiveness is required [2].

Citations:


Forward the received signal and reap the child before cleanup.

The trap converts SIGINT to SIGTERM. On shells that interrupt wait for trapped signals, line 49 can also return before the child exits, which removes $session while the child still runs. Use separate handlers that forward the signal and wait for the child.

Comment on lines +80 to +94
let sessions: Vec<PathBuf> = fs::read_dir(root)
.into_iter()
.flatten()
.filter_map(Result::ok)
.take(128)
.filter(|e| e.file_type().map(|t| t.is_dir()).unwrap_or(false))
.map(|e| e.path())
.collect();
for session in sessions {
for file in fs::read_dir(session)
.into_iter()
.flatten()
.filter_map(Result::ok)
.take(64)
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Apply the entry-count caps after the type and extension filters.

.take(128) runs before .filter(|e| ...is_dir()), and .take(64) runs before the .csv check. Both caps therefore bound raw directory entries, not matching entries. If the cache root holds 128 or more non-directory entries, every session directory is skipped and FPS reporting stops silently. The inner loop has the same shape for non-.csv files.

Move each take after its filter so the cap bounds the entries you actually read.

🔧 Proposed fix for the cap ordering
     let sessions: Vec<PathBuf> = fs::read_dir(root)
         .into_iter()
         .flatten()
         .filter_map(Result::ok)
-        .take(128)
         .filter(|e| e.file_type().map(|t| t.is_dir()).unwrap_or(false))
+        .take(128)
         .map(|e| e.path())
         .collect();
     for session in sessions {
         for file in fs::read_dir(session)
             .into_iter()
             .flatten()
             .filter_map(Result::ok)
+            .filter(|e| {
+                let p = e.path();
+                p.extension().and_then(|s| s.to_str()) == Some("csv")
+                    && !p.to_string_lossy().ends_with("_summary.csv")
+            })
             .take(64)
         {

If you adopt the inner filter, drop the now-duplicated continue guard at lines 96-100.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let sessions: Vec<PathBuf> = fs::read_dir(root)
.into_iter()
.flatten()
.filter_map(Result::ok)
.take(128)
.filter(|e| e.file_type().map(|t| t.is_dir()).unwrap_or(false))
.map(|e| e.path())
.collect();
for session in sessions {
for file in fs::read_dir(session)
.into_iter()
.flatten()
.filter_map(Result::ok)
.take(64)
{
let sessions: Vec<PathBuf> = fs::read_dir(root)
.into_iter()
.flatten()
.filter_map(Result::ok)
.filter(|e| e.file_type().map(|t| t.is_dir()).unwrap_or(false))
.take(128)
.map(|e| e.path())
.collect();
for session in sessions {
for file in fs::read_dir(session)
.into_iter()
.flatten()
.filter_map(Result::ok)
.filter(|e| {
let p = e.path();
p.extension().and_then(|s| s.to_str()) == Some("csv")
&& !p.to_string_lossy().ends_with("_summary.csv")
})
.take(64)
{

Comment on lines +163 to +175
Err(error) => {
if connected {
let _ = app.emit("pipe-status", PipeStatus { connected: false });
connected = false;
}
let status = SidecarStatus {
exits: 0,
spawn_error: Some(error),
};
if let Some(h) = app.try_state::<SidecarHealth>() {
*h.0.lock().unwrap() = status.clone();
}
let _ = app.emit("sidecar-status", status);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Emit sidecar-status only when the sample result changes.

The success path guards its status emit with if !connected. The error path has no such guard. If reader.sample keeps failing, this branch emits a sidecar-status event on every poll. At the minimum polling rate that is 10 events per second, indefinitely, and the failure is persistent by nature: /proc/stat or /proc/meminfo is either readable or it is not.

Gate the emit on the connected transition, as the success path already does.

🔧 Proposed fix to emit once per transition
             Err(error) => {
-                if connected {
-                    let _ = app.emit("pipe-status", PipeStatus { connected: false });
-                    connected = false;
-                }
                 let status = SidecarStatus {
                     exits: 0,
                     spawn_error: Some(error),
                 };
                 if let Some(h) = app.try_state::<SidecarHealth>() {
                     *h.0.lock().unwrap() = status.clone();
                 }
-                let _ = app.emit("sidecar-status", status);
+                if connected {
+                    let _ = app.emit("pipe-status", PipeStatus { connected: false });
+                    let _ = app.emit("sidecar-status", status);
+                    connected = false;
+                }
             }

connected starts as false, so a failure on the very first poll would no longer notify the webview. If you need that first report, track the last emitted error separately and emit when it changes.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Err(error) => {
if connected {
let _ = app.emit("pipe-status", PipeStatus { connected: false });
connected = false;
}
let status = SidecarStatus {
exits: 0,
spawn_error: Some(error),
};
if let Some(h) = app.try_state::<SidecarHealth>() {
*h.0.lock().unwrap() = status.clone();
}
let _ = app.emit("sidecar-status", status);
Err(error) => {
let status = SidecarStatus {
exits: 0,
spawn_error: Some(error),
};
if let Some(h) = app.try_state::<SidecarHealth>() {
*h.0.lock().unwrap() = status.clone();
}
if connected {
let _ = app.emit("pipe-status", PipeStatus { connected: false });
let _ = app.emit("sidecar-status", status);
connected = false;
}

Comment on lines +13 to +14
&& std::env::var("GDK_BACKEND")
.map(|s| s == "wayland")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🤖 get_repo_knowledge executed:

get_repo_knowledge SupaStellar/Cleanmeter /tmp/coderabbit-repo-knowledge/supastellar-cleanmeter-bf513fbf/conventions

Length of output: 3013


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- changed hunk ---'
git diff -- tauri-app/src-tauri/src/platform.rs
printf '%s\n' '--- platform.rs ---'
cat -n tauri-app/src-tauri/src/platform.rs
printf '%s\n' '--- direct references ---'
rg -n -C 4 'native_wayland|get_platform_info|GDK_BACKEND|global shortcut|global_shortcut|overlay|Wayland|X11' \
  tauri-app/src-tauri/src/lib.rs \
  tauri-app/src-tauri/src/commands.rs \
  tauri-app/src-tauri/src/shortcuts.rs \
  tauri-app/src-tauri/src/platform.rs

Repository: SupaStellar/Cleanmeter

Length of output: 41620


🌐 Web query:

GTK GDK_BACKEND comma-separated backend list selection order documentation

💡 Result:

In GTK applications, the GDK_BACKEND environment variable accepts a comma-separated list of backend names, which are evaluated in the order they are specified [1][2]. GTK will attempt to initialize each backend sequentially, stopping at the first one that successfully opens a display [3][4]. Key points regarding this behavior include: - Sequential Evaluation: The list is processed from left to right [1][3]. If a backend fails to open, GTK proceeds to the next one in the list [4]. - Wildcard Support: You can include an asterisk (*) in the list to represent all remaining, non-explicitly-listed backends [5][1][2]. - Interaction with gdk_set_allowed_backends: If your application programmatically sets allowed backends via gdk_set_allowed_backends, GDK will honor the order specified in GDK_BACKEND while restricting attempts to only those backends permitted by the function [5][6][3]. - Troubleshooting: You can set GDK_BACKEND to the special value help to print a list of all available backends to the terminal [1][2]. The possible backend names generally include x11, wayland, macos (or quartz in older versions), win32, and broadway, depending on how your specific GTK build was compiled [5][7][1][8].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- repository files ---'
git ls-files 'tauri-app/src-tauri/src/*'
printf '%s\n' '--- platform outline ---'
ast-grep outline tauri-app/src-tauri/src/platform.rs

Repository: SupaStellar/Cleanmeter

Length of output: 921


🏁 Script executed:

#!/bin/bash
set -eu
sed -n '1,220p' tauri-app/src-tauri/src/platform.rs
printf '\n--- callers ---\n'
rg -n -C 5 'get_platform_info|native_wayland|GDK_BACKEND' tauri-app/src-tauri/src

Repository: SupaStellar/Cleanmeter

Length of output: 9698


🏁 Script executed:

#!/bin/bash
set -eu
cat -n tauri-app/src-tauri/src/platform.rs

Repository: SupaStellar/Cleanmeter

Length of output: 1507


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- Tauri dependencies ---'
rg -n -C 2 'tauri|gtk|gdk|wry|webkit' tauri-app/src-tauri/Cargo.toml tauri-app/Cargo.toml 2>/dev/null || true
printf '%s\n' '--- backend-related code ---'
rg -n -C 3 'GDK_BACKEND|gdk_display|Display::|Wayland|X11|webkit' tauri-app/src-tauri tauri-app/Cargo.toml 2>/dev/null || true

Repository: SupaStellar/Cleanmeter

Length of output: 5663


Detect the selected GDK backend.

GDK_BACKEND accepts comma-separated preferences and tries them from left to right. With GDK_BACKEND=wayland,x11, native_wayland() returns false even when GDK selects Wayland. The application can then install global shortcuts, report display_backend: "x11", and expose X11-only overlay capabilities on native Wayland.

Determine the backend from the initialized GDK display instead of comparing the raw environment value. Parsing only the first entry does not handle fallback to X11 when Wayland is unavailable.

</ChromeButton>
<ChromeButton
onClick={() => appWindowPromise.then((w) => w.hide())}
onClick={() => appWindowPromise.then((w) => linux ? w.minimize() : w.hide())}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Update the Linux close-control title.

When linux is true, Line 182 minimizes the window. The title at Line 183 still says Close to tray, which gives Linux users an incorrect tooltip. Make the title conditional.

Proposed fix
-          title="Close to tray"
+          title={linux ? "Minimize" : "Close to tray"}

@saadah7

saadah7 commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Superseded by #94, which carries the Linux preview onto the current Windows v2.2.19 baseline and adds per-frame lows, Wayland integration, updated UI, and native validation. The replacement remains a draft with known gaps listed; neither PR has been merged.

@saadah7 saadah7 closed this Oct 30, 2026
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