Skip to content

fix: force FBO recreation for Chromium/Electron windows after dock restore#164

Open
Mr-ZeLong wants to merge 1 commit into
flexagoon:mainfrom
Mr-ZeLong:fix/chromium-fbo-blur
Open

fix: force FBO recreation for Chromium/Electron windows after dock restore#164
Mr-ZeLong wants to merge 1 commit into
flexagoon:mainfrom
Mr-ZeLong:fix/chromium-fbo-blur

Conversation

@Mr-ZeLong

Copy link
Copy Markdown

Problem

When Chromium/Electron apps (QQ, WeChat, Chrome, Edge, Brave, etc.) are shown from the dock, Mutter's ClutterOffscreenEffect reuses the offscreen FBO populated during the unminimize animation. The FBO was populated at intermediate (scaled) resolutions with whatever stale Wayland buffer the client still holds, resulting in blurry window content that persists until the mouse enters the window.

This is reproducible on GNOME 50 with Dash to Dock, 100% integer scaling, XWayland and native Wayland clients.

Root Cause

  1. Mutter's ClutterOffscreenEffect.pre_paint() determines the offscreen FBO size from the actor's paint_volume during the unminimize scale-up animation. The FBO is populated each frame at progressively larger sizes.
  2. Chromium/Electron apps may not deliver fresh Wayland buffers immediately after unminimize, so Mutter renders stale/low-res content to the FBO.
  3. After the animation ends, the FBO size check passes, so the FBO is reused indefinitely with the stale content.
  4. queue_repaint() only re-runs the GLSL shader on the existing FBO — it does not force Mutter to re-render the window content into the FBO.
  5. Mouse enter triggers wl_pointer.enter → Chromium delivers a fresh frame → FBO content becomes sharp.

Fix

Force FBO invalidation by toggling the effect's enabled state (enabled=false destroys the offscreen, enabled=true + queue_repaint allocates a fresh FBO with the current window buffer).

Two trigger paths:

  • onUnminimize: 250ms delay for Electron's Wayland renderer to deliver a settled frame, then toggle + refresh.
  • onFocusChanged: When window is behind others and brought to front from dock.

Also adds periodic shader refreshes for Chromium windows on fractional-scaled displays.

Non-Chromium windows are completely unaffected — updateEffectWithFboInvalidate skips the toggle for them.

…store

When Chromium/Electron apps (QQ, WeChat, Chrome, Edge, Brave, etc.)
are shown from the dock, Mutter's ClutterOffscreenEffect reuses the
offscreen FBO populated during the unminimize animation. During that
animation the FBO was populated at intermediate (scaled) resolutions
with whatever stale Wayland buffer the client still holds, resulting
in blurry window content that persists until the mouse enters.

The fix forces FBO invalidation by toggling the GLSLEffect's enabled
state (enabled=false destroys the offscreen, enabled=true allocates a
fresh one on the next pre_paint). For Chromium windows this runs after
a 250ms delay to let the Wayland renderer deliver a settled frame.

Two trigger paths are covered:
- onUnminimize: window was minimized and is restored from dock
- onFocusChanged: window was behind others and is brought to front

Also adds periodic shader refreshes for Chromium windows to nudge
Mutter toward full-resolution buffer allocation on fractional-scaled
displays.
@flexagoon

Copy link
Copy Markdown
Owner

@Mr-ZeLong did you read the pull request guidelines?

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