summaryrefslogtreecommitdiff
path: root/platform/linuxbsd/display_server_x11.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/linuxbsd/display_server_x11.h')
-rw-r--r--platform/linuxbsd/display_server_x11.h61
1 files changed, 30 insertions, 31 deletions
diff --git a/platform/linuxbsd/display_server_x11.h b/platform/linuxbsd/display_server_x11.h
index 3d49886b94..9ce6a557db 100644
--- a/platform/linuxbsd/display_server_x11.h
+++ b/platform/linuxbsd/display_server_x11.h
@@ -100,8 +100,8 @@ class DisplayServerX11 : public DisplayServer {
Atom xdnd_finished;
Atom xdnd_selection;
Atom xdnd_aware;
- Atom requested;
- int xdnd_version;
+ Atom requested = None;
+ int xdnd_version = 5;
#if defined(GLES3_ENABLED)
GLManager_X11 *gl_manager = nullptr;
@@ -137,7 +137,7 @@ class DisplayServerX11 : public DisplayServer {
Callable drop_files_callback;
WindowID transient_parent = INVALID_WINDOW_ID;
- Set<WindowID> transient_children;
+ HashSet<WindowID> transient_children;
ObjectID instance_id;
@@ -159,7 +159,7 @@ class DisplayServerX11 : public DisplayServer {
unsigned int focus_order = 0;
};
- Map<WindowID, WindowData> windows;
+ HashMap<WindowID, WindowData> windows;
unsigned int last_mouse_monitor_mask = 0;
Vector2i last_mouse_monitor_pos;
@@ -174,21 +174,21 @@ class DisplayServerX11 : public DisplayServer {
String internal_clipboard;
String internal_clipboard_primary;
- Window xdnd_source_window;
+ Window xdnd_source_window = 0;
::Display *x11_display;
char *xmbstring = nullptr;
- int xmblen;
- unsigned long last_timestamp;
- ::Time last_keyrelease_time;
+ int xmblen = 0;
+ unsigned long last_timestamp = 0;
+ ::Time last_keyrelease_time = 0;
::XIM xim;
::XIMStyle xim_style;
static void _xim_destroy_callback(::XIM im, ::XPointer client_data,
::XPointer call_data);
Point2i last_mouse_pos;
- bool last_mouse_pos_valid;
- Point2i last_click_pos;
- uint64_t last_click_ms;
+ bool last_mouse_pos_valid = false;
+ Point2i last_click_pos = Point2i(-100, -100);
+ uint64_t last_click_ms = 0;
MouseButton last_click_button_index = MouseButton::NONE;
MouseButton last_button_state = MouseButton::NONE;
bool app_focused = false;
@@ -197,14 +197,16 @@ class DisplayServerX11 : public DisplayServer {
struct {
int opcode;
Vector<int> touch_devices;
- Map<int, Vector2> absolute_devices;
- Map<int, Vector2> pen_pressure_range;
- Map<int, Vector2> pen_tilt_x_range;
- Map<int, Vector2> pen_tilt_y_range;
+ HashMap<int, Vector2> absolute_devices;
+ HashMap<int, Vector2> pen_pressure_range;
+ HashMap<int, Vector2> pen_tilt_x_range;
+ HashMap<int, Vector2> pen_tilt_y_range;
+ HashMap<int, bool> pen_inverted_devices;
XIEventMask all_event_mask;
- Map<int, Vector2> state;
+ HashMap<int, Vector2> state;
double pressure;
bool pressure_supported;
+ bool pen_inverted;
Vector2 tilt;
Vector2 mouse_pos_to_filter;
Vector2 relative_motion;
@@ -221,7 +223,7 @@ class DisplayServerX11 : public DisplayServer {
void _get_key_modifier_state(unsigned int p_x11_state, Ref<InputEventWithModifiers> state);
void _flush_mouse_motion();
- MouseMode mouse_mode;
+ MouseMode mouse_mode = MOUSE_MODE_VISIBLE;
Point2i center;
void _handle_key_event(WindowID p_window, XKeyEvent *p_event, LocalVector<XEvent> &p_events, uint32_t &p_event_index, bool p_echo = false);
@@ -233,30 +235,26 @@ class DisplayServerX11 : public DisplayServer {
String _clipboard_get(Atom p_source, Window x11_window) const;
void _clipboard_transfer_ownership(Atom p_source, Window x11_window) const;
- //bool minimized;
- //bool window_has_focus;
- bool do_mouse_warp;
+ bool do_mouse_warp = false;
- const char *cursor_theme;
- int cursor_size;
+ const char *cursor_theme = nullptr;
+ int cursor_size = 0;
XcursorImage *img[CURSOR_MAX];
Cursor cursors[CURSOR_MAX];
Cursor null_cursor;
- CursorShape current_cursor;
- Map<CursorShape, Vector<Variant>> cursors_cache;
+ CursorShape current_cursor = CURSOR_ARROW;
+ HashMap<CursorShape, Vector<Variant>> cursors_cache;
- bool layered_window;
+ bool layered_window = false;
String rendering_driver;
- //bool window_focused;
- //void set_wm_border(bool p_enabled);
void set_wm_fullscreen(bool p_enabled);
void set_wm_above(bool p_enabled);
typedef xrr_monitor_info *(*xrr_get_monitors_t)(Display *dpy, Window window, Bool get_active, int *nmonitors);
typedef void (*xrr_free_monitors_t)(xrr_monitor_info *monitors);
- xrr_get_monitors_t xrr_get_monitors;
- xrr_free_monitors_t xrr_free_monitors;
+ xrr_get_monitors_t xrr_get_monitors = nullptr;
+ xrr_free_monitors_t xrr_free_monitors = nullptr;
void *xrandr_handle = nullptr;
Bool xrandr_ext_ok;
@@ -269,6 +267,7 @@ class DisplayServerX11 : public DisplayServer {
void _update_real_mouse_position(const WindowData &wd);
bool _window_maximize_check(WindowID p_window, const char *p_atom_name) const;
+ bool _window_fullscreen_check(WindowID p_window) const;
void _update_size_hints(WindowID p_window);
void _set_wm_fullscreen(WindowID p_window, bool p_enabled);
void _set_wm_maximized(WindowID p_window, bool p_enabled);
@@ -299,7 +298,7 @@ protected:
void _window_changed(XEvent *event);
public:
- void mouse_process_popups();
+ bool mouse_process_popups();
void popup_open(WindowID p_window);
void popup_close(WindowID p_window);
@@ -411,7 +410,7 @@ public:
virtual void cursor_set_shape(CursorShape p_shape) override;
virtual CursorShape cursor_get_shape() const override;
- virtual void cursor_set_custom_image(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) override;
+ virtual void cursor_set_custom_image(const Ref<Resource> &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) override;
virtual int keyboard_get_layout_count() const override;
virtual int keyboard_get_current_layout() const override;