diff options
Diffstat (limited to 'platform/linuxbsd/display_server_x11.h')
-rw-r--r-- | platform/linuxbsd/display_server_x11.h | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/platform/linuxbsd/display_server_x11.h b/platform/linuxbsd/display_server_x11.h index 1887c7105b..3587d587d6 100644 --- a/platform/linuxbsd/display_server_x11.h +++ b/platform/linuxbsd/display_server_x11.h @@ -31,6 +31,8 @@ #ifndef DISPLAY_SERVER_X11_H #define DISPLAY_SERVER_X11_H +#include "drivers/gles3/rasterizer_platforms.h" + #ifdef X11_ENABLED #include "servers/display_server.h" @@ -46,8 +48,8 @@ #include "servers/rendering/renderer_compositor.h" #include "servers/rendering_server.h" -#if defined(OPENGL_ENABLED) -#include "context_gl_x11.h" +#if defined(GLES3_ENABLED) +#include "gl_manager_x11.h" #endif #if defined(VULKAN_ENABLED) @@ -99,12 +101,12 @@ class DisplayServerX11 : public DisplayServer { Atom requested; int xdnd_version; -#if defined(OPENGL_ENABLED) - ContextGL_X11 *context_gles2; +#if defined(GLES3_ENABLED) + GLManager_X11 *gl_manager = nullptr; #endif #if defined(VULKAN_ENABLED) - VulkanContextX11 *context_vulkan; - RenderingDeviceVulkan *rendering_device_vulkan; + VulkanContextX11 *context_vulkan = nullptr; + RenderingDeviceVulkan *rendering_device_vulkan = nullptr; #endif #if defined(DBUS_ENABLED) @@ -155,6 +157,7 @@ class DisplayServerX11 : public DisplayServer { WindowID _create_window(WindowMode p_mode, VSyncMode p_vsync_mode, uint32_t p_flags, const Rect2i &p_rect); String internal_clipboard; + String internal_clipboard_primary; Window xdnd_source_window; ::Display *x11_display; char *xmbstring; @@ -170,8 +173,8 @@ class DisplayServerX11 : public DisplayServer { bool last_mouse_pos_valid; Point2i last_click_pos; uint64_t last_click_ms; - int last_click_button_index; - MouseButton last_button_state = MOUSE_BUTTON_NONE; + MouseButton last_click_button_index = MouseButton::NONE; + MouseButton last_button_state = MouseButton::NONE; bool app_focused = false; uint64_t time_since_no_focus = 0; @@ -196,6 +199,8 @@ class DisplayServerX11 : public DisplayServer { bool _refresh_device_info(); + Rect2i _screen_get_rect(int p_screen) const; + MouseButton _get_mouse_button_state(MouseButton p_x11_button, int p_x11_type); void _get_key_modifier_state(unsigned int p_x11_state, Ref<InputEventWithModifiers> state); void _flush_mouse_motion(); @@ -205,7 +210,7 @@ class DisplayServerX11 : public DisplayServer { void _handle_key_event(WindowID p_window, XKeyEvent *p_event, LocalVector<XEvent> &p_events, uint32_t &p_event_index, bool p_echo = false); - Atom _process_selection_request_target(Atom p_target, Window p_requestor, Atom p_property) const; + Atom _process_selection_request_target(Atom p_target, Window p_requestor, Atom p_property, Atom p_selection) const; void _handle_selection_request_event(XSelectionRequestEvent *p_event) const; String _clipboard_get_impl(Atom p_source, Window x11_window, Atom target) const; @@ -267,6 +272,7 @@ class DisplayServerX11 : public DisplayServer { static void _poll_events_thread(void *ud); bool _wait_for_events() const; void _poll_events(); + void _check_pending_events(LocalVector<XEvent> &r_events); static Bool _predicate_all_events(Display *display, XEvent *event, XPointer arg); static Bool _predicate_clipboard_selection(Display *display, XEvent *event, XPointer arg); @@ -290,6 +296,8 @@ public: virtual void clipboard_set(const String &p_text) override; virtual String clipboard_get() const override; + virtual void clipboard_set_primary(const String &p_text) override; + virtual String clipboard_get_primary() const override; virtual int get_screen_count() const override; virtual Point2i screen_get_position(int p_screen = SCREEN_OF_MAIN_WINDOW) const override; @@ -331,6 +339,7 @@ public: virtual void window_set_max_size(const Size2i p_size, WindowID p_window = MAIN_WINDOW_ID) override; virtual Size2i window_get_max_size(WindowID p_window = MAIN_WINDOW_ID) const override; + virtual void gl_window_make_current(DisplayServer::WindowID p_window_id) override; virtual void window_set_transient(WindowID p_window, WindowID p_parent) override; |