refactor(desktop): Drop the unused Linux --class switch#14482

open1
main
GitHub fork: fix/linux-drop-class-switch
opened29d agobyMMike Olson
View on GitHubTwo-way sync enabledPR last imported 22h ago

Problem

T3 Code still appends a --class=t3code Chromium switch on Linux, fed by a linuxWmClass value. Since Electron 43 the main window's X11 class and Wayland app id both come from setDesktopName("com.t3tools.T3Code.desktop"), so the switch no longer sets them. Keeping it suggested the window class was still t3code, which is how the launchers ended up with StartupWMClass=t3code (#10895 linux-wayland-desktop-icon).

Change

Removes the switch and the linuxWmClass value that only fed it. Nothing visible changes.

The switch still reaches GTK windows in T3's process. In practice that is T3's own folder picker on X11 when no file-chooser portal is running: its class changes from t3code to T3code, GTK's default for the t3code executable, so a user's own case-sensitive window rule for that dialog would need updating. On Wayland the picker's app id is t3code either way, and with a portal the picker belongs to the portal.

SnapShots are unaffected: they only run in Wayland sessions, take their identity from the desktop entry name, and find T3's own window by process id and title.

Scope and approval

Julius suggested this cleanup as a non-blocking follow-up in his review of #10895 linux-wayland-desktop-icon: "--class=t3code / linuxWmClass no longer affects the window class and could be removed."

Verification

Before and after builds (both with #10895's launcher fix) ran in isolated GNOME Shell 50.1 sessions (native Wayland, and X11 through Xwayland with and without xdg-desktop-portal) and an XFCE 4.20 X11 session, each opening T3's folder picker. The main window's class and app id were identical everywhere. GNOME grouped the dialog with T3 in both builds, and XFCE showed the same single taskbar button and the same title-bar icon.

GNOME, X11 without a portal:

GNOME X11 folder picker before and after

XFCE 4.20, X11 without a portal:

XFCE X11 folder picker before and after

GNOME, native Wayland:

GNOME Wayland folder picker before and after

SnapShots also behaved the same with and without the switch on GNOME 50.1 Wayland with xdg-desktop-portal-gnome and T3's GNOME extension: Ctrl+Shift+2 registered through the GlobalShortcuts portal and captured the focused window in both builds (comparison). KDE, Hyprland and niri were checked by source review only.


Sent by Mike's agent (Claude Opus 5.5 in T3 Code)

Checks

21 successful · 10 skipped
All checks passed
8de8841

Screenshots

Before and after builds (both with #10895's launcher fix), opening T3's own folder picker. The main window is identical everywhere; the only difference is the X11 class of the GTK picker when no portal is running (t3code to T3code). Also inlined in the description.

GNOME Shell 50.1, X11 without a portal:

GNOME X11 folder picker before and after

XFCE 4.20, X11 without a portal:

XFCE X11 folder picker before and after

GNOME Shell 50.1, native Wayland:

GNOME Wayland folder picker before and after

Synced from GitHub

Review in Change Stack →

No actionable comments were generated in the recent review.

External image Recent review info
External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between 0a2384496cc0337235ca0694a1a4bbf2c8caff6d and 8de88416977123fef292a37e283860ded4d9816b.

External image Files selected for processing: 4
  • apps/desktop/src/app/DesktopEarlyElectronStartup.ts
  • apps/desktop/src/app/DesktopEnvironment.ts
  • apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts
  • apps/desktop/src/app/DesktopPreReadyPlatform.ts
External image Files with no reviewable changes: 4
  • apps/desktop/src/app/DesktopPreReadyPlatform.ts
  • apps/desktop/src/app/DesktopEnvironment.ts
  • apps/desktop/src/app/DesktopEarlyElectronStartup.ts
  • apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

The Linux desktop environment and early startup options no longer expose or resolve linuxWmClass. Linux pre-ready setup no longer appends the class command-line switch, and the Linux URL-handler test fixture no longer sets linuxWmClass.

Changes: Linux window class removal

Layer / File(s)Summary
Remove window class from Linux options
apps/desktop/src/app/DesktopEarlyElectronStartup.ts, apps/desktop/src/app/DesktopEnvironment.ts
The early startup options and desktop environment no longer define or provide linuxWmClass.
Stop passing the Linux class switch
apps/desktop/src/app/DesktopPreReadyPlatform.ts, apps/desktop/src/app/DesktopLinuxUrlHandler.test.ts
Linux pre-ready setup no longer appends the class switch. The URL-handler test fixture no longer sets linuxWmClass.

Priority: External image Low

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Refactor

Merge Risk: External image Minimal · up to 8de88

No merge-blocking issue is established for this change; it is ready for normal checks.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the main change: removing the unused Linux --class switch.
Description checkPassedThe description covers the problem, change, scope and approval, verification steps, observed results, limitations, screenshots, and agent attribution. It is complete and directly related to the pull r…
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description covers the problem, change, scope and approval, verification steps, observed results, limitations, screenshots, and agent attribution. It is complete and directly related to the pull request.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.

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

Synced from GitHub

Approvability

Verdict: Approved at ca45022

Macroscope's review found this PR approvable — Removes an obsolete Linux Electron --class switch and its unused plumbing across four files. The only remaining effect is a narrow GTK window-class fallback on Linux; application identity and other startup behavior remain unchanged.

No code changes detected at 6a37783. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

I tested this on GNOME 50.1 Wayland with xdg-desktop-portal-gnome and T3's GNOME extension, using the same .deb built with and without --class. In both builds Ctrl+Shift+2 registered through the GlobalShortcuts portal and captured the focused window the same way:

SnapShot with and without --class

--class came in with #1201 linux-desktop-identity, before SnapShots landed in #8103 window-capture. SnapShots only run in Wayland sessions, and every Linux backend (portal shortcut, GNOME extension, Hyprland, niri, KDE) keys on the app id from setDesktopName, com.t3tools.T3Code, which this PR leaves as is. If you remember a specific desktop where it mattered, I'll test that one too.

Added 1 commit

  • refactor(desktop): Drop the unused Linux --class switch8de8841