summaryrefslogtreecommitdiffstats
path: root/platform/linuxbsd/display_server_x11.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix BadWindow X11 errors when a window is closed while processing strutsPouleyKetchoupp2021-11-041-2/+21
| | | | | | | | | A window can be closed on the server side while processing results from _NET_CLIENT_LIST, which causes BadWindow fatal errors by default in XGetWindowProperty. The only way to safely catch this case is to set an error handler to ignore BadWindow errors while these commands are processed.
* Merge pull request #41565 from nekomatata/x11-usable-screen-sizeRémi Verschelde2021-11-011-11/+257
|\
| * Implemented screen_get_usable_rect for X11 Display ServerPouleyKetchoupp2021-10-291-11/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Helps with fixing issues with scrolling popups not respecting screen decorations on the display server side. Reproduction steps for a simple use case: - Start the editor project list - Open the language selection popup Support for multi-screen: Handling decorations is supported in different ways depending on the information the window manager provides: - _GTK_WORKAREAS is used when available from the WM to get accurate rect for the different screens directly (available on Gnome). - Alternatively, strut information is used to calculate available space for a given desktop manually (XFCE, KDE). - As last resort _NET_WORKAREA is used. It provides one full rect for all screens, which doesn't handle decorations on the secondary screen in all cases.
* | Use OpenGL 3.3 core profile instead of compatibility profileClay John2021-10-311-29/+22
| | | | | | | | | | | | | | | | | | | | - Rename OpenGL to GLES3 in the source code per community feedback. - The renderer is still exposed as "OpenGL 3" to the user. - Hide renderer selection dropdown until OpenGL support is more mature. - The renderer can still be changed in the Project Settings or using the `--rendering-driver opengl` command line argument. - Remove commented out exporter code. - Remove some OpenGL/DisplayServer-related debugging prints.
* | Rename GLES2 driver to OpenGL to prepare for the upgrade to GLES3Hugo Locurcio2021-10-301-30/+26
| | | | | | | | | | - Use lowercase driver names for the `--rendering-driver` command line argument.
* | Add GLES2 2D renderer + Linux display managerlawnjelly2021-10-301-22/+105
|/ | | | | | | | | First implementation with Linux display manager. - Add single-threaded mode for EditorResourcePreview (needed for OpenGL). Co-authored-by: clayjohn <claynjohn@gmail.com> Co-authored-by: Fabio Alessandrelli <fabio.alessandrelli@gmail.com>
* Merge pull request #42117 from nekomatata/x11-get-window-screenRémi Verschelde2021-10-281-26/+49
|\ | | | | Fix window_get_current_screen for X11 display server
| * Fix window_get_current_screen for X11 display serverPouleyKetchoupp2021-10-281-26/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | This method used to check which screen contains the top-left corner of the window (and default to the first screen in case none is found), which is not accurate in some cases. Now the area of overlap with each screen is calculated, so we can get the best candidate based on the window's position. This makes window_get_current_screen consistent with Windows platform, and fixes an issue where popups appear on the main screen when the main window is slightly moved outside of the desktop on the top or left.
* | clang-format: Various fixes to comments alignment from `clang-format` 13Rémi Verschelde2021-10-281-21/+1
| | | | | | | | All reviewed manually and occasionally rewritten to avoid bad auto formatting.
* | clang-format: Disable alignment of operands, too unreliableRémi Verschelde2021-10-281-19/+19
|/ | | | | | | | | Sets `AlignOperands` to `DontAlign`. `clang-format` developers seem to mostly care about space-based indentation and every other version of clang-format breaks the bad mismatch of tabs and spaces that it seems to use for operand alignment. So it's better without, so that it respects our two-tabs `ContinuationIndentWidth`.
* Fix input events random delay on X11PouleyKetchoupp2021-10-271-18/+28
| | | | | | | | | | | The new system based on a thread gathering events from the X11 server was causing delays in some scenarios where some events have just been missed at the time of processing and we're waiting for a whole frame to check them again. Solved by flushing again and checking for pending events at the beginning of the process loop, in addition to events already gathered on the event thread.
* Fix primary clipboard warningConteZero2021-10-231-0/+1
|
* 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