summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/wayland/wayland_thread.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
|
* Rebrand preambles to RedotSpartan3222024-10-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit e8542b06acca3c1bdeee4b528411771f0819f084) 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>
* Wayland: Avoid recreating input objects on capability changeRiteo2024-08-091-17/+21
| | | | | | Before, multiple capability events would instantiate the same object over and over as long as its bit was set. This caused issues with hotplug and device suspension.
* Wayland: Fix error spam when interacting with decorationsRiteo2024-07-201-15/+17
| | | | | | | Also tried to make tablet handling a bit tidier (less whitespace). That said I'll uniform tablet handling better once we're back in the dev cycle.
* Wayland: commit surface on window creationRiteo2024-07-151-0/+2
| | | | | This is needed for initializing xdg_surfaces when not using libdecor. Now the pure xdg_shell code path should work again.
* Wayland: scale relative pointer motionRiteo2024-07-071-0/+5
| | | | | Oops, forgot to do that. Motion-dependent stuff should now work properly when using scaled displays.
* Wayland: minimize surface commits and limit them to the main threadRiteo2024-06-281-10/+4
| | | | | | | | | | | | | | | | | | 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/+182
|
* Reduce and prevent unnecessary random-access to `List`A Thousand Ships2024-05-041-1/+1
| | | | | | | | | Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when accessing a single element) * Removed subscript operator, in favor of a more explicit `get` * Added conversion from `Iterator` to `ConstIterator` * Remade existing operations into other solutions when applicable
* [Core] Add scalar versions of `Vector*` `min/max/clamp/snap(ped)`A Thousand Ships2024-05-021-1/+1
| | | | Convenience for a number of cases operating on single values
* Wayland: Improve compositor compatibility by allowing older globalsRiteo2024-04-261-88/+105
| | | | | | | | | | | | | | | | | | 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.
* Merge pull request #87831 from Riteo/bitfield-xorRémi Verschelde2024-03-261-1/+1
|\ | | | | | | Core: Implement a XOR operator for BitField
| * Core: Implement a XOR operator for BitFieldRiteo2024-02-011-1/+1
| |
* | [Wayland] Fix typo in input codeA Thousand Ships2024-03-201-1/+1
| |
* | clang-tidy: Enforce `modernize-use-nullptr`Thaddeus Crews2024-03-121-4/+4
| |
* | Merge pull request #89328 from Riteo/wayland-cursor-frame-optRémi Verschelde2024-03-091-7/+14
|\ \ | | | | | | | | | Wayland: Setup next cursor frame callback only if animated
| * | Wayland: Setup next cursor frame callback only if animatedRiteo2024-03-091-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | Before, the cursor kept updating for no good reason really. It's also a bit neater and it ever-so-slightly makes `WAYLAND_DEBUG` logs easier to read, although they're still spammed by the window's frame logic (which is needed).
* | | wayland: Stop possible Null pointer dereferencesAlistair Leslie-Hughes2024-03-091-4/+24
|/ /
* | [Wayland] Fix tilt handlingA Thousand Ships2024-03-031-2/+1
| |
* | Wayland: Restore tablet support and handle multiple toolsRiteo2024-02-281-116/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #82800 from Sauermann/fix-screen-mousemotionRémi Verschelde2024-02-091-0/+4
|\ \ | | | | | | | | | Add screen-related attributes to mouse input events
| * | Add screen-related attributes to mouse input eventsMarkus Sauermann2024-02-051-0/+4
| |/
* / wayland: Update to 1.22.0Jakub Marcowski2024-02-061-0/+12
|/
* [Wayland] Add support for native file dialogs.bruvzg2024-01-311-0/+33
|
* Add Wayland supportRiteo2024-01-301-0/+4004
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.