This allows removing it from `class_db.h`, significantly reducing the amount of files
that include it transitively.
Also includes some include cleanup in `control.h` and `rich_text_label.h` done while
ensure they don't depend on `callable_mp`.
This will allow decoupling `display_server.h` from a number of headers in the
codebase which only require those enums and not all the DisplayServer API.
A number of headers in the codebase included `rendering_server.h` just for
some enum definitions. This means that any change to `rendering_server.h` or
one of its dependencies would trigger a massive incremental rebuild.
With this change, we decouple a number of classes from `rendering_server.h`,
greatly speeding up incremental rebuilds for that area.
On my machine, this reduces incremental compilation time after an edit of
`rendering_server.h` by 60s (from 2m57s).
- Removes `native_menu.h` dependency from `display_server.h`.
It's now forward-declared in all DisplayServer implementations and should
be included in the .cpp's.
- Removes some unused `rb_set.h` and `rb_map.h` dependencies, which leads to
having to include them explicitly in half the scene and editor codebase...
which shows how much we depend on `display_server.h`.
- Forward-declare `input_event.h`, so now we need only `keyboard.h`.
`DisplayServer::window_set_size` is called lots of times in the code,
with the assumption (I suppose) that it's going to be idempotent.
We had checks in _update_window_rect but we still called
`WaylandThread::window_set_size`, which did a lot of stuff. In
particular, this caused issues with HiDPI as it "overrode" the window
size before it had a time to figure out its scale.
They were bound in reverse. No idea how I originally chose which was
which.
This patch also orders the switch cases by their underlying codes: left,
right, middle, side, extra.
Some compositors (e.g. COSMIC) can report *all* supported output modes,
not just the current mode. This is valid, albeit deprecated, so let's
add a check and ignore any non-current output events.
Freshly deleted objects are temporarily "inert" until their destruction
is acknowledged by the compositor.
Inert objects are ignored. By doing so, we mistakenly returned too
early and missed some FD cleanup logic. This patch ensures that any
outstanding FDs are always closed by moving its logic outside of the
message handling routine.
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.