summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/wayland/wayland_thread.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
|
* Rebrand preambles to RedotDubhghlas McLaughlin2024-10-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* CI: Update `clang-format` pre-commit hook to 19.1.0Rémi Verschelde2024-09-261-2/+2
|
* Wayland: Simplify cursor code and fix custom cursorsRiteo2024-09-131-6/+3
| | | | | | | | | | | | Initially the WaylandThread cursor code was supposed to be as stateless as possible but, as time went on, this wasn't possible. This expectation made the resulting API quite convoluted, so this patch aims to simplify it substantially bot in terms of API surface and, most importantly, in terms of actual implementation complexity. This patch also fixes custom cursors since I accidentally changed the mmap flags to MAP_PRIVATE some time ago. This took me hours to notice.
* Use wayland-egl-core.h instead of wayland-egl.hJoel Winarske2024-08-231-1/+1
| | | | | | | | -avoid use of transitive wayland include -resolves https://github.com/godotengine/godot/issues/95830 Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
* Wayland: switch pointer position handling to doublesRiteo2024-07-071-4/+4
| | | | | | This reduces even further the amount of work we have to do when scaling and potentially improves input accuracy as now the input code is free from any form of rounding.
* Wayland: minimize surface commits and limit them to the main threadRiteo2024-06-281-0/+2
| | | | | | | | | | | | | | | | | | Before of this patch, as explained in the usual commented-wall-of-text-longer-than-the-actual-patch-itself™, due to the multithreaded nature of the Wayland thread, it was possible to commit a surface while the renderer was doing stuff, which was _very_ wrong. Initially the consequences of such a sin weren't obvious but, now that explicit synchronization is becoming more and more common, we can't commit a buffer randomly without basically guaranteeing a nasty, nasty crash (and we should have avoided commits altogether in the first place to ensure atomic surface updates). We now only trigger a commit _in the main thread_ when low processor usage mode is on _and_ if we know that we won't be rendering anything as, due to its intermittent nature, it makes "legacy" (pre xdg_wm_base v6) frame callback based suspension quite annoying.
* [Wayland] Implement IME support.bruvzg2024-06-111-0/+43
|
* Enable build config wayland=yes use_sowrap=noJoel Winarske2024-05-251-0/+3
| | | | | | -wayland-egl.h was missing if opengl3=yes (default) Signed-off-by: Joel Winarske <joel.winarske@gmail.com>
* Wayland: Improve compositor compatibility by allowing older globalsRiteo2024-04-261-31/+31
| | | | | | | | | | | | | | | | | | Previously we pretty much hardcoded most of the globals we requested, causing compatibility issues with certain compositors like Weston, which support only some pretty old versions or miss some more advanced protocols. To put fuel on the fire, we also errored out when certain protocols weren't available, despite us being able to boot a game just fine (but obviously with a degraded featureset). The solution is to simply allow all the way from version 1 to the current latest, adding some compatibility code (such as for older `wl_output`s or newer `wl_pointer`s). While we're at it, this commit also fixes a few typos and naming inconsistencies I found.
* [Wayland] Fix tilt handlingA Thousand Ships2024-03-031-1/+1
|
* Wayland: Restore tablet support and handle multiple toolsRiteo2024-02-281-5/+13
| | | | | | | | | | | | | | This code was already partially there, although heavily incomplete and nowadays commented out. It got broken after the `WaylandThread` refactor and I didn't bother to bring it over, preferring to `#if 0` it into oblivion for the time being as I don't have a tablet/pen which support an eraser and tilt reporting. This commit brings it back and adds proper multi-tool support (needed for eraser detection) thanks to winston-yallow, who could test this code with their more capable tablet.
* Wayland: suspend window after frame timeout or suspend stateRiteo2024-02-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | This is a pretty popular approach that took a while for me to wrap my head around and which only recently got "official" support through an update (xdg_shell version 6), so I think that this is all-in-all a better option than the overkill 2000Hz ticking we have now :P Basically, we wait for a frame event and, if either too much time passes or we get the new `suspended` state, we consider the window as "hidden" and stop drawing, ticking by the low usage rate. This should work great for KDE and Mutter, which support the new state, but not yet for sway, which is still stuck at a very old xdg_shell version and thus falls back to the timeout approach. Be aware that if we rely on timing out the engine will have to stall for the whole timeout, which _could_ be problematic but doensn't seem like it. Further testing is needed. Special thanks go to the guys over at #wayland on OFTC, who very patiently explained me this approach way too many times.
* wayland: Update to 1.22.0Jakub Marcowski2024-02-061-0/+6
|
* [Wayland] Add support for native file dialogs.bruvzg2024-01-311-0/+13
|
* Add Wayland supportRiteo2024-01-301-0/+930
Not everything is yet implemented, either for Godot or personal limitations (I don't have all hardware in the world). A brief list of the most important issues follows: - Single-window only: the `DisplayServer` API doesn't expose enough information for properly creating XDG shell windows. - Very dumb rendering loop: this is very complicated, just know that the low consumption mode is forced to 2000 Hz and some clever hacks are in place to overcome a specific Wayland limitation. This will be improved to the extent possible both downstream and upstream. - Features to implement yet: IME, touch input, native file dialog, drawing tablet (commented out due to a refactor), screen recording. - Mouse passthrough can't be implement through a poly API, we need a rect-based one. - The cursor doesn't yet support fractional scaling. - Auto scale is rounded up when using fractional scaling as we don't have a per-window scale query API (basically we need `DisplayServer::window_get_scale`). - Building with `x11=no wayland=yes opengl=yes openxr=yes` fails. This also adds a new project property and editor setting for selecting the default DisplayServer to start, to allow this backend to start first in exported projects (X11 is still the default for now). The editor setting always overrides the project setting. Special thanks to Drew Devault, toger5, Sebastian Krzyszkowiak, Leandro Benedet Garcia, Subhransu, Yury Zhuravlev and Mara Huldra.