display_server_x11.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. /**************************************************************************/
  2. /* display_server_x11.h */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #ifndef DISPLAY_SERVER_X11_H
  31. #define DISPLAY_SERVER_X11_H
  32. #ifdef X11_ENABLED
  33. #include "joypad_linux.h"
  34. #include "core/input/input.h"
  35. #include "core/os/mutex.h"
  36. #include "core/os/thread.h"
  37. #include "core/templates/local_vector.h"
  38. #include "drivers/alsa/audio_driver_alsa.h"
  39. #include "drivers/alsamidi/midi_driver_alsamidi.h"
  40. #include "drivers/pulseaudio/audio_driver_pulseaudio.h"
  41. #include "drivers/unix/os_unix.h"
  42. #include "servers/audio_server.h"
  43. #include "servers/display_server.h"
  44. #include "servers/rendering/renderer_compositor.h"
  45. #include "servers/rendering_server.h"
  46. #if defined(SPEECHD_ENABLED)
  47. #include "tts_linux.h"
  48. #endif
  49. #if defined(GLES3_ENABLED)
  50. #include "x11/gl_manager_x11.h"
  51. #endif
  52. #if defined(VULKAN_ENABLED)
  53. #include "x11/vulkan_context_x11.h"
  54. #include "drivers/vulkan/rendering_device_vulkan.h"
  55. #endif
  56. #if defined(DBUS_ENABLED)
  57. #include "freedesktop_portal_desktop.h"
  58. #include "freedesktop_screensaver.h"
  59. #endif
  60. #include <X11/Xatom.h>
  61. #include <X11/Xlib.h>
  62. #include <X11/Xutil.h>
  63. #include <X11/keysym.h>
  64. #ifdef SOWRAP_ENABLED
  65. #include "x11/dynwrappers/xlib-so_wrap.h"
  66. #include "x11/dynwrappers/xcursor-so_wrap.h"
  67. #include "x11/dynwrappers/xext-so_wrap.h"
  68. #include "x11/dynwrappers/xinerama-so_wrap.h"
  69. #include "x11/dynwrappers/xinput2-so_wrap.h"
  70. #include "x11/dynwrappers/xrandr-so_wrap.h"
  71. #include "x11/dynwrappers/xrender-so_wrap.h"
  72. #include "xkbcommon-so_wrap.h"
  73. #else
  74. #include <X11/XKBlib.h>
  75. #include <X11/Xlib.h>
  76. #include <X11/Xutil.h>
  77. #include <X11/Xcursor/Xcursor.h>
  78. #include <X11/extensions/XInput2.h>
  79. #include <X11/extensions/Xext.h>
  80. #include <X11/extensions/Xinerama.h>
  81. #include <X11/extensions/Xrandr.h>
  82. #include <X11/extensions/Xrender.h>
  83. #include <X11/extensions/shape.h>
  84. #ifdef XKB_ENABLED
  85. #include <xkbcommon/xkbcommon-compose.h>
  86. #include <xkbcommon/xkbcommon-keysyms.h>
  87. #include <xkbcommon/xkbcommon.h>
  88. #endif
  89. #endif
  90. typedef struct _xrr_monitor_info {
  91. Atom name;
  92. Bool primary = false;
  93. Bool automatic = false;
  94. int noutput = 0;
  95. int x = 0;
  96. int y = 0;
  97. int width = 0;
  98. int height = 0;
  99. int mwidth = 0;
  100. int mheight = 0;
  101. RROutput *outputs = nullptr;
  102. } xrr_monitor_info;
  103. #undef CursorShape
  104. class DisplayServerX11 : public DisplayServer {
  105. // No need to register with GDCLASS, it's platform-specific and nothing is added.
  106. _THREAD_SAFE_CLASS_
  107. Atom wm_delete;
  108. Atom xdnd_enter;
  109. Atom xdnd_position;
  110. Atom xdnd_status;
  111. Atom xdnd_action_copy;
  112. Atom xdnd_drop;
  113. Atom xdnd_finished;
  114. Atom xdnd_selection;
  115. Atom xdnd_aware;
  116. Atom requested = None;
  117. int xdnd_version = 5;
  118. #if defined(GLES3_ENABLED)
  119. GLManager_X11 *gl_manager = nullptr;
  120. #endif
  121. #if defined(VULKAN_ENABLED)
  122. VulkanContextX11 *context_vulkan = nullptr;
  123. RenderingDeviceVulkan *rendering_device_vulkan = nullptr;
  124. #endif
  125. #if defined(DBUS_ENABLED)
  126. FreeDesktopScreenSaver *screensaver = nullptr;
  127. bool keep_screen_on = false;
  128. #endif
  129. #ifdef SPEECHD_ENABLED
  130. TTS_Linux *tts = nullptr;
  131. #endif
  132. #if defined(DBUS_ENABLED)
  133. FreeDesktopPortalDesktop *portal_desktop = nullptr;
  134. #endif
  135. struct WindowData {
  136. Window x11_window;
  137. Window x11_xim_window;
  138. Window parent;
  139. ::XIC xic;
  140. bool ime_active = false;
  141. bool ime_in_progress = false;
  142. bool ime_suppress_next_keyup = false;
  143. #ifdef XKB_ENABLED
  144. xkb_compose_state *xkb_state = nullptr;
  145. #endif
  146. Size2i min_size;
  147. Size2i max_size;
  148. Point2i position;
  149. Size2i size;
  150. Callable rect_changed_callback;
  151. Callable event_callback;
  152. Callable input_event_callback;
  153. Callable input_text_callback;
  154. Callable drop_files_callback;
  155. Vector<Vector2> mpath;
  156. WindowID transient_parent = INVALID_WINDOW_ID;
  157. HashSet<WindowID> transient_children;
  158. ObjectID instance_id;
  159. bool no_focus = false;
  160. //better to guess on the fly, given WM can change it
  161. //WindowMode mode;
  162. bool fullscreen = false; //OS can't exit from this mode
  163. bool exclusive_fullscreen = false;
  164. bool on_top = false;
  165. bool borderless = false;
  166. bool resize_disabled = false;
  167. Vector2i last_position_before_fs;
  168. bool focused = true;
  169. bool minimized = false;
  170. bool maximized = false;
  171. bool is_popup = false;
  172. bool layered_window = false;
  173. bool mpass = false;
  174. Rect2i parent_safe_rect;
  175. unsigned int focus_order = 0;
  176. };
  177. Point2i im_selection;
  178. String im_text;
  179. #ifdef XKB_ENABLED
  180. bool xkb_loaded_v05p = false;
  181. bool xkb_loaded_v08p = false;
  182. xkb_context *xkb_ctx = nullptr;
  183. xkb_compose_table *dead_tbl = nullptr;
  184. #endif
  185. HashMap<WindowID, WindowData> windows;
  186. unsigned int last_mouse_monitor_mask = 0;
  187. uint64_t time_since_popup = 0;
  188. List<WindowID> popup_list;
  189. WindowID last_focused_window = INVALID_WINDOW_ID;
  190. WindowID window_id_counter = MAIN_WINDOW_ID;
  191. WindowID _create_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect);
  192. String internal_clipboard;
  193. String internal_clipboard_primary;
  194. Window xdnd_source_window = 0;
  195. ::Display *x11_display;
  196. char *xmbstring = nullptr;
  197. int xmblen = 0;
  198. unsigned long last_timestamp = 0;
  199. ::Time last_keyrelease_time = 0;
  200. ::XIM xim;
  201. ::XIMStyle xim_style;
  202. static int _xim_preedit_start_callback(::XIM xim, ::XPointer client_data,
  203. ::XPointer call_data);
  204. static void _xim_preedit_done_callback(::XIM xim, ::XPointer client_data,
  205. ::XPointer call_data);
  206. static void _xim_preedit_draw_callback(::XIM xim, ::XPointer client_data,
  207. ::XIMPreeditDrawCallbackStruct *call_data);
  208. static void _xim_preedit_caret_callback(::XIM xim, ::XPointer client_data,
  209. ::XIMPreeditCaretCallbackStruct *call_data);
  210. static void _xim_destroy_callback(::XIM im, ::XPointer client_data,
  211. ::XPointer call_data);
  212. Point2i last_mouse_pos;
  213. bool last_mouse_pos_valid = false;
  214. Point2i last_click_pos = Point2i(-100, -100);
  215. uint64_t last_click_ms = 0;
  216. MouseButton last_click_button_index = MouseButton::NONE;
  217. BitField<MouseButtonMask> last_button_state;
  218. bool app_focused = false;
  219. uint64_t time_since_no_focus = 0;
  220. struct {
  221. int opcode;
  222. Vector<int> touch_devices;
  223. HashMap<int, Vector2> absolute_devices;
  224. HashMap<int, Vector2> pen_pressure_range;
  225. HashMap<int, Vector2> pen_tilt_x_range;
  226. HashMap<int, Vector2> pen_tilt_y_range;
  227. HashMap<int, bool> pen_inverted_devices;
  228. XIEventMask all_event_mask;
  229. HashMap<int, Vector2> state;
  230. double pressure;
  231. bool pressure_supported;
  232. bool pen_inverted;
  233. Vector2 tilt;
  234. Vector2 mouse_pos_to_filter;
  235. Vector2 relative_motion;
  236. Vector2 raw_pos;
  237. Vector2 old_raw_pos;
  238. ::Time last_relative_time;
  239. } xi;
  240. bool _refresh_device_info();
  241. Rect2i _screen_get_rect(int p_screen) const;
  242. BitField<MouseButtonMask> _get_mouse_button_state(MouseButton p_x11_button, int p_x11_type);
  243. void _get_key_modifier_state(unsigned int p_x11_state, Ref<InputEventWithModifiers> state);
  244. void _flush_mouse_motion();
  245. MouseMode mouse_mode = MOUSE_MODE_VISIBLE;
  246. Point2i center;
  247. void _handle_key_event(WindowID p_window, XKeyEvent *p_event, LocalVector<XEvent> &p_events, uint32_t &p_event_index, bool p_echo = false);
  248. Atom _process_selection_request_target(Atom p_target, Window p_requestor, Atom p_property, Atom p_selection) const;
  249. void _handle_selection_request_event(XSelectionRequestEvent *p_event) const;
  250. void _update_window_mouse_passthrough(WindowID p_window);
  251. String _clipboard_get_impl(Atom p_source, Window x11_window, Atom target) const;
  252. String _clipboard_get(Atom p_source, Window x11_window) const;
  253. void _clipboard_transfer_ownership(Atom p_source, Window x11_window) const;
  254. bool do_mouse_warp = false;
  255. const char *cursor_theme = nullptr;
  256. int cursor_size = 0;
  257. XcursorImage *cursor_img[CURSOR_MAX];
  258. Cursor cursors[CURSOR_MAX];
  259. Cursor null_cursor;
  260. CursorShape current_cursor = CURSOR_ARROW;
  261. HashMap<CursorShape, Vector<Variant>> cursors_cache;
  262. String rendering_driver;
  263. void set_wm_fullscreen(bool p_enabled);
  264. void set_wm_above(bool p_enabled);
  265. typedef xrr_monitor_info *(*xrr_get_monitors_t)(Display *dpy, Window window, Bool get_active, int *nmonitors);
  266. typedef void (*xrr_free_monitors_t)(xrr_monitor_info *monitors);
  267. xrr_get_monitors_t xrr_get_monitors = nullptr;
  268. xrr_free_monitors_t xrr_free_monitors = nullptr;
  269. void *xrandr_handle = nullptr;
  270. bool xrandr_ext_ok = true;
  271. bool xinerama_ext_ok = true;
  272. bool xshaped_ext_ok = true;
  273. struct Property {
  274. unsigned char *data;
  275. int format, nitems;
  276. Atom type;
  277. };
  278. static Property _read_property(Display *p_display, Window p_window, Atom p_property);
  279. void _update_real_mouse_position(const WindowData &wd);
  280. bool _window_maximize_check(WindowID p_window, const char *p_atom_name) const;
  281. bool _window_fullscreen_check(WindowID p_window) const;
  282. bool _window_minimize_check(WindowID p_window) const;
  283. void _validate_mode_on_map(WindowID p_window);
  284. void _update_size_hints(WindowID p_window);
  285. void _set_wm_fullscreen(WindowID p_window, bool p_enabled, bool p_exclusive);
  286. void _set_wm_maximized(WindowID p_window, bool p_enabled);
  287. void _set_wm_minimized(WindowID p_window, bool p_enabled);
  288. void _update_context(WindowData &wd);
  289. Context context = CONTEXT_ENGINE;
  290. WindowID _get_focused_window_or_popup() const;
  291. void _send_window_event(const WindowData &wd, WindowEvent p_event);
  292. static void _dispatch_input_events(const Ref<InputEvent> &p_event);
  293. void _dispatch_input_event(const Ref<InputEvent> &p_event);
  294. mutable Mutex events_mutex;
  295. Thread events_thread;
  296. SafeFlag events_thread_done;
  297. LocalVector<XEvent> polled_events;
  298. static void _poll_events_thread(void *ud);
  299. bool _wait_for_events() const;
  300. void _poll_events();
  301. void _check_pending_events(LocalVector<XEvent> &r_events);
  302. static Bool _predicate_all_events(Display *display, XEvent *event, XPointer arg);
  303. static Bool _predicate_clipboard_selection(Display *display, XEvent *event, XPointer arg);
  304. static Bool _predicate_clipboard_incr(Display *display, XEvent *event, XPointer arg);
  305. static Bool _predicate_clipboard_save_targets(Display *display, XEvent *event, XPointer arg);
  306. protected:
  307. void _window_changed(XEvent *event);
  308. public:
  309. bool mouse_process_popups();
  310. void popup_open(WindowID p_window);
  311. void popup_close(WindowID p_window);
  312. virtual bool has_feature(Feature p_feature) const override;
  313. virtual String get_name() const override;
  314. #ifdef SPEECHD_ENABLED
  315. virtual bool tts_is_speaking() const override;
  316. virtual bool tts_is_paused() const override;
  317. virtual TypedArray<Dictionary> tts_get_voices() const override;
  318. virtual void tts_speak(const String &p_text, const String &p_voice, int p_volume = 50, float p_pitch = 1.f, float p_rate = 1.f, int p_utterance_id = 0, bool p_interrupt = false) override;
  319. virtual void tts_pause() override;
  320. virtual void tts_resume() override;
  321. virtual void tts_stop() override;
  322. #endif
  323. #if defined(DBUS_ENABLED)
  324. virtual bool is_dark_mode_supported() const override;
  325. virtual bool is_dark_mode() const override;
  326. #endif
  327. virtual void mouse_set_mode(MouseMode p_mode) override;
  328. virtual MouseMode mouse_get_mode() const override;
  329. virtual void warp_mouse(const Point2i &p_position) override;
  330. virtual Point2i mouse_get_position() const override;
  331. virtual BitField<MouseButtonMask> mouse_get_button_state() const override;
  332. virtual void clipboard_set(const String &p_text) override;
  333. virtual String clipboard_get() const override;
  334. virtual void clipboard_set_primary(const String &p_text) override;
  335. virtual String clipboard_get_primary() const override;
  336. virtual int get_screen_count() const override;
  337. virtual int get_primary_screen() const override;
  338. virtual int get_keyboard_focus_screen() const override;
  339. virtual Point2i screen_get_position(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
  340. virtual Size2i screen_get_size(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
  341. virtual Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
  342. virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
  343. virtual float screen_get_refresh_rate(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
  344. virtual Color screen_get_pixel(const Point2i &p_position) const override;
  345. virtual Ref<Image> screen_get_image(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
  346. #if defined(DBUS_ENABLED)
  347. virtual void screen_set_keep_on(bool p_enable) override;
  348. virtual bool screen_is_kept_on() const override;
  349. #endif
  350. virtual Vector<DisplayServer::WindowID> get_window_list() const override;
  351. virtual WindowID create_sub_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect = Rect2i()) override;
  352. virtual void show_window(WindowID p_id) override;
  353. virtual void delete_sub_window(WindowID p_id) override;
  354. virtual WindowID window_get_active_popup() const override;
  355. virtual void window_set_popup_safe_rect(WindowID p_window, const Rect2i &p_rect) override;
  356. virtual Rect2i window_get_popup_safe_rect(WindowID p_window) const override;
  357. virtual WindowID get_window_at_screen_position(const Point2i &p_position) const override;
  358. virtual int64_t window_get_native_handle(HandleType p_handle_type, WindowID p_window = MAIN_WINDOW_ID) const override;
  359. virtual void window_attach_instance_id(ObjectID p_instance, WindowID p_window = MAIN_WINDOW_ID) override;
  360. virtual ObjectID window_get_attached_instance_id(WindowID p_window = MAIN_WINDOW_ID) const override;
  361. virtual void window_set_title(const String &p_title, WindowID p_window = MAIN_WINDOW_ID) override;
  362. virtual void window_set_mouse_passthrough(const Vector<Vector2> &p_region, WindowID p_window = MAIN_WINDOW_ID) override;
  363. virtual void window_set_rect_changed_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
  364. virtual void window_set_window_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
  365. virtual void window_set_input_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
  366. virtual void window_set_input_text_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
  367. virtual void window_set_drop_files_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
  368. virtual int window_get_current_screen(WindowID p_window = MAIN_WINDOW_ID) const override;
  369. virtual void window_set_current_screen(int p_screen, WindowID p_window = MAIN_WINDOW_ID) override;
  370. virtual Point2i window_get_position(WindowID p_window = MAIN_WINDOW_ID) const override;
  371. virtual Point2i window_get_position_with_decorations(WindowID p_window = MAIN_WINDOW_ID) const override;
  372. virtual void window_set_position(const Point2i &p_position, WindowID p_window = MAIN_WINDOW_ID) override;
  373. virtual void window_set_max_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
  374. virtual Size2i window_get_max_size(WindowID p_window = MAIN_WINDOW_ID) const override;
  375. virtual void gl_window_make_current(DisplayServer::WindowID p_window_id) override;
  376. virtual void window_set_transient(WindowID p_window, WindowID p_parent) override;
  377. virtual void window_set_min_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
  378. virtual Size2i window_get_min_size(WindowID p_window = MAIN_WINDOW_ID) const override;
  379. virtual void window_set_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
  380. virtual Size2i window_get_size(WindowID p_window = MAIN_WINDOW_ID) const override;
  381. virtual Size2i window_get_size_with_decorations(WindowID p_window = MAIN_WINDOW_ID) const override;
  382. virtual void window_set_mode(WindowMode p_mode, WindowID p_window = MAIN_WINDOW_ID) override;
  383. virtual WindowMode window_get_mode(WindowID p_window = MAIN_WINDOW_ID) const override;
  384. virtual bool window_is_maximize_allowed(WindowID p_window = MAIN_WINDOW_ID) const override;
  385. virtual void window_set_flag(WindowFlags p_flag, bool p_enabled, WindowID p_window = MAIN_WINDOW_ID) override;
  386. virtual bool window_get_flag(WindowFlags p_flag, WindowID p_window = MAIN_WINDOW_ID) const override;
  387. virtual void window_request_attention(WindowID p_window = MAIN_WINDOW_ID) override;
  388. virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) override;
  389. virtual bool window_is_focused(WindowID p_window = MAIN_WINDOW_ID) const override;
  390. virtual bool window_can_draw(WindowID p_window = MAIN_WINDOW_ID) const override;
  391. virtual bool can_any_window_draw() const override;
  392. virtual void window_set_ime_active(const bool p_active, WindowID p_window = MAIN_WINDOW_ID) override;
  393. virtual void window_set_ime_position(const Point2i &p_pos, WindowID p_window = MAIN_WINDOW_ID) override;
  394. virtual Point2i ime_get_selection() const override;
  395. virtual String ime_get_text() const override;
  396. virtual void window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window = MAIN_WINDOW_ID) override;
  397. virtual DisplayServer::VSyncMode window_get_vsync_mode(WindowID p_vsync_mode) const override;
  398. virtual void cursor_set_shape(CursorShape p_shape) override;
  399. virtual CursorShape cursor_get_shape() const override;
  400. virtual void cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) override;
  401. virtual int keyboard_get_layout_count() const override;
  402. virtual int keyboard_get_current_layout() const override;
  403. virtual void keyboard_set_current_layout(int p_index) override;
  404. virtual String keyboard_get_layout_language(int p_index) const override;
  405. virtual String keyboard_get_layout_name(int p_index) const override;
  406. virtual Key keyboard_get_keycode_from_physical(Key p_keycode) const override;
  407. virtual void process_events() override;
  408. virtual void release_rendering_thread() override;
  409. virtual void make_rendering_thread() override;
  410. virtual void swap_buffers() override;
  411. virtual void set_context(Context p_context) override;
  412. virtual void set_native_icon(const String &p_filename) override;
  413. virtual void set_icon(const Ref<Image> &p_icon) override;
  414. static DisplayServer *create_func(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, Error &r_error);
  415. static Vector<String> get_rendering_drivers_func();
  416. static void register_x11_driver();
  417. DisplayServerX11(const String &p_rendering_driver, WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Vector2i *p_position, const Vector2i &p_resolution, int p_screen, Error &r_error);
  418. ~DisplayServerX11();
  419. };
  420. #endif // X11_ENABLED
  421. #endif // DISPLAY_SERVER_X11_H