On Wed Jun 7 10:45:32 2023 +0000, Alexandros Frantzis wrote:
Yeah I think it's best to wait for accelerated surface before
introducing them, and then only do it on a as-needed basis. Done, including some extra logic to be able to properly handle reparenting, as we move between child/non-child states.
I don't know how this will work in Wayland, but on X11 we ended up
(not upstream but in Proton) with multiple client windows for a single HWND, because of how Windows surfaces can work. In the Wayland driver the plan is to create a separate `wl_subsurface` (making it a child of the main `wl_surface` for the HWND) to hold any accelerated rendering buffers. This will apply to both child window accelerated rendering and main window accelerated rendering.
Looking at it again, I'm not sure it's a good idea to duplicate the parent / old_parent information, because then it's not obvious that it is in sync with `NtUserGetAncestor(hwnd, GA_PARENT)`. I also don't see any reason there to keep parent except to compare with old_parent.
Instead, what do you think about comparing something like `has_surface != needs_surface`, checking the current window parent if needed, and decide whether to create or destroy the surface according to that.
If you want to be notified of parent changes, I think you can implement the SetParent driver callback, but I guess you know that already and that it would come later.