Commit 84d3adc
committed
Wayland: Implement native sub-windows
The backend is now mature enough to not explode with multiple windows
but the `DisplayServer` API still cannot meet some guarantees required
by the various Wayland protocols we use. To meet those guarantees this
patch adds three new elements to the DisplayServer API, with relative
handling logic for `Window` and `Popup` nodes:
- `WINDOW_EVENT_FORCE_CLOSE`, which tells a window to *forcefully*
close itself and ensure a proper cleanup of its references, as Wayland
enforces this behavior;
- `WINDOW_FLAG_POPUP_WM_HINT`, which explicitly declares a window as a
"popup", as Wayland enforces this distinction and heuristics are not
reliable enough;
- `FEATURE_SELF_FITTING_WINDOWS`, which signals that the compositor can
fit windows to the screen automatically and that nodes should not do
that themselves.
Given the size of this feature, this patch also includes various
`WaylandThread` reworks and fixes including:
- Improvements to frame wait logic, with fixes to various stalls and a
configurable (through a `#define`) timeout amount;
- A proper implementation of `window_can_draw`;
- Complete overhaul of pointer and tablet handling. Now everything is
always accumulated and handled only on each respective `frame` event.
This makes their logic simpler and more robust.
- Better handling of pointer leaving and pointer enter/exit event
sending;
- Keyboard focus tracking;
- More solid window references using IDs instead of raw pointers as
windows can be deleted at any time;
- More aggressive messaging to window nodes to enforce rects imposed by
the compositor.1 parent 27b2ba6 commit 84d3adc
File tree
12 files changed
+1261
-473
lines changed- doc/classes
- platform/linuxbsd/wayland
- scene
- gui
- main
- servers
12 files changed
+1261
-473
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1958 | 1958 | | |
1959 | 1959 | | |
1960 | 1960 | | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
1961 | 1964 | | |
1962 | 1965 | | |
1963 | 1966 | | |
| |||
2181 | 2184 | | |
2182 | 2185 | | |
2183 | 2186 | | |
2184 | | - | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
2185 | 2191 | | |
2186 | 2192 | | |
2187 | 2193 | | |
| |||
2211 | 2217 | | |
2212 | 2218 | | |
2213 | 2219 | | |
| 2220 | + | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
2214 | 2224 | | |
2215 | 2225 | | |
2216 | 2226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
673 | 676 | | |
674 | 677 | | |
675 | 678 | | |
| |||
879 | 882 | | |
880 | 883 | | |
881 | 884 | | |
882 | | - | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
883 | 889 | | |
884 | 890 | | |
885 | 891 | | |
| |||
0 commit comments