summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/display_server_x11.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Added primary clipboard for LinuxConteZero2021-10-181-5/+43
|
* Merge pull request #52684 from Frixuu/masterRémi Verschelde2021-10-011-0/+18
|\
| * Allow for mapping keycodes to current layoutFrixuu2021-09-211-0/+18
| |
* | Use range iterators for `Map`Lightning_A2021-09-301-49/+49
|/
* Mention that rebooting is required after updating graphics driver on LinuxHugo Locurcio2021-09-151-1/+2
|
* Add input buffering frameworkPedro J. Estébanez2021-08-131-1/+1
| | | | | | Input buffering is implicitly used by event accumulation, but this commit makes it more generic so it can be enabled for other uses. For desktop OSs it's currently not feasible given main and UI threads are the same).
* Improve input event accumulationPedro J. Estébanez2021-08-131-10/+10
| | | | | | - API has been simplified: all events now go through `parse_input_event()`. Whether they are accumulated or not depends on the `use_accumulated_input` flag. - Event accumulation is now thread-safe (it was not needed so far, but it prepares the ground for the following changes). - Touch drag events now support accumulation.
* Use Key enum instead of plain integersAaron Franke2021-08-101-9/+9
|
* Fix various typos with codespellluz paz2021-07-251-1/+1
| | | | Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
* Move `alert` function from `DisplayServer` to `OS`.bruvzg2021-07-221-68/+4
|
* Fix popup closing immediately after showing on some Linux WMsPouleyKetchoupp2021-07-211-3/+7
| | | | | | | | | When a popup is going to be closed, switch focus to the parent only if the popup is still being focused. Fixes some cases with specific WMs where due to the order of events, a new popup could be immediately unfocused because a previously opened and closed popup is switching focus to the parent.
* Restructure and reimplement vsync optionsHendrik Brucker2021-07-061-8/+24
| | | | | -Add a v-sync mode setting which allows to choose between DISABLED, ON, ADAPTIVE and MAILBOX -Removed the V-Sync via Compositor option
* Add "Keep screen on" feature to `DisplayServerX11`Niklas Higi2021-06-201-0/+32
|
* Use mouse and joypad enums instead of plain integersAaron Franke2021-06-201-12/+10
| | | | Also MIDIMessage
* Rename `instance()`->`instantiate()` when it's a verbLightning_A2021-06-191-7/+7
|
* Add MOUSE_MODE_CONFINED_HIDDENAaron Franke2021-06-031-4/+4
| | | | Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
* Merge pull request #48168 from LightningAA/control-to-ctrl-4.0Rémi Verschelde2021-05-171-11/+11
|\
| * Rename "Control" key to "Ctrl" and add "_pressed" suffix to all ↵Lightning_A2021-05-071-11/+11
| | | | | | | | InputEventWithModifiers properties/methods
* | Remove debugging prints in the Linux DisplayServerHugo Locurcio2021-05-081-3/+0
|/ | | | | Some Vulkan debugging prints were also changed to be printed only in verbose mode.
* Rename `doubleclick` to `double_click`Aaron Franke2021-05-041-2/+2
|
* Style: Apply clang-tidy's `modernize-use-nullptr`Rémi Verschelde2021-04-051-4/+4
|
* Rename Texture.get_data() to get_image()Marcel Admiraal2021-03-281-2/+2
|
* Rename ButtonList enum and members to MouseButtonAaron Franke2021-03-231-1/+1
|
* Linux: Fix PRIME detection on SteamRémi Verschelde2021-03-081-1/+4
| | | | | | | | | | | To avoid trying to do PRIME detection on fake `libGL.so` as used by e.g. Renderdoc or Primus, we skip detection if there's a `libGL.so` in `LD_LIBRARY_PATH`... and our luck is that Steam defines it and includes system paths too, thus the actual system `libGL`... 🤦 So if we detect Steam, we skip this check. Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
* Fix out of bounds array access on DisplayServerX11 codePedro Rodrigues2021-02-281-9/+11
| | | | | | | | | | | The problem happened on methods `screen_get_position`, `screen_get_usable_rect` and `window_set_current_screen` when they were passed a negative screen value. Fixes: - #46184 - #46185 - #46186
* Modernize atomicsPedro J. Estébanez2021-02-181-2/+2
| | | | | | | | | | - Based on C++11's `atomic` - Reworked `SafeRefCount` (based on the rewrite by @hpvb) - Replaced free atomic functions by the new `SafeNumeric<T>` - Replaced wrong cases of `volatile bool` by the new `SafeFlag` - Platform-specific implementations no longer needed Co-authored-by: Hein-Pieter van Braam-Stewart <hp@tmm.cx>
* Merge pull request #45315 from RandomShaper/modernize_threadRémi Verschelde2021-01-311-4/+2
|\ | | | | Modernize Thread
| * Modernize ThreadPedro J. Estébanez2021-01-291-4/+2
| | | | | | | | | | | | | | | | | | - Based on C++11's `thread` and `thread_local` - No more need to allocate-deallocate or check for null - No pointer anymore, just a member variable - Platform-specific implementations no longer needed (except for the few cases of non-portable functions) - Simpler for `NO_THREADS` - Thread ids are now the same across platforms (main is 1; others follow)
* | Unify URI encoding/decoding and add to C#Aaron Franke2021-01-281-1/+1
|/ | | | http_escape and percent_encode have been unified into uri_encode, and http_unescape and percent_decode have been unified into uri_decode.
* Split OS::execute into two methodsMarcel Admiraal2021-01-091-1/+1
| | | | | 1. execute(): Executes a command and returns the results. 2. create_process(): Creates a new process and returns the new process' id.
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-2/+2
|
* Fix named anonymous struct warningMarcel Admiraal2020-12-161-0/+9
|
* RenderingServer reorganizationreduz2020-12-041-2/+2
|
* Reorganize rendering server.reduz2020-12-031-1/+1
| | | | | -Made RenderingServerScene abstract, allowing reimplementation -RenderingServerRaster -> RenderingServerDefault, but this class is going away soon.
* X11: Include limits.h for LONG_MAXRémi Verschelde2020-12-021-0/+1
| | | | Fixes #44030.
* Implement INCR mechanism for Linux clipboardPouleyKetchoupp2020-11-271-25/+104
| | | | | Allows pasting from x11 clipboard to receive data incrementally, which is required when handling data size > 256KB.
* Merge pull request #42652 from nekomatata/x11-clipboard-save-targetsRémi Verschelde2020-11-261-49/+171
|\ | | | | Implement SAVE_TARGETS mechanism for Linux clipboard
| * Implement SAVE_TARGETS mechanism for Linux clipboardPouleyKetchoupp2020-10-091-49/+171
| | | | | | | | | | | | | | | | | | | | | | | | Allows sending the clipboard content to the clipboard manager on exit to keep the content when using a clipboard manager that doesn't automatically makes a backup when copying. MULTIPLE selection mechanism also had to be implemented, because in this case, the clipboard manager might request multiple selection targets at once. Known use case: Ubuntu with XFCE4
* | Add XChangeProperty Atoms validity checks.bruvzg2020-11-151-12/+33
| |
* | Fixes crash if Vulkan presentation surface is not available.bruvzg2020-11-141-0/+4
| |
* | Add X11 Atom validity checks.bruvzg2020-11-121-15/+24
| |
* | Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-2/+2
|/ | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Fix x11 display server crash when deleting popup window when unfocusedPouleyKetchoupp2020-10-081-16/+21
| | | | | | | | | | | | | | | On FocusOut events, the window could be destroyed while propagating WINDOW_EVENT_FOCUS_OUT event, which causes the WindowData to be invalidated, and still used for calls to XUnsetICFocus. This change moves calls to XUnsetICFocus, and also XSetICFocus in FocusIn events, before propagating the change of focus event to the engine, to be safe in any case. Also setting xic member to nullptr after all calls to XDestroyIC to keep things clean and consistent. Fixes #42645
* Fix delay to process clipboard content from Godot in other programsPouleyKetchoupp2020-09-251-65/+79
| | | | | | | | | | | | | | | | When pasting clipboard content from Godot to other applications, multiple SelectionRequest events are sent to Godot in order to access the data. It could take a long time before the data is ready for the other app because events were processed one by one on the main thread, especially when Godot is unfocused and runs at low frequency. With this change, SelectionRequest events are directly handled on the separate event polling thread to minimize this delay. This change also replaces clipboard_get() calls in SelectionRequest with a direct access to internal_clipboard, since in this case we know Godot is the owner of the clipboard content and it's not necessary to query the x server for it.
* Fix general keyboard input lag on X11 display serverPouleyKetchoupp2020-09-241-60/+150
| | | | | | | | | | | | | | | | | | | | | | This change makes keyboard inputs more responsive on Linux, especially when the FPS is lower on slower configurations. Polling events from the x server is done on a separate thread to avoid a frame delay with inputs, due to first sending the event to the input manager with XFilterEvent then processing the new event only on the next frame. Calls to Input Manager functions like XSetICFocus, XUnsetICFocus and XSetICValues use a mutex, because they are polling events internally and would otherwise interfere with our own thread process for polling events which can cause a deadlock in some cases. XUnsetICFocus is called instead of XSetICFocus on FocusOut events, so the input manager can be properly notified of focus changes. clipboard_get now uses a blocking call to poll for a specific event type when waiting for a SelectionNotify event, instead of polling all events and filtering them afterwards.
* X11: Try to load libXrandr.so.3 if libXrandr.so.2 isn't foundRémi Verschelde2020-09-181-1/+6
| | | | | All Linux distros, and FreeBSD and OpenBSD seem to have libXrandr.so.2, but for some reason recent NetBSD versions seem to have libXrandr.so.3 now.
* Add window click-through support.bruvzg2020-09-171-0/+33
|
* Fix drag and drop between windows in X11 display serverPouleyKetchoupp2020-09-031-15/+84
| | | | | | | | | | Proper implementation for get_window_at_screen_position: Now getting the topmost last active window when overlapping. Mouse drag & release events: They are now propagated through the current focused window, in order to make it consistent with the engine expectations and the Windows display server implementation.
* Fix menu popups delay and focus in X11 display serverPouleyKetchoupp2020-08-261-80/+159
| | | | | | Now using override_redirect for menu & tooltip popups to prevent the WM from interfering with them, so we have more control over focus management and avoid a delay before they show up.