The Qt "bug":
- for some wl_surfaces, we attach some plasma protocols
- we need a hook to know when Qt creates a wl_surface so we can do this
- ideally to attach before we flush events to kwin
- Qt used to have one wl_surface for the lifespan of the window
- Qt now creates/deletes a wl_surface when we show/hide a window.
- This seems to be correct behaviour
- We currently use a hook called NativeSurfaceCreatedEvent
- This doesn't get re-emitted. Why?
Thing Qt terminology Wayland terms
What you draw in to surface buffer
the thing on screen window surface
The thing we draw into isn't recreated, so Qt is also still technically correct.
...but we still need a hook.
IMHO we shouldnt' be trying to "fix" this in a compatiable way.
We should do a bodge, then do a non-compatiable actual fix.
This is three jobs:
- find all instances
- bodging a hook and maybe emit a custom event on the window
- making the plasmashell interfaces re-creatable in all event handling code
We do *always* get a QExposeEvent after a surface gets re-created
The wl_surface ID is different after it's recreated (because Qt is too lazy to re-use them.
Gives us a bodge.
Initial plan:
- plasma integration does a hack and emits a custom QEvent
- Dialog, Runner, etc. listen to that.
Longer plan:
signal in nativePlatformInterface?
Other notes:
- we can repinterpret the shell surface to a QObject from the QPA. Then track the lifespan.
- we can't do this for wl_surface though, as that qobject isn't deleted.
- this doesn't super help as Dialog sets bypass WM, and then we don't get a shell surface...but is that actually what we want?