display_server_x11.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  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 "servers/display_server.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 "joypad_linux.h"
  43. #include "servers/audio_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 "gl_manager_x11.h"
  51. #endif
  52. #if defined(VULKAN_ENABLED)
  53. #include "drivers/vulkan/rendering_device_vulkan.h"
  54. #include "vulkan_context_x11.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 "dynwrappers/xlib-so_wrap.h"
  66. #include "dynwrappers/xcursor-so_wrap.h"
  67. #include "dynwrappers/xext-so_wrap.h"
  68. #include "dynwrappers/xinerama-so_wrap.h"
  69. #include "dynwrappers/xinput2-so_wrap.h"
  70. #include "dynwrappers/xrandr-so_wrap.h"
  71. #include "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, it's platform-specific and nothing is added
  106. //GDCLASS(DisplayServerX11, DisplayServer)
  107. _THREAD_SAFE_CLASS_
  108. Atom wm_delete;
  109. Atom xdnd_enter;
  110. Atom xdnd_position;
  111. Atom xdnd_status;
  112. Atom xdnd_action_copy;
  113. Atom xdnd_drop;
  114. Atom xdnd_finished;
  115. Atom xdnd_selection;
  116. Atom xdnd_aware;
  117. Atom requested = None;
  118. int xdnd_version = 5;
  119. #if defined(GLES3_ENABLED)
  120. GLManager_X11 *gl_manager = nullptr;
  121. #endif
  122. #if defined(VULKAN_ENABLED)
  123. VulkanContextX11 *context_vulkan = nullptr;
  124. RenderingDeviceVulkan *rendering_device_vulkan = nullptr;
  125. #endif
  126. #if defined(DBUS_ENABLED)
  127. FreeDesktopScreenSaver *screensaver = nullptr;
  128. bool keep_screen_on = false;
  129. #endif
  130. #ifdef SPEECHD_ENABLED
  131. TTS_Linux *tts = nullptr;
  132. #endif
  133. #if defined(DBUS_ENABLED)
  134. FreeDesktopPortalDesktop *portal_desktop = nullptr;
  135. #endif
  136. struct WindowData {
  137. Window x11_window;
  138. Window x11_xim_window;
  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 = false;
  181. xkb_context *xkb_ctx = nullptr;
  182. xkb_compose_table *dead_tbl = nullptr;
  183. #endif
  184. HashMap<WindowID, WindowData> windows;
  185. unsigned int last_mouse_monitor_mask = 0;
  186. uint64_t time_since_popup = 0;
  187. List<WindowID> popup_list;
  188. WindowID last_focused_window = INVALID_WINDOW_ID;
  189. WindowID window_id_counter = MAIN_WINDOW_ID;
  190. WindowID _create_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect);
  191. String internal_clipboard;
  192. String internal_clipboard_primary;
  193. Window xdnd_source_window = 0;
  194. ::Display *x11_display;
  195. char *xmbstring = nullptr;
  196. int xmblen = 0;
  197. unsigned long last_timestamp = 0;
  198. ::Time last_keyrelease_time = 0;
  199. ::XIM xim;
  200. ::XIMStyle xim_style;
  201. static int _xim_preedit_start_callback(::XIM xim, ::XPointer client_data,
  202. ::XPointer call_data);
  203. static void _xim_preedit_done_callback(::XIM xim, ::XPointer client_data,
  204. ::XPointer call_data);
  205. static void _xim_preedit_draw_callback(::XIM xim, ::XPointer client_data,
  206. ::XIMPreeditDrawCallbackStruct *call_data);
  207. static void _xim_preedit_caret_callback(::XIM xim, ::XPointer client_data,
  208. ::XIMPreeditCaretCallbackStruct *call_data);
  209. static void _xim_destroy_callback(::XIM im, ::XPointer client_data,
  210. ::XPointer call_data);
  211. Point2i last_mouse_pos;
  212. bool last_mouse_pos_valid = false;
  213. Point2i last_click_pos = Point2i(-100, -100);
  214. uint64_t last_click_ms = 0;
  215. MouseButton last_click_button_index = MouseButton::NONE;
  216. BitField<MouseButtonMask> last_button_state;
  217. bool app_focused = false;
  218. uint64_t time_since_no_focus = 0;
  219. struct {
  220. int opcode;
  221. Vector<int> touch_devices;
  222. HashMap<int, Vector2> absolute_devices;
  223. HashMap<int, Vector2> pen_pressure_range;
  224. HashMap<int, Vector2> pen_tilt_x_range;
  225. HashMap<int, Vector2> pen_tilt_y_range;
  226. HashMap<int, bool> pen_inverted_devices;
  227. XIEventMask all_event_mask;
  228. HashMap<int, Vector2> state;
  229. double pressure;
  230. bool pressure_supported;
  231. bool pen_inverted;
  232. Vector2 tilt;
  233. Vector2 mouse_pos_to_filter;
  234. Vector2 relative_motion;
  235. Vector2 raw_pos;
  236. Vector2 old_raw_pos;
  237. ::Time last_relative_time;
  238. } xi;
  239. bool _refresh_device_info();
  240. Rect2i _screen_get_rect(int p_screen) const;
  241. BitField<MouseButtonMask> _get_mouse_button_state(MouseButton p_x11_button, int p_x11_type);
  242. void _get_key_modifier_state(unsigned int p_x11_state, Ref<InputEventWithModifiers> state);
  243. void _flush_mouse_motion();
  244. MouseMode mouse_mode = MOUSE_MODE_VISIBLE;
  245. Point2i center;
  246. void _handle_key_event(WindowID p_window, XKeyEvent *p_event, LocalVector<XEvent> &p_events, uint32_t &p_event_index, bool p_echo = false);
  247. Atom _process_selection_request_target(Atom p_target, Window p_requestor, Atom p_property, Atom p_selection) const;
  248. void _handle_selection_request_event(XSelectionRequestEvent *p_event) const;
  249. void _update_window_mouse_passthrough(WindowID p_window);
  250. String _clipboard_get_impl(Atom p_source, Window x11_window, Atom target) const;
  251. String _clipboard_get(Atom p_source, Window x11_window) const;
  252. void _clipboard_transfer_ownership(Atom p_source, Window x11_window) const;
  253. bool do_mouse_warp = false;
  254. const char *cursor_theme = nullptr;
  255. int cursor_size = 0;
  256. XcursorImage *img[CURSOR_MAX];
  257. Cursor cursors[CURSOR_MAX];
  258. Cursor null_cursor;
  259. CursorShape current_cursor = CURSOR_ARROW;
  260. HashMap<CursorShape, Vector<Variant>> cursors_cache;
  261. String rendering_driver;
  262. void set_wm_fullscreen(bool p_enabled);
  263. void set_wm_above(bool p_enabled);
  264. typedef xrr_monitor_info *(*xrr_get_monitors_t)(Display *dpy, Window window, Bool get_active, int *nmonitors);
  265. typedef void (*xrr_free_monitors_t)(xrr_monitor_info *monitors);
  266. xrr_get_monitors_t xrr_get_monitors = nullptr;
  267. xrr_free_monitors_t xrr_free_monitors = nullptr;
  268. void *xrandr_handle = nullptr;
  269. Bool xrandr_ext_ok;
  270. struct Property {
  271. unsigned char *data;
  272. int format, nitems;
  273. Atom type;
  274. };
  275. static Property _read_property(Display *p_display, Window p_window, Atom p_property);
  276. void _update_real_mouse_position(const WindowData &wd);
  277. bool _window_maximize_check(WindowID p_window, const char *p_atom_name) const;
  278. bool _window_fullscreen_check(WindowID p_window) const;
  279. bool _window_minimize_check(WindowID p_window) const;
  280. void _validate_mode_on_map(WindowID p_window);
  281. void _update_size_hints(WindowID p_window);
  282. void _set_wm_fullscreen(WindowID p_window, bool p_enabled, bool p_exclusive);
  283. void _set_wm_maximized(WindowID p_window, bool p_enabled);
  284. void _set_wm_minimized(WindowID p_window, bool p_enabled);
  285. void _update_context(WindowData &wd);
  286. Context context = CONTEXT_ENGINE;
  287. WindowID _get_focused_window_or_popup() const;
  288. void _send_window_event(const WindowData &wd, WindowEvent p_event);
  289. static void _dispatch_input_events(const Ref<InputEvent> &p_event);
  290. void _dispatch_input_event(const Ref<InputEvent> &p_event);
  291. mutable Mutex events_mutex;
  292. Thread events_thread;
  293. SafeFlag events_thread_done;
  294. LocalVector<XEvent> polled_events;
  295. static void _poll_events_thread(void *ud);
  296. bool _wait_for_events() const;
  297. void _poll_events();
  298. void _check_pending_events(LocalVector<XEvent> &r_events);
  299. static Bool _predicate_all_events(Display *display, XEvent *event, XPointer arg);
  300. static Bool _predicate_clipboard_selection(Display *display, XEvent *event, XPointer arg);
  301. static Bool _predicate_clipboard_incr(Display *display, XEvent *event, XPointer arg);
  302. static Bool _predicate_clipboard_save_targets(Display *display, XEvent *event, XPointer arg);
  303. protected:
  304. void _window_changed(XEvent *event);
  305. public:
  306. bool mouse_process_popups();
  307. void popup_open(WindowID p_window);
  308. void popup_close(WindowID p_window);
  309. virtual bool has_feature(Feature p_feature) const override;
  310. virtual String get_name() const override;
  311. #ifdef SPEECHD_ENABLED
  312. virtual bool tts_is_speaking() const override;
  313. virtual bool tts_is_paused() const override;
  314. virtual TypedArray<Dictionary> tts_get_voices() const override;
  315. 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;
  316. virtual void tts_pause() override;
  317. virtual void tts_resume() override;
  318. virtual void tts_stop() override;
  319. #endif
  320. #if defined(DBUS_ENABLED)
  321. virtual bool is_dark_mode_supported() const override;
  322. virtual bool is_dark_mode() const override;
  323. #endif
  324. virtual void mouse_set_mode(MouseMode p_mode) override;
  325. virtual MouseMode mouse_get_mode() const override;
  326. virtual void warp_mouse(const Point2i &p_position) override;
  327. virtual Point2i mouse_get_position() const override;
  328. virtual BitField<MouseButtonMask> mouse_get_button_state() const override;
  329. virtual void clipboard_set(const String &p_text) override;
  330. virtual String clipboard_get() const override;
  331. virtual void clipboard_set_primary(const String &p_text) override;
  332. virtual String clipboard_get_primary() const override;
  333. virtual int get_screen_count() const override;
  334. virtual int get_primary_screen() const override;
  335. virtual Point2i screen_get_position(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
  336. virtual Size2i screen_get_size(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
  337. virtual Rect2i screen_get_usable_rect(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
  338. virtual int screen_get_dpi(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
  339. virtual float screen_get_refresh_rate(int p_screen = SCREEN_OF_MAIN_WINDOW) const override;
  340. #if defined(DBUS_ENABLED)
  341. virtual void screen_set_keep_on(bool p_enable) override;
  342. virtual bool screen_is_kept_on() const override;
  343. #endif
  344. virtual Vector<DisplayServer::WindowID> get_window_list() const override;
  345. virtual WindowID create_sub_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect = Rect2i()) override;
  346. virtual void show_window(WindowID p_id) override;
  347. virtual void delete_sub_window(WindowID p_id) override;
  348. virtual WindowID window_get_active_popup() const override;
  349. virtual void window_set_popup_safe_rect(WindowID p_window, const Rect2i &p_rect) override;
  350. virtual Rect2i window_get_popup_safe_rect(WindowID p_window) const override;
  351. virtual WindowID get_window_at_screen_position(const Point2i &p_position) const override;
  352. virtual int64_t window_get_native_handle(HandleType p_handle_type, WindowID p_window = MAIN_WINDOW_ID) const override;
  353. virtual void window_attach_instance_id(ObjectID p_instance, WindowID p_window = MAIN_WINDOW_ID) override;
  354. virtual ObjectID window_get_attached_instance_id(WindowID p_window = MAIN_WINDOW_ID) const override;
  355. virtual void window_set_title(const String &p_title, WindowID p_window = MAIN_WINDOW_ID) override;
  356. virtual void window_set_mouse_passthrough(const Vector<Vector2> &p_region, WindowID p_window = MAIN_WINDOW_ID) override;
  357. virtual void window_set_rect_changed_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
  358. virtual void window_set_window_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
  359. virtual void window_set_input_event_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
  360. virtual void window_set_input_text_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
  361. virtual void window_set_drop_files_callback(const Callable &p_callable, WindowID p_window = MAIN_WINDOW_ID) override;
  362. virtual int window_get_current_screen(WindowID p_window = MAIN_WINDOW_ID) const override;
  363. virtual void window_set_current_screen(int p_screen, WindowID p_window = MAIN_WINDOW_ID) override;
  364. virtual Point2i window_get_position(WindowID p_window = MAIN_WINDOW_ID) const override;
  365. virtual Point2i window_get_position_with_decorations(WindowID p_window = MAIN_WINDOW_ID) const override;
  366. virtual void window_set_position(const Point2i &p_position, WindowID p_window = MAIN_WINDOW_ID) override;
  367. virtual void window_set_max_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
  368. virtual Size2i window_get_max_size(WindowID p_window = MAIN_WINDOW_ID) const override;
  369. virtual void gl_window_make_current(DisplayServer::WindowID p_window_id) override;
  370. virtual void window_set_transient(WindowID p_window, WindowID p_parent) override;
  371. virtual void window_set_min_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
  372. virtual Size2i window_get_min_size(WindowID p_window = MAIN_WINDOW_ID) const override;
  373. virtual void window_set_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override;
  374. virtual Size2i window_get_size(WindowID p_window = MAIN_WINDOW_ID) const override;
  375. virtual Size2i window_get_size_with_decorations(WindowID p_window = MAIN_WINDOW_ID) const override;
  376. virtual void window_set_mode(WindowMode p_mode, WindowID p_window = MAIN_WINDOW_ID) override;
  377. virtual WindowMode window_get_mode(WindowID p_window = MAIN_WINDOW_ID) const override;
  378. virtual bool window_is_maximize_allowed(WindowID p_window = MAIN_WINDOW_ID) const override;
  379. virtual void window_set_flag(WindowFlags p_flag, bool p_enabled, WindowID p_window = MAIN_WINDOW_ID) override;
  380. virtual bool window_get_flag(WindowFlags p_flag, WindowID p_window = MAIN_WINDOW_ID) const override;
  381. virtual void window_request_attention(WindowID p_window = MAIN_WINDOW_ID) override;
  382. virtual void window_move_to_foreground(WindowID p_window = MAIN_WINDOW_ID) override;
  383. virtual bool window_can_draw(WindowID p_window = MAIN_WINDOW_ID) const override;
  384. virtual bool can_any_window_draw() const override;
  385. virtual void window_set_ime_active(const bool p_active, WindowID p_window = MAIN_WINDOW_ID) override;
  386. virtual void window_set_ime_position(const Point2i &p_pos, WindowID p_window = MAIN_WINDOW_ID) override;
  387. virtual Point2i ime_get_selection() const override;
  388. virtual String ime_get_text() const override;
  389. virtual void window_set_vsync_mode(DisplayServer::VSyncMode p_vsync_mode, WindowID p_window = MAIN_WINDOW_ID) override;
  390. virtual DisplayServer::VSyncMode window_get_vsync_mode(WindowID p_vsync_mode) const override;
  391. virtual void cursor_set_shape(CursorShape p_shape) override;
  392. virtual CursorShape cursor_get_shape() const override;
  393. virtual void cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) override;
  394. virtual int keyboard_get_layout_count() const override;
  395. virtual int keyboard_get_current_layout() const override;
  396. virtual void keyboard_set_current_layout(int p_index) override;
  397. virtual String keyboard_get_layout_language(int p_index) const override;
  398. virtual String keyboard_get_layout_name(int p_index) const override;
  399. virtual Key keyboard_get_keycode_from_physical(Key p_keycode) const override;
  400. virtual void process_events() override;
  401. virtual void release_rendering_thread() override;
  402. virtual void make_rendering_thread() override;
  403. virtual void swap_buffers() override;
  404. virtual void set_context(Context p_context) override;
  405. virtual void set_native_icon(const String &p_filename) override;
  406. virtual void set_icon(const Ref<Image> &p_icon) override;
  407. 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);
  408. static Vector<String> get_rendering_drivers_func();
  409. static void register_x11_driver();
  410. 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);
  411. ~DisplayServerX11();
  412. };
  413. #endif // X11 enabled
  414. #endif // DISPLAY_SERVER_X11_H