We were queuing an allocation whenever
the popover is flipped over, unnecessarily,
since we don't change the size of the surface.
This was showing up as popovers being invisible
when flipped over, under X.
There is no need for popups to connect to the frame
clock to pause and unpause events on the display -
the toplevel already does it.
And don't connect to paint either - handle paint
on popups recursively.
Somewhat change the order of initialization (to be closer
to what Wayland backend does).
Also remove the wrapper field that is no longer needed -
it used to hold a pointer to the main GdkWindow instance,
which wrapped GdkWin32ImplWindow. Since impls are gone,
nothing is wrapping anything anymore.
Fix a substitution error, where wrong pointer was added
to the hash table. Added a comment to ensure that future readers
(including myself) won't be confused by the fact that we're
inserting a pointer instead of the handle itself.
Since we are now sharing frame clocks with multiple
surfaces, we can no longer dispose them unconditionally
when a surface goes away. Only do it if we are a
toplevel (without parent).
This was showing up as criticals on exit when opening
and closing any popover in widget factory.
Now that popups share the frame clock of their
parent, we have to be much more careful about
freezing the clock, since that may stop updates
for another surface.
This commit makes two changes that make the
X11 handling of the frame clock more similar
to the Wayland backend:
- Use gdk_surface_freeze_updates instead of
gdk_surface_freeze_toplevel_updates to avoid
affecting the frame clock
- Bail out early in before_paint/after_paint
if the surface is frozen, to avoid affecting
the frame clock
Together, these two make the X11 popup surface
type work without freezing updates for the toplevel.
With separate clocks, the phases are not coordinated,
which messes with GTKs size allocation machinery treating
the entire widget tree as a whole, and causes us to
run into assertion where popups get drawn before they
are allocated.
Call gtk_native_check_resize() from size_allocate,
as is required now. This gets volume buttons closer
to working again (dragging the slider still doesn't
work).