This is not used anymore now that surfaces are always toplevel in the
semantics of GdkWindow where child windows were available. We can drop
that and simplify the vfunc just a bit more.
Fixes#2765
Just because we take a ref on a surface does not
guarantee that it is still usable a second later.
Check if its been destroyed in the meantime.
This is breaking the template tests in ci, since
there is no client behind the Broadway server.
The assumption is that the source device in events
is a slave device, so create pointer and keyboard
devices and use them in events.
This fixes the seat test on Broadway.
GDK backends are expected to keep a references on
their surfaces as long as they are associated with
external resources, and drop it in destroy().
This showed up as criticals in the shortcuts test
which manually creates and destroys surfaces.
We currently calling gdk_display_map_keyval up to
once per key event per shortcut trigger, and that function
does an expensive loop over the entire keymap and
allocates an array. Avoid this by caching the entries
in a single array, and have a lookup table for finding
the entries for a keyval.
To do this, change the GdkKeymap.get_entries_for_keyval
signature, and change the ::keys-changed signal to be
RUN_FIRST, since we want to clear the cache in the class
handler before running signal handlers. These changes are
possible now, since keymaps are no longer public API.
The api to configure surfaces is now GdkToplevelLayout
and GdkPopupLayout. Unfortunately, there's still quite
a bit of internal use of GdkGeometry that will take some
time to clean up, so move it go gdkinternals.h for now.
GdkEvent has been a "I-can't-believe-this-is-not-OOP" type for ages,
using a union of sub-types. This has always been problematic when it
comes to implementing accessor functions: either you get generic API
that takes a GdkEvent and uses a massive switch() to determine which
event types have the data you're looking for; or you create namespaced
accessors, but break language bindings horribly, as boxed types cannot
have derived types.
The recent conversion of GskRenderNode (which had similar issues) to
GTypeInstance, and the fact that GdkEvent is now a completely opaque
type, provide us with the chance of moving GdkEvent to GTypeInstance,
and have sub-types for GdkEvent.
The change from boxed type to GTypeInstance is pretty small, all things
considered, but ends up cascading to a larger commit, as we still have
backends and code in GTK trying to access GdkEvent structures directly.
Additionally, the naming of the public getter functions requires
renaming all the data structures to conform to the namespace/type-name
pattern.
Add all of the keyboard translation results in the key event,
so we can translate the keyboard state at the time the event
is created, and avoid doing state translation at match time.
We actually need to carry two sets of translation results,
since we ignore CapsLock when matching accelerators, in
gdk_event_matches().
At the same time, drop the scancode field - it is only ever
set on win32, and is basically unused in GTK.
Update all callers.
With the removal of `gdk_seat_grab` we do not need to keep the
definitions of `GdkGrabStatus` and `GdkGrabOwnership` public.
Move those definitions to become internal only.
When we reconfigure, `configure_file()` is called again, and
`*.gresource.xml` files are regenerated, which causes many (all?)
binaries to be relinked. Now we only write those out if the contents
actually changed (or if the output didn't already exist).
This is exactly what Meson already does with `configure_file()` when
`command:` is not used.
While we're at it, also do the same for `gen-c-array.py` and
`gentypefuncs.py` for completeness. Now even if the input to those
changes, re-building of those custom targets may not result in
relinking if the outputted C files have the same contents.
Broadway doesn't have support for inhibit shortcuts, yet it needs to
support the standard set of GdkToplevel properties.
Add support for the "inhibit-list" object property to GdkToplevel on
Broadway.
surface->x/y (and various x,y arguments) should be in the parent
coordinates, so treat it as such. We also keep track of the root coords
as these are needed for popup positioning.
Also, drop the isTemp property server side and the weird initial
placement at (100, 100) in the daemon. We now fully control window
placement from the client instead. If this is not we want we should do
a serious design for that but until then lets do the simplest thing.
In firefox, onload will trigger when the image is loaded, but at
that point it may not be decoded yet so showing it will sometimers
trigger flashes. We use the new decode() feature instead which ensures
both that the image is loaded *and* decoded, thus fixing the flashes.