https://bugs.kde.org/show_bug.cgi?id=522547

--- Comment #14 from Francis <[email protected]> ---
Created attachment 196704
  --> https://bugs.kde.org/attachment.cgi?id=196704&action=edit
Qt reproducer for the comment 13 sequence (KWindowEffects blur on, blur off,
close, re-show, blur on)

Thanks for the analysis in comment 13. I tested your proposed KWindowSystem
change, and it fixes the disconnect in a reproducer.

Setup:
- KWin 6.7.5, the stock CachyOS package (the one that raises the error), run
headless with kwin_wayland --virtual.
- KWindowSystem 6.30.0 built twice from the v6.30.0 tag: unchanged, and with
exactly your change from comment 13 in installBlur().
- A small Qt 6.11.2 client that makes the same KWindowEffects calls Kvantum
makes for a popup: show the window, enableBlurBehind(true),
enableBlurBehind(false), QWindow::destroy() (which destroys the wl_surface),
show it again, enableBlurBehind(true). In every run I checked that the client
loaded the KWindowSystem build under test and that KWin advertised the blur
capability.

Results, 5 runs each:
- Unchanged 6.30.0: the client was killed 5/5 with "tried to set blur region on
destroyed surface".
- With your change: the client survived 5/5. The re-shown window got a new
ext_background_effect_surface_v1 with its blur region set, so the blur comes
back.

WAYLAND_DEBUG=client with unchanged 6.30.0 (the same pattern as in comment 13):

    -> ext_background_effect_surface_v1#45.destroy()
    -> ext_background_effect_manager_v1#47.get_background_effect(new id
ext_background_effect_surface_v1#49, wl_surface#35)
    -> ext_background_effect_surface_v1#49.set_blur_region(nil)
    -> wl_surface#35.destroy()
    -> ext_background_effect_surface_v1#49.set_blur_region(wl_region#51)
    wl_display#1.error(ext_background_effect_surface_v1#49, 0, "tried to set
blur region on destroyed surface")

With your change:

    -> ext_background_effect_surface_v1#46.destroy()
    -> wl_surface#35.destroy()
    -> ext_background_effect_manager_v1#47.get_background_effect(new id
ext_background_effect_surface_v1#41, wl_surface#48)
    -> ext_background_effect_surface_v1#41.set_blur_region(wl_region#51)

I haven't tested it with Kvantum or plasmashell directly. My desktop does use
Kvantum 1.1.8 with popup blurring on, which matches the path you describe.

About my KWin change from comment 11: the MR was closed. The object being inert
means the only valid request is destroy, and ignoring the error in KWin would
hide client bugs like this one, which would then crash on other compositors. So
the fix belongs in KWindowSystem. Running unchanged KWindowSystem against my
patched KWin confirms this: the client still sends the stale set_blur_region,
KWin just ignores it, and the reopened popup gets no blur.

Do you plan to open a KWindowSystem merge request with your change? I'm happy
to test it. I've attached the test client in case it's useful as a reproducer.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to