Skip to content

feat(settings): adjustable window opacity, and end the Wayland opacity-warning spam#5

Open
Zakkaus wants to merge 9 commits into
locez:mainfrom
Zakkaus:feat/settings-window-opacity
Open

feat(settings): adjustable window opacity, and end the Wayland opacity-warning spam#5
Zakkaus wants to merge 9 commits into
locez:mainfrom
Zakkaus:feat/settings-window-opacity

Conversation

@Zakkaus

@Zakkaus Zakkaus commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a Window opacity control for the settings window, removes the repeated This plugin does not support setting window opacity warnings on KDE Wayland, and stops KDE bouncing the launcher at startup.

Window opacity

  • New General setting config.settings_opacity — a spin box over the full 0–100%, default 95% (a touch see-through; text stays fully legible). Covered by "Reset tab" and translated across en / zh-Hans / zh-Hant / ja.
  • Driven by painted surface alpha — the window fill in paintEvent, plus the light theme's card — not setWindowOpacity, which Qt's Wayland plugin ignores (no client-side opacity protocol). So it works under KWin, and 100% is genuinely opaque (alpha 255; before, the max scaled the palette's 240 fill and still read ~94% see-through). This is separate from the Frosted-glass (KWin blur) toggle and works on any compositor, not just KDE.
  • Applied on OK/Apply, like every other setting — no live preview. A live preview flashed the window near-invisible while typing (e.g. "95" passing through the digit "9"), so it was dropped for consistent, flash-free behaviour.

Ending the setWindowOpacity warning

The This plugin does not support setting window opacity spam had three sources, all removed/guarded:

  • the overlay's redundant setWindowOpacity(1.0) at startup,
  • the settings dialog's explicit setWindowOpacity calls (replaced by painted alpha),
  • the settings fade-in animation, which animated the windowOpacity property (~one setWindowOpacity per frame). It's now skipped on Wayland — where it never faded anyway — so the window just appears, silently. (Still fades on X11, where the property works.)

Startup

  • StartupNotify=false in kotonoha.desktop: the app maps no normal top-level window (a tray icon + a layer-shell overlay only), so the launcher's startup notification never completed and KDE bounced the "launching" feedback until it timed out.

Fallback behaviour

Frosted glass stays gated to KDE Wayland (_blur_capable = blur.available and wayland and KDE); everywhere else _frosted is False and the window paints a normal solid panel. Off KDE the Frosted-glass checkbox is disabled (greyed out) with an always-visible KDE-only note, so it reads as unavailable rather than an option that silently does nothing. The painted-alpha window opacity works regardless. Covered by test_frost_only_on_kwin_wayland_and_blur_lifecycle_is_safe and test_frost_checkbox_is_greyed_out_and_noted_when_blur_unavailable.

Testing

  • pytest 352 passed (3 new: config clamp/default, OK/Apply round-trip, and a render check that 100% is fully opaque while a lower value is clearly see-through). ruff/ty clean.
  • Verified the painted transparency by compositing the dialog over a colored backdrop (100% solid, 95% subtle, 50% see-through), and confirmed a fresh KDE-Wayland launch logs no opacity warnings.

Zakkaus added 3 commits July 15, 2026 08:40
Add a "Window opacity" control (General tab) for the settings window itself — the
lyrics overlay already had its own opacity, but the settings dialog was always
solid. Applied via setWindowOpacity on open, live while dragging, and committed on
Apply. Default 96% (a touch see-through, text stays fully legible); clamped 60–100%.
Works on KWin; harmless where the platform ignores window opacity.
…a no-op on Wayland)

The Qt Wayland plugin has no client-side window-opacity protocol, so
setWindowOpacity just logged "This plugin does not support setting window opacity"
and did nothing. Drive the see-through level through the painted window fill
(paintEvent alpha) and the light-theme card alpha instead — the same way the
overlay panel's opacity already works — so it takes effect under KWin. Live preview
re-skins + repaints on change. Also drop the overlay's redundant setWindowOpacity(1.0)
that produced the same warning at startup.
Kotonoha maps no normal top-level window (only a tray icon + a Wayland layer-shell
overlay), so the launcher's startup notification never completes and KDE shows the
'launching' feedback until it times out. Opt out of startup notification.
@Zakkaus Zakkaus changed the title feat(settings): adjustable settings-window opacity feat(settings): adjustable settings-window opacity (+ Wayland/startup fixes) Jul 14, 2026
Zakkaus added 2 commits July 15, 2026 08:54
- 100% now paints a fully solid window (alpha 255). It looked see-through before
  because the mapping scaled the palette's window fill, whose base alpha is 240,
  so the max still read as ~94% opaque.
- Range is the full 0-100% (was 60-100), default lowered to 90%.
The real source of the repeated 'This plugin does not support setting window
opacity' spam: the settings dialog's fade-in animates the windowOpacity property,
firing setWindowOpacity ~once per frame. Qt's Wayland plugin ignores it (so there
was no fade anyway) and warns each time. Only run the fade where window opacity is
actually supported (X11); Wayland now shows the window instantly and silently.
@Zakkaus Zakkaus changed the title feat(settings): adjustable settings-window opacity (+ Wayland/startup fixes) feat(settings): adjustable window opacity, and stop the Wayland opacity-warning spam Jul 14, 2026
Zakkaus added 2 commits July 15, 2026 09:00
- setKeyboardTracking(False) on the opacity spin box so typing e.g. "95" no
  longer flashes the window near-invisible as it passes through the digit "9".
  Spin arrows still preview live.
- Default opacity 90% -> 95%.
The opacity was the only setting that previewed live, and that live preview flashed
the window near-invisible while typing (e.g. "95" passing through "9"). Drop the
live preview entirely so it commits on the existing OK/Apply buttons like every
other setting — no flashing, and consistent behaviour.
@Zakkaus Zakkaus changed the title feat(settings): adjustable window opacity, and stop the Wayland opacity-warning spam feat(settings): adjustable window opacity, and end the Wayland opacity-warning spam Jul 14, 2026
Zakkaus added 2 commits July 15, 2026 09:11
…w the note

The frosted-glass window only works on KDE Wayland. Off it, the checkbox is now
disabled (dimmed label + muted, non-accent box via new :disabled QSS) so it reads
as unavailable instead of an option that silently does nothing, and the KDE-only
hint is always shown under it (previously only when blur was unavailable).
On KDE (Breeze) / Fusion the combo style opens a native, system-palette popup that
ignores the dark item-view QSS, so the Theme/Language/etc. dropdowns rendered white
on the dark settings window. combobox-popup: 0 forces the styled drop-down list, so
the popup follows the app theme. (Offscreen already used the list view, hence it
looked fine in headless renders.)
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.

1 participant