The spec tells us to ignore certain events if we didn't get an `enter`
event first. Certainly we need to at least acknowledge the `enter` event
itself 😅
Despite what I thought in the past, it is allowed, as long as we follow
certain limitations depending on the toplevel's state.
As usual I peppered the code with comments expaining what those
limitations are.
Regarding popups, AFAICT there are no major limitations, although we
should eventually use the new `reposition` method, which autoadjusts the
popup to follow the screen's borders and whatnot. I didn't do that in
this patch as it requires some elbow grease, especially if we want to do
it synchronously.
Libdecor has some quirks and depending on the setup it might be useful
to switch to the xdg-shell branch. Recompiling the whole engine without
libdecor is not an acceptable way to do that.
Makes it more consistent with the rest of the `WaylandThread` methods
(so that we can silently check for the window's existence).
Fixes errors when trying to capture the pointer when no surface has been
pointed yet (its logic assumed that this method was silent).
We double-check everywhere anyway but I added it in some places where we
can't either guarantee that it'll check (to avoid segfaults) or that
would be useful to report directly.
The spec says "After leave event, compositor must ignore requests from
any text input instances until next enter event."
Fixes an error on jay, which at least on 1.11.0 sends
`zwp_text_input_v3::done` after `zwp_text_input_v3::leave`, which we
didn't ignore, leading to a commit without a valid window id.
scale_changed and size_changed were incorrectly initialized to true,
causing redundant WindowRectMessage and DPI change events to be pushed
on every configure event regardless of actual changes.
- Add hint string `monospace` for `PROPERTY_HINT_{NONE,PASSWORD,PLACEHOLDER_TEXT}` to set the `LineEdit` font monospaced.
- Add hint string `monospace` for `PROPERTY_HINT_MULTILINE_TEXT` to set the `TextEdit` font monospaced.
- Add hint string `no_wrap` for `PROPERTY_HINT_MULTILINE_TEXT` to make the `TextEdit` not wrap lines automatically.
Also:
- Fix issue with `EditorPropertyMultilineText` not updating font properly.
- Add `EditorPropertyMultilineText` tweak flags.
- Add support with GDScript `@export_multiline`.
Previously we had different logic for direct key presses and client-side
key repetition, as one queued up input events and the other dispatched
them directly (client-side key repetition is run from the main thread).
I kinda figured out that this difference doesn't really matter, as we
can queue them up before the thread message dispatching logic. That's
exactly what we do now, which allows us to make a single method for both
of them, making the code much clearer and simplifying future maintenance.
This patch also includes a tiny fixup in the compose logic, which checks
for the validity of the generated key event before actually working with
it. The cases in which we can end up with an invalid reference are very
few, so it's not the end of the world, but it's still absolutely a good
idea to check, to avoid nasty surprises down the line.
This adds macro `GodotProfileZoneGroupedFirstScript`, and uses interning for speedy lookups.
Co-authored-by: Samuel Nicholas <nicholas.samuel@gmail.com>
The `wl_keyboard::repeat_info` event got introduced in version 4. On
versions older than that, we defaulted to 0 delay, which means no
repetition. That's a veeery old version and basically everything offers
it, but it doesn't hurt to add a reasonable default.
`send_wayland_message` takes in the number of words, not its byte size.
This meant that we were sending quite a bit of out-of-bounds stuff
alongside the four arguments required by
`xdg_positioner::set_anchor_rect`, which triggered an assertion on Jay.
This didn't pop up before because the C wayland server library does not
seem to check this, but it's a valid (and useful!) assertion
for other server implementations nonetheless.
This patch switches to the initializer_list syntax to make the intent
clearer.