refactor internal surface API
The goal here is to add late initialization code to GdkSurface::constructed()
that runs after system resources (wl_surface
, HWND
, XWindow
) have been created. In particular, I want to bring up the renderer from here, and the graphics system needs access to those resources.
For that, I've done the following steps:
-
Remove the x/y/width/height arguments from
GdkDisplay::create_surface
- they're just leftovers from GTK3, sizes are only decided on present() these days. However, some backends still may use these sizes for their internal surfaces, hopefully I've properly handled those. -
Moved code out of the backends'
create_surface()
vfunc intoGdkBackendSurface::constructed
. This was more complicated than it looks because many backends haven't properly split Toplevel/Popup/DragSurface yet. -
Make surfaces create their own frame clocks instead of passing them in via constructor. This has the benefit of allowing custom frame clocks, should we ever want to do that.
-
Removed the
GdkDisplay::create_surface
vfunc withGdkDisplay::toplevel/popup_type
members and just usingg_object_new()
with those. This is again trickier than it looks, because the internal surfaces now need custom constructors.
The actual addition of the late initialization code will follow in future MRs.
I did not test this MR on Windows or MacOS. I made sure it compiles, but because neither runs the testsuite in CI, I can't know if I've made some stupid mistakes while copying things around.