Blender V5.0
GHOST_SystemWayland.cc File Reference
#include "GHOST_SystemWayland.hh"
#include "GHOST_Context.hh"
#include "GHOST_Event.hh"
#include "GHOST_EventButton.hh"
#include "GHOST_EventCursor.hh"
#include "GHOST_EventDragnDrop.hh"
#include "GHOST_EventKey.hh"
#include "GHOST_EventTrackpad.hh"
#include "GHOST_EventWheel.hh"
#include "GHOST_PathUtils.hh"
#include "GHOST_TimerManager.hh"
#include "GHOST_WaylandUtils.hh"
#include "GHOST_WindowManager.hh"
#include "GHOST_utildefines.hh"
#include <algorithm>
#include <atomic>
#include <optional>
#include <thread>
#include <unordered_set>
#include <wayland-cursor.h>
#include <xkbcommon/xkbcommon-compose.h>
#include <xkbcommon/xkbcommon.h>
#include <cursor-shape-v1-client-protocol.h>
#include <fractional-scale-v1-client-protocol.h>
#include <pointer-constraints-unstable-v1-client-protocol.h>
#include <pointer-gestures-unstable-v1-client-protocol.h>
#include <primary-selection-unstable-v1-client-protocol.h>
#include <relative-pointer-unstable-v1-client-protocol.h>
#include <tablet-v2-client-protocol.h>
#include <viewporter-client-protocol.h>
#include <xdg-activation-v1-client-protocol.h>
#include <xdg-output-unstable-v1-client-protocol.h>
#include <xdg-decoration-unstable-v1-client-protocol.h>
#include <xdg-shell-client-protocol.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <cstdlib>
#include <cstring>
#include <mutex>
#include <pthread.h>
#include "CLG_log.h"
#include "GHOST_TimerTask.hh"
#include "IMB_imbuf.hh"
#include "IMB_imbuf_types.hh"

Go to the source code of this file.

Classes

struct  GWL_ModifierInfo
struct  GWL_SimpleBuffer
struct  GWL_CursorShape
struct  GWL_Cursor
struct  GWL_TabletTool
struct  GWL_DataOffer
struct  GWL_DataSource
struct  GWL_KeyRepeatPlayload
struct  GWL_SeatStateGrab
struct  GWL_SeatStatePointer
struct  GWL_SeatStatePointer_Events
struct  GWL_SeatStatePointerScroll_SmoothAsDiscrete
struct  GWL_SeatStatePointerScroll
struct  GWL_ScaledFixedT
struct  GWL_SeatStatePointerGesture_Pinch
struct  GWL_SeatStateKeyboard
struct  GWL_KeyboardDepressedState
struct  GWL_XDG_Decor_System
struct  GWL_PrimarySelection_DataOffer
struct  GWL_PrimarySelection_DataSource
struct  GWL_PrimarySelection
struct  GWL_Seat
struct  GWL_DisplayTimeStamp
struct  GWL_Display
struct  GWL_RegisteryAdd_Params
struct  GWL_RegisteryUpdate_Params
struct  GWL_RegistryHandler
struct  GWL_RegistryEntry

Macros

#define GWL_TabletTool_FrameTypes_NUM   (int(GWL_TabletTool_EventTypes::Stylus3_Up) + 1)
#define GWL_SeatStatePointer_EventTypes_NUM   (int(GWL_Pointer_EventTypes::Button6_Up) + 1)
#define GXMAP(k, x, y)
#define SURFACE_CLEAR_PTR(surface_test)
Local Defines

Control local functionality, compositors specific workarounds.

#define _VERBOSE_OLD_IFACE_PRINT(params_version, version_max)
#define GWL_IFACE_VERSION_CLAMP(params_version, version_min, version_max)
#define USE_NON_LATIN_KB_WORKAROUND
#define WL_NAME_UNSET   uint32_t(-1)
#define WL_FIXED_TO_INT_FOR_WINDOW_V2(win, xy)
Internal #GWL_Cursor Type
#define EVDEV_OFFSET   8

Typedefs

Internal #GWL_RegistryHandler
using GWL_RegistryHandler_AddFn
using GWL_RegistryHandler_UpdateFn
using GWL_RegistryEntry_RemoveFn = void (*)(GWL_Display *display, void *user_data, bool on_exit)

Functions

Internal #GWL_SimpleBuffer Type
static void gwl_simple_buffer_free_data (GWL_SimpleBuffer *buffer)
static void gwl_simple_buffer_set_from_string (GWL_SimpleBuffer *buffer, const char *str)
Internal #GWL_Display Type (#wl_display & #wl_compositor wrapper)
static void gwl_display_destroy (GWL_Display *display)
static int gwl_display_seat_index (GWL_Display *display, const GWL_Seat *seat)
static GWL_Seatgwl_display_seat_active_get (const GWL_Display *display)
static bool gwl_display_seat_active_set (GWL_Display *display, const GWL_Seat *seat)
Internal #GWL_RegistryEntry
static void gwl_registry_entry_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params, void *user_data)
static bool gwl_registry_entry_remove_by_interface_slot (GWL_Display *display, const int interface_slot, const bool on_exit)
static void gwl_registry_entry_update_all (GWL_Display *display, const int interface_slot_exclude)
Event Thread
static void * gwl_display_event_thread_fn (void *display_voidp)
static void gwl_display_event_thread_create (GWL_Display *display)
Public WAYLAND Query Access
GWL_Outputghost_wl_output_user_data (wl_output *wl_output)
GHOST_WindowWaylandghost_wl_surface_user_data (wl_surface *wl_surface)

Variables

static signed char has_wl_trackpad_physical_direction = -1
Public WAYLAND Direct Data Access

Expose some members via methods.

static const char * ghost_wl_app_id

Forward Declarations

#define pushEvent   DONT_USE
constexpr size_t events_pending_default_size = 4096 / sizeof(void *)
static void keyboard_handle_key_repeat_cancel (GWL_Seat *seat)
static void output_handle_done (void *data, wl_output *wl_output)
static void gwl_seat_capability_pointer_disable (GWL_Seat *seat)
static void gwl_seat_capability_keyboard_disable (GWL_Seat *seat)
static void gwl_seat_capability_touch_disable (GWL_Seat *seat)
static bool gwl_registry_entry_remove_by_name (GWL_Display *display, uint32_t name, int *r_interface_slot)
static void gwl_registry_entry_remove_all (GWL_Display *display)
static int gwl_registry_handler_interface_slot_max ()
static int gwl_registry_handler_interface_slot_from_string (const char *interface)
static const GWL_RegistryHandlergwl_registry_handler_from_interface_slot (int interface_slot)
static bool xkb_compose_state_feed_and_get_utf8 (xkb_compose_state *compose_state, xkb_state *state, const xkb_keycode_t key, char r_utf8_buf[sizeof(GHOST_TEventKeyData::utf8_buf)])
static void gwl_display_event_thread_destroy (GWL_Display *display)
static void ghost_wl_display_lock_without_input (wl_display *wl_display, std::mutex *server_mutex)

Workaround Compositor Specific Bugs

#define USE_GNOME_CONFINE_HACK
#define USE_KDE_TABLET_HIDDEN_CURSOR_HACK
static bool use_gnome_confine_hack = false

Inline Event Codes

Selected input event code defines from linux/input-event-codes.h We include some of the button input event codes here, since the header is only available in more recent kernel versions.

#define BTN_RANGE_MIN   BTN_LEFT
#define BTN_RANGE_MAX   BTN_BACK
#define XKB_VMOD_NAME_HYPER   "Hyper"
enum  {
  BTN_LEFT = 0x110 , BTN_RIGHT = 0x111 , BTN_MIDDLE = 0x112 , BTN_SIDE = 0x113 ,
  BTN_EXTRA = 0x114 , BTN_FORWARD = 0x115 , BTN_BACK = 0x116
}
enum  { BTN_STYLUS = 0x14b , BTN_STYLUS2 = 0x14c , BTN_STYLUS3 = 0x149 }
enum  {
  KEY_GRAVE = 41 , KEY_102ND = 86 , KEY_1 = 2 , KEY_2 = 3 ,
  KEY_3 = 4 , KEY_4 = 5 , KEY_5 = 6 , KEY_6 = 7 ,
  KEY_7 = 8 , KEY_8 = 9 , KEY_9 = 10 , KEY_0 = 11
}

Modifier Table

Convenient access to modifier key values, allow looping over modifier keys.

#define MOD_INDEX_NUM   (MOD_INDEX_HYPER + 1)
enum  {
  MOD_INDEX_SHIFT = 0 , MOD_INDEX_ALT = 1 , MOD_INDEX_CTRL = 2 , MOD_INDEX_OS = 3 ,
  MOD_INDEX_HYPER = 4
}
static const GWL_ModifierInfo g_modifier_info_table [MOD_INDEX_NUM]

Listener (Registry), #wl_registry_listener

#define LOG   (&LOG_WL_KEYBOARD_DEPRESSED_STATE)
#define LOG   (&LOG_WL_RELATIVE_POINTER)
#define LOG   (&LOG_WL_DATA_SOURCE)
#define LOG   (&LOG_WL_DATA_OFFER)
#define LOG   (&LOG_WL_DATA_DEVICE)
#define LOG   (&LOG_WL_CURSOR_BUFFER)
#define LOG   (&LOG_WL_CURSOR_SURFACE)
#define LOG   (&LOG_WL_POINTER)
#define LOG   (&LOG_WL_TOUCH)
#define LOG   (&LOG_WL_TABLET_TOOL)
#define LOG   (&LOG_WL_TABLET_SEAT)
#define LOG   (&LOG_WL_KEYBOARD)
#define LOG   (&LOG_WL_PRIMARY_SELECTION_OFFER)
#define LOG   (&LOG_WL_PRIMARY_SELECTION_DEVICE)
#define LOG   (&LOG_WL_PRIMARY_SELECTION_SOURCE)
#define LOG   (&LOG_WL_SEAT)
#define LOG   (&LOG_WL_XDG_OUTPUT)
#define LOG   (&LOG_WL_OUTPUT)
#define LOG   (&LOG_WL_XDG_WM_BASE)
#define LOG   (&LOG_WL_REGISTRY)
static CLG_LogRef LOG_WL_REGISTRY = {"ghost.wl.handle.registry"}
static const GWL_RegistryHandler gwl_registry_handlers []
static const wl_registry_listener registry_listener
static void gwl_registry_compositor_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_compositor_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_xdg_wm_base_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_xdg_wm_base_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_xdg_decoration_manager_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_xdg_decoration_manager_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_xdg_output_manager_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_xdg_output_manager_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_wl_output_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wl_output_update (GWL_Display *display, const GWL_RegisteryUpdate_Params &params)
static void gwl_registry_wl_output_remove (GWL_Display *display, void *user_data, const bool on_exit)
static void gwl_registry_wl_seat_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wl_seat_update (GWL_Display *display, const GWL_RegisteryUpdate_Params &params)
static void gwl_registry_wl_seat_remove (GWL_Display *display, void *user_data, const bool on_exit)
static void gwl_registry_wl_shm_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wl_shm_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_wl_data_device_manager_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wl_data_device_manager_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_wp_tablet_manager_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wp_tablet_manager_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_wp_relative_pointer_manager_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wp_relative_pointer_manager_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_wp_pointer_constraints_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wp_pointer_constraints_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_wp_pointer_gestures_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wp_pointer_gestures_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_xdg_activation_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_xdg_activation_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_wp_fractional_scale_manager_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wp_fractional_scale_manager_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_wp_viewporter_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wp_viewporter_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_wp_primary_selection_device_manager_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wp_primary_selection_device_manager_remove (GWL_Display *display, void *, const bool)
static void gwl_registry_wp_cursor_shape_manager_add (GWL_Display *display, const GWL_RegisteryAdd_Params &params)
static void gwl_registry_wp_cursor_shape_manager_remove (GWL_Display *display, void *, const bool)
static void global_handle_add (void *data, wl_registry *wl_registry, const uint32_t name, const char *interface, const uint32_t version)
static void global_handle_remove (void *data, wl_registry *wl_registry, const uint32_t name)

Internal #GWL_TabletTool Type

enum class  GWL_TabletTool_EventTypes {
  Motion = 0 , Pressure , Tilt , Wheel ,
  Stylus0_Down , Stylus0_Up , Stylus1_Down , Stylus1_Up ,
  Stylus2_Down , Stylus2_Up , Stylus3_Down , Stylus3_Up
}
static const GHOST_TButton gwl_tablet_tool_ebutton []
static void gwl_tablet_tool_frame_event_add (GWL_TabletTool *tablet_tool, const GWL_TabletTool_EventTypes ty)
static void gwl_tablet_tool_frame_event_reset (GWL_TabletTool *tablet_tool)

Internal #GWL_Seat Type (#wl_seat wrapper & associated types)

enum class  GWL_Pointer_EventTypes {
  Motion = 0 , Scroll , Button0_Down , Button0_Up ,
  Button1_Down , Button1_Up , Button2_Down , Button2_Up ,
  Button3_Down , Button3_Up , Button4_Down , Button4_Up ,
  Button5_Down , Button5_Up , Button6_Down , Button6_Up
}
static const GHOST_TButton gwl_pointer_events_ebutton []
static constexpr int smooth_as_discrete_steps = 2400
static void gwl_pointer_handle_frame_event_add (GWL_SeatStatePointer_Events *pointer_events, const GWL_Pointer_EventTypes ty, const uint64_t event_ms)
static void gwl_pointer_handle_frame_event_reset (GWL_SeatStatePointer_Events *pointer_events)
static int gwl_scaled_fixed_t_add_and_calc_rounded_delta (GWL_ScaledFixedT *sf, const wl_fixed_t add)
static void gwl_xdg_decor_system_destroy (GWL_Display *display, GWL_XDG_Decor_System *decor)
static void gwl_primary_selection_discard_offer (GWL_PrimarySelection *primary)
static void gwl_primary_selection_discard_source (GWL_PrimarySelection *primary)
static GWL_SeatStatePointergwl_seat_state_pointer_active (GWL_Seat *seat)
static GWL_SeatStatePointergwl_seat_state_pointer_from_cursor_surface (GWL_Seat *seat, const wl_surface *wl_surface)
static void gwl_seat_key_layout_active_state_update_mask (GWL_Seat *seat)
static void gwl_seat_key_repeat_timer_fn (GHOST_ITimerTask *task, uint64_t time_ms)
static void gwl_seat_key_repeat_timer_add (GWL_Seat *seat, GHOST_TimerProcPtr key_repeat_fn, GHOST_TUserDataPtr payload, const bool use_delay)
static void gwl_seat_key_repeat_timer_remove (GWL_Seat *seat)

Private Utility Functions

enum  { GWL_IOR_READ = 1 << 0 , GWL_IOR_WRITE = 1 << 1 , GWL_IOR_NO_RETRY = 1 << 2 }
static const int default_cursor_size = 24
static constexpr const char * ghost_wl_mime_text_plain = "text/plain"
static constexpr const char * ghost_wl_mime_text_utf8 = "text/plain;charset=utf-8"
static constexpr const char * ghost_wl_mime_text_uri_list = "text/uri-list"
static const char * ghost_wl_mime_preference_order []
static const GHOST_TDragnDropTypes ghost_wl_mime_preference_order_type []
static const char * ghost_wl_mime_send []
static uint32_t round_up_uint (const uint32_t x, const uint32_t multiple)
static uint32_t rgba_straight_to_premul (uint32_t rgba_uint)
static uint32_t rgba_straight_to_premul_inverted (uint32_t rgba_uint)
static uint64_t sub_abs_u64 (const uint64_t a, const uint64_t b)
static uint64_t ghost_wl_ms_from_utime_pair (uint32_t utime_hi, uint32_t utime_lo)
static const char * ghost_wl_locale_from_env_with_default ()
static void ghost_wl_display_report_error_from_code (wl_display *display, const int ecode)
static void ghost_wl_display_report_error (wl_display *display)
bool ghost_wl_display_report_error_if_set (wl_display *display)
static void ghost_wayland_log_handler (const char *msg, va_list arg)
static void ghost_wayland_log_handler_background (const char *msg, va_list arg)
static GHOST_TKey xkb_map_gkey (const xkb_keysym_t sym)
static GHOST_TKey xkb_map_gkey_or_scan_code (const xkb_keysym_t sym, const uint32_t key)
static int pointer_axis_as_index (const uint32_t axis)
static GHOST_TTabletMode tablet_tool_map_type (enum zwp_tablet_tool_v2_type wp_tablet_tool_type)
static std::vector< std::string_view > gwl_clipboard_uri_ranges (const char *data_buf, size_t data_buf_len)
static void pthread_set_min_priority (pthread_t handle)
static int memfd_create_sealed (const char *name)
static int file_descriptor_is_io_ready (int fd, const int flags, const int timeout_ms)
static int ghost_wl_display_event_pump (wl_display *wl_display)
static int ghost_wl_display_event_pump_from_thread (wl_display *wl_display, const int fd, std::mutex *server_mutex)
static size_t ghost_wl_shm_format_as_size (enum wl_shm_format format)
static wl_buffer * ghost_wl_buffer_create_for_image (wl_shm *shm, const int32_t size_xy[2], enum wl_shm_format format, void **r_buffer_data, size_t *r_buffer_data_size)
static ssize_t read_exhaustive (const int fd, void *data, size_t nbytes)
static char * read_file_as_buffer (const int fd, const bool nil_terminate, size_t *r_len)

Private Cursor API

enum  eCursorSetMode { CURSOR_VISIBLE_ALWAYS_SET = 1 , CURSOR_VISIBLE_ONLY_HIDE , CURSOR_VISIBLE_ONLY_SHOW }
static void cursor_buffer_set_surface_impl (const wl_cursor_image *wl_image, wl_buffer *buffer, wl_surface *wl_surface, const int scale)
static std::optional< wp_cursor_shape_device_v1_shape > gwl_seat_cursor_find_wl_shape_from_ghost (const GHOST_TStandardCursor shape)
static int gwl_seat_cursor_buffer_scale_calc (const GWL_Seat *seat)
static void gwl_seat_cursor_buffer_show (GWL_Seat *seat)
static void gwl_seat_cursor_buffer_hide (GWL_Seat *seat)
static void gwl_seat_cursor_buffer_set (const GWL_Seat *seat, const wl_cursor_image *wl_image, wl_buffer *buffer)
static void gwl_seat_cursor_buffer_set_current (GWL_Seat *seat)
static void gwl_seat_cursor_visible_set (GWL_Seat *seat, const bool visible, const bool is_hardware, const enum eCursorSetMode set_mode)

Private Keyboard Depressed Key Tracking

Don't track physical key-codes because there may be multiple keyboards connected. Instead, count the number of #GHOST_kKey are pressed. This may seem susceptible to bugs with sticky-keys however XKB works this way internally.

static CLG_LogRef LOG_WL_KEYBOARD_DEPRESSED_STATE = {"ghost.wl.keyboard.depressed"}
static void keyboard_depressed_state_reset (GWL_Seat *seat)
static void keyboard_depressed_state_key_event (GWL_Seat *seat, const GHOST_TKey gkey, const GHOST_TEventType etype)
static void keyboard_depressed_state_push_events_from_change (GWL_Seat *seat, GHOST_IWindow *win, const uint64_t event_ms, const GWL_KeyboardDepressedState &key_depressed_prev)

Listener (Relative Motion), #zwp_relative_pointer_v1_listener

These callbacks are registered for Wayland interfaces and called when an event is received from the compositor.

static CLG_LogRef LOG_WL_RELATIVE_POINTER = {"ghost.wl.handle.relative_pointer"}
static const zwp_relative_pointer_v1_listener relative_pointer_listener
static void relative_pointer_handle_relative_motion_impl (GWL_Seat *seat, GHOST_WindowWayland *win, const wl_fixed_t xy[2], const uint64_t event_ms)
static void relative_pointer_handle_relative_motion (void *data, zwp_relative_pointer_v1 *, const uint32_t utime_hi, const uint32_t utime_lo, const wl_fixed_t dx, const wl_fixed_t dy, const wl_fixed_t, const wl_fixed_t)

Listener (Data Source), #wl_data_source_listener

static CLG_LogRef LOG_WL_DATA_SOURCE = {"ghost.wl.handle.data_source"}
static const wl_data_source_listener data_source_listener
static void dnd_events (const GWL_Seat *const seat, const GHOST_TEventType event, const uint64_t event_ms)
static char * read_buffer_from_data_offer (GWL_DataOffer *data_offer, const char *mime_receive, std::mutex *mutex, const bool nil_terminate, size_t *r_len)
static char * read_buffer_from_primary_selection_offer (GWL_PrimarySelection_DataOffer *data_offer, const char *mime_receive, std::mutex *mutex, const bool nil_terminate, size_t *r_len)
static void data_source_handle_target (void *, wl_data_source *, const char *)
static void data_source_handle_send (void *data, wl_data_source *, const char *, const int32_t fd)
static void data_source_handle_cancelled (void *data, wl_data_source *wl_data_source)
static void data_source_handle_dnd_drop_performed (void *, wl_data_source *)
static void data_source_handle_dnd_finished (void *, wl_data_source *)
static void data_source_handle_action (void *, wl_data_source *, const uint32_t dnd_action)

Listener (Data Offer), #wl_data_offer_listener

static CLG_LogRef LOG_WL_DATA_OFFER = {"ghost.wl.handle.data_offer"}
static const wl_data_offer_listener data_offer_listener
static void data_offer_handle_offer (void *data, wl_data_offer *, const char *mime_type)
static void data_offer_handle_source_actions (void *data, wl_data_offer *, const uint32_t source_actions)
static void data_offer_handle_action (void *data, wl_data_offer *, const uint32_t dnd_action)

Listener (Data Device), #wl_data_device_listener

static CLG_LogRef LOG_WL_DATA_DEVICE = {"ghost.wl.handle.data_device"}
static const wl_data_device_listener data_device_listener
static void data_device_handle_data_offer (void *, wl_data_device *, wl_data_offer *id)
static void data_device_handle_enter (void *data, wl_data_device *, const uint32_t serial, wl_surface *wl_surface, const wl_fixed_t x, const wl_fixed_t y, wl_data_offer *id)
static void data_device_handle_leave (void *data, wl_data_device *)
static void data_device_handle_motion (void *data, wl_data_device *, const uint32_t time, const wl_fixed_t x, const wl_fixed_t y)
static void data_device_handle_drop (void *data, wl_data_device *)
static void data_device_handle_selection (void *data, wl_data_device *, wl_data_offer *id)

Listener (Buffer), #wl_buffer_listener

static CLG_LogRef LOG_WL_CURSOR_BUFFER = {"ghost.wl.handle.cursor_buffer"}
static const wl_buffer_listener cursor_buffer_listener
static void cursor_buffer_handle_release (void *data, wl_buffer *wl_buffer)

Listener (Surface), #wl_surface_listener

static CLG_LogRef LOG_WL_CURSOR_SURFACE = {"ghost.wl.handle.cursor_surface"}
static const wl_surface_listener cursor_surface_listener
static bool update_cursor_scale (GWL_Seat *seat, GWL_Cursor &cursor, GWL_SeatStatePointer *seat_state_pointer)
static void cursor_surface_handle_enter (void *data, wl_surface *wl_surface, wl_output *wl_output)
static void cursor_surface_handle_leave (void *data, wl_surface *wl_surface, wl_output *wl_output)
static void cursor_surface_handle_preferred_buffer_scale (void *, wl_surface *, const int32_t factor)

Listener (Pointer), #wl_pointer_listener

static CLG_LogRef LOG_WL_POINTER = {"ghost.wl.handle.pointer"}
static const wl_pointer_listener pointer_listener
static void pointer_handle_enter (void *data, wl_pointer *, const uint32_t serial, wl_surface *wl_surface, const wl_fixed_t surface_x, const wl_fixed_t surface_y)
static void pointer_handle_leave (void *data, wl_pointer *, const uint32_t, wl_surface *wl_surface)
static void pointer_handle_motion (void *data, wl_pointer *, const uint32_t time, const wl_fixed_t surface_x, const wl_fixed_t surface_y)
static void pointer_handle_button (void *data, wl_pointer *, const uint32_t serial, const uint32_t time, const uint32_t button, const uint32_t state)
static void pointer_handle_axis (void *data, wl_pointer *, const uint32_t time, const uint32_t axis, const wl_fixed_t value)
static void pointer_handle_frame (void *data, wl_pointer *)
static void pointer_handle_axis_source (void *data, wl_pointer *, const uint32_t axis_source)
static void pointer_handle_axis_stop (void *data, wl_pointer *, const uint32_t time, const uint32_t axis)
static void pointer_handle_axis_discrete (void *data, wl_pointer *, const uint32_t axis, const int32_t discrete)
static void pointer_handle_axis_value120 (void *data, wl_pointer *, const uint32_t axis, const int32_t value120)

Listener (Touch Seat), #wl_touch_listener

NOTE(@ideasman42): It's not clear if this interface is used by popular compositors. It looks like GNOME/KDE only support zwp_pointer_gestures_v1_interface. If this isn't used anywhere, it could be removed.

NOTE(@felipe-choi): While X11 used to provide a virtual "touchscreen mouse" device, wayland provides dedicated touch events instead, so they go through this set of handler callbacks.

static CLG_LogRef LOG_WL_TOUCH = {"ghost.wl.handle.touch"}
static const wl_touch_listener touch_seat_listener
static void touch_seat_handle_down (void *data, wl_touch *, const uint32_t serial, const uint32_t time, wl_surface *surface, const int32_t id, const wl_fixed_t x, const wl_fixed_t y)
static void touch_seat_handle_up (void *data, wl_touch *, const uint32_t, const uint32_t time, const int32_t id)
static void touch_seat_handle_motion (void *data, wl_touch *, const uint32_t time, const int32_t id, const wl_fixed_t x, const wl_fixed_t y)
static void touch_seat_handle_frame (void *data, wl_touch *)
static void touch_seat_handle_cancel (void *, wl_touch *)
static void touch_seat_handle_shape (void *, wl_touch *, const int32_t, const wl_fixed_t, const wl_fixed_t)
static void touch_seat_handle_orientation (void *, wl_touch *, const int32_t, const wl_fixed_t)

Listener (Tablet Tool), #zwp_tablet_tool_v2_listener

static CLG_LogRef LOG_WL_TABLET_TOOL = {"ghost.wl.handle.tablet_tool"}
static const zwp_tablet_tool_v2_listener tablet_tool_listner
static void tablet_tool_handle_type (void *data, zwp_tablet_tool_v2 *, const uint32_t tool_type)
static void tablet_tool_handle_hardware_serial (void *, zwp_tablet_tool_v2 *, const uint32_t, const uint32_t)
static void tablet_tool_handle_hardware_id_wacom (void *, zwp_tablet_tool_v2 *, const uint32_t, const uint32_t)
static void tablet_tool_handle_capability (void *, zwp_tablet_tool_v2 *, const uint32_t capability)
static void tablet_tool_handle_done (void *, zwp_tablet_tool_v2 *)
static void tablet_tool_handle_removed (void *data, zwp_tablet_tool_v2 *zwp_tablet_tool_v2)
static void tablet_tool_handle_proximity_in (void *data, zwp_tablet_tool_v2 *, const uint32_t serial, zwp_tablet_v2 *, wl_surface *wl_surface)
static void tablet_tool_handle_proximity_out (void *data, zwp_tablet_tool_v2 *)
static void tablet_tool_handle_down (void *data, zwp_tablet_tool_v2 *, const uint32_t serial)
static void tablet_tool_handle_up (void *data, zwp_tablet_tool_v2 *)
static void tablet_tool_handle_motion (void *data, zwp_tablet_tool_v2 *, const wl_fixed_t x, const wl_fixed_t y)
static void tablet_tool_handle_pressure (void *data, zwp_tablet_tool_v2 *, const uint32_t pressure)
static void tablet_tool_handle_distance (void *, zwp_tablet_tool_v2 *, const uint32_t distance)
static void tablet_tool_handle_tilt (void *data, zwp_tablet_tool_v2 *, const wl_fixed_t tilt_x, const wl_fixed_t tilt_y)
static void tablet_tool_handle_rotation (void *, zwp_tablet_tool_v2 *, const wl_fixed_t degrees)
static void tablet_tool_handle_slider (void *, zwp_tablet_tool_v2 *, const int32_t position)
static void tablet_tool_handle_wheel (void *data, zwp_tablet_tool_v2 *, const wl_fixed_t, const int32_t clicks)
static void tablet_tool_handle_button (void *data, zwp_tablet_tool_v2 *, const uint32_t serial, const uint32_t button, const uint32_t state)
static void tablet_tool_handle_frame (void *data, zwp_tablet_tool_v2 *, const uint32_t time)

Listener (Table Seat), #zwp_tablet_seat_v2_listener

static CLG_LogRef LOG_WL_TABLET_SEAT = {"ghost.wl.handle.tablet_seat"}
static const zwp_tablet_seat_v2_listener tablet_seat_listener
static void tablet_seat_handle_tablet_added (void *, zwp_tablet_seat_v2 *, zwp_tablet_v2 *id)
static void tablet_seat_handle_tool_added (void *data, zwp_tablet_seat_v2 *, zwp_tablet_tool_v2 *id)
static void tablet_seat_handle_pad_added (void *, zwp_tablet_seat_v2 *, zwp_tablet_pad_v2 *id)

Listener (Keyboard), #wl_keyboard_listener

static CLG_LogRef LOG_WL_KEYBOARD = {"ghost.wl.handle.keyboard"}
static const wl_keyboard_listener keyboard_listener
static void keyboard_handle_keymap (void *data, wl_keyboard *, const uint32_t format, const int32_t fd, const uint32_t size)
static void keyboard_handle_enter (void *data, wl_keyboard *, const uint32_t serial, wl_surface *wl_surface, wl_array *keys)
static void keyboard_handle_leave (void *data, wl_keyboard *, const uint32_t, wl_surface *wl_surface)
static xkb_keysym_t xkb_state_key_get_one_sym_without_modifiers (xkb_state *xkb_state_empty, xkb_state *xkb_state_empty_with_numlock, xkb_state *xkb_state_empty_with_shift, const bool xkb_use_non_latin_workaround, const xkb_keycode_t key)
static void keyboard_handle_key_repeat_reset (GWL_Seat *seat, const bool use_delay)
static void keyboard_handle_key (void *data, wl_keyboard *, const uint32_t serial, const uint32_t time, const uint32_t key, const uint32_t state)
static void keyboard_handle_modifiers (void *data, wl_keyboard *, const uint32_t serial, const uint32_t mods_depressed, const uint32_t mods_latched, const uint32_t mods_locked, const uint32_t group)
static void keyboard_handle_repeat_info (void *data, wl_keyboard *, const int32_t rate, const int32_t delay)

Listener (Primary Selection Offer), #zwp_primary_selection_offer_v1_listener

static CLG_LogRef LOG_WL_PRIMARY_SELECTION_OFFER = {"ghost.wl.handle.primary_selection_offer"}
static const zwp_primary_selection_offer_v1_listener primary_selection_offer_listener
static void primary_selection_offer_offer (void *data, zwp_primary_selection_offer_v1 *id, const char *type)

Listener (Primary Selection Device), #zwp_primary_selection_device_v1_listener

static CLG_LogRef LOG_WL_PRIMARY_SELECTION_DEVICE = {"ghost.wl.handle.primary_selection_device"}
static const zwp_primary_selection_device_v1_listener primary_selection_device_listener
static void primary_selection_device_handle_data_offer (void *, zwp_primary_selection_device_v1 *, zwp_primary_selection_offer_v1 *id)
static void primary_selection_device_handle_selection (void *data, zwp_primary_selection_device_v1 *, zwp_primary_selection_offer_v1 *id)

Listener (Primary Selection Source), #zwp_primary_selection_source_v1_listener

static CLG_LogRef LOG_WL_PRIMARY_SELECTION_SOURCE = {"ghost.wl.handle.primary_selection_source"}
static const zwp_primary_selection_source_v1_listener primary_selection_source_listener
static void primary_selection_source_send (void *data, zwp_primary_selection_source_v1 *, const char *, const int32_t fd)
static void primary_selection_source_cancelled (void *data, zwp_primary_selection_source_v1 *source)

Listener (Seat), #wl_seat_listener

static CLG_LogRef LOG_WL_SEAT = {"ghost.wl.handle.seat"}
static const wl_seat_listener seat_listener
static bool gwl_seat_capability_pointer_multitouch_check (const GWL_Seat *seat, const bool fallback)
static void gwl_seat_capability_pointer_multitouch_enable (GWL_Seat *seat)
static void gwl_seat_capability_pointer_multitouch_disable (GWL_Seat *seat)
static void gwl_seat_capability_pointer_enable (GWL_Seat *seat)
static void gwl_seat_capability_keyboard_enable (GWL_Seat *seat)
static void gwl_seat_capability_touch_enable (GWL_Seat *seat)
static void seat_handle_capabilities (void *data, wl_seat *wl_seat, const uint32_t capabilities)
static void seat_handle_name (void *data, wl_seat *, const char *name)

Listener (XDG Output), #zxdg_output_v1_listener

static CLG_LogRef LOG_WL_XDG_OUTPUT = {"ghost.wl.handle.xdg_output"}
static const zxdg_output_v1_listener xdg_output_listener
static void xdg_output_handle_logical_position (void *data, zxdg_output_v1 *, const int32_t x, const int32_t y)
static void xdg_output_handle_logical_size (void *data, zxdg_output_v1 *, const int32_t width, const int32_t height)
static void xdg_output_handle_done (void *data, zxdg_output_v1 *)
static void xdg_output_handle_name (void *, zxdg_output_v1 *, const char *name)
static void xdg_output_handle_description (void *, zxdg_output_v1 *, const char *description)

Listener (Output), #wl_output_listener

static CLG_LogRef LOG_WL_OUTPUT = {"ghost.wl.handle.output"}
static const wl_output_listener output_listener
static void output_handle_geometry (void *data, wl_output *, const int32_t, const int32_t, const int32_t physical_width, const int32_t physical_height, const int32_t, const char *make, const char *model, const int32_t transform)
static void output_handle_mode (void *data, wl_output *, const uint32_t flags, const int32_t width, const int32_t height, const int32_t)
static void output_handle_scale (void *data, wl_output *, const int32_t factor)
static void output_handle_name (void *, wl_output *, const char *name)
static void output_handle_description (void *, wl_output *, const char *description)

Listener (XDG WM Base), #xdg_wm_base_listener

static CLG_LogRef LOG_WL_XDG_WM_BASE = {"ghost.wl.handle.xdg_wm_base"}
static const xdg_wm_base_listener shell_listener
static void shell_handle_ping (void *, xdg_wm_base *xdg_wm_base, const uint32_t serial)

GHOST Implementation

WAYLAND specific implementation of the GHOST_System interface.

static constexpr const char * ghost_wl_mime_img_png = "image/png"
static const char * system_clipboard_text_mime_type (const std::unordered_set< std::string > &data_offer_types)
static char * system_clipboard_get_primary_selection (GWL_Display *display, const bool nil_terminate, const char *mime_receive_override, size_t *r_data_len)
static char * system_clipboard_get (GWL_Display *display, const bool nil_terminate, const char *mime_receive_override, size_t *r_data_len)
static void system_clipboard_put_primary_selection (GWL_Display *display, const char *buffer)
static void system_clipboard_put (GWL_Display *display, const char *buffer)
static GHOST_TSuccess getCursorPositionClientRelative_impl (const GWL_SeatStatePointer *seat_state_pointer, const GHOST_WindowWayland *win, int32_t &x, int32_t &y)
static GHOST_TSuccess setCursorPositionClientRelative_impl (GWL_Seat *seat, GHOST_WindowWayland *win, const int32_t x, const int32_t y)
static bool cursor_is_software (const GHOST_TGrabCursorMode mode, const bool use_software_confine)
static wl_buffer * ghost_wl_buffer_from_cursor_generator (const GHOST_CursorGenerator &cg, wl_shm *shm, void **buffer_data_p, size_t *buffer_data_size_p, const int cursor_size, const int cursor_size_max, const int use_dark_theme, const int scale, int r_bitmap_size[2], int r_hot_spot[2])
static bool setCursorGrab_use_software_confine (const GHOST_TGrabCursorMode mode, wl_surface *wl_surface)
static GWL_SeatStateGrab seat_grab_state_from_mode (const GHOST_TGrabCursorMode mode, const bool use_software_confine)

Public WAYLAND Proxy Ownership API

static const char * ghost_wl_output_tag_id = "GHOST-output"
static const char * ghost_wl_surface_tag_id = "GHOST-window"
static const char * ghost_wl_surface_cursor_pointer_tag_id = "GHOST-cursor-pointer"
static const char * ghost_wl_surface_cursor_tablet_tag_id = "GHOST-cursor-tablet"
bool ghost_wl_output_own (const wl_output *wl_output)
bool ghost_wl_surface_own (const wl_surface *wl_surface)
bool ghost_wl_surface_own_with_null_check (const wl_surface *wl_surface)
bool ghost_wl_surface_own_cursor_pointer (const wl_surface *wl_surface)
bool ghost_wl_surface_own_cursor_tablet (const wl_surface *wl_surface)
void ghost_wl_output_tag (wl_output *wl_output)
void ghost_wl_surface_tag (wl_surface *wl_surface)
void ghost_wl_surface_tag_cursor_pointer (wl_surface *wl_surface)
void ghost_wl_surface_tag_cursor_tablet (wl_surface *wl_surface)

Macro Definition Documentation

◆ _VERBOSE_OLD_IFACE_PRINT

#define _VERBOSE_OLD_IFACE_PRINT ( params_version,
version_max )
Value:
((void)(params_version), (version_max))

A version clamping macro that optionally prints when the version is outdated. This is useful when investigating when newer versions of an interface might be supported.

This addresses the following:

  • Filling in callbacks which wont be called because they aren't part of the older interface.
  • Not taking advantage of newer interfaces which would be beneficial.
  • When interface versions need to be bumped to support new features, avoid large version bumps that could change behavior in unexpected ways due to versions changes between each version that wont have been accounted for.

This should only be enabled during development, never enabled for regular releases.

Definition at line 222 of file GHOST_SystemWayland.cc.

◆ BTN_RANGE_MAX

#define BTN_RANGE_MAX   BTN_BACK

Definition at line 271 of file GHOST_SystemWayland.cc.

Referenced by pointer_handle_button().

◆ BTN_RANGE_MIN

#define BTN_RANGE_MIN   BTN_LEFT

Definition at line 270 of file GHOST_SystemWayland.cc.

Referenced by pointer_handle_button().

◆ EVDEV_OFFSET

#define EVDEV_OFFSET   8

From XKB internals, use for converting a scan-code from WAYLAND to a #xkb_keycode_t. Ideally this wouldn't need a local define.

Definition at line 434 of file GHOST_SystemWayland.cc.

Referenced by keyboard_handle_enter(), keyboard_handle_key(), keyboard_handle_keymap(), and xkb_state_key_get_one_sym_without_modifiers().

◆ GWL_IFACE_VERSION_CLAMP

◆ GWL_SeatStatePointer_EventTypes_NUM

#define GWL_SeatStatePointer_EventTypes_NUM   (int(GWL_Pointer_EventTypes::Button6_Up) + 1)

Definition at line 762 of file GHOST_SystemWayland.cc.

◆ GWL_TabletTool_FrameTypes_NUM

#define GWL_TabletTool_FrameTypes_NUM   (int(GWL_TabletTool_EventTypes::Stylus3_Up) + 1)

Definition at line 521 of file GHOST_SystemWayland.cc.

◆ GXMAP

#define GXMAP ( k,
x,
y )
Value:

Referenced by xkb_map_gkey().

◆ LOG [1/20]

#define LOG   (&LOG_WL_REGISTRY)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [2/20]

#define LOG   (&LOG_WL_XDG_WM_BASE)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [3/20]

#define LOG   (&LOG_WL_OUTPUT)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [4/20]

#define LOG   (&LOG_WL_XDG_OUTPUT)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [5/20]

#define LOG   (&LOG_WL_SEAT)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [6/20]

#define LOG   (&LOG_WL_PRIMARY_SELECTION_SOURCE)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [7/20]

#define LOG   (&LOG_WL_PRIMARY_SELECTION_DEVICE)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [8/20]

#define LOG   (&LOG_WL_PRIMARY_SELECTION_OFFER)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [9/20]

#define LOG   (&LOG_WL_KEYBOARD)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [10/20]

#define LOG   (&LOG_WL_TABLET_SEAT)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [11/20]

#define LOG   (&LOG_WL_TABLET_TOOL)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [12/20]

#define LOG   (&LOG_WL_TOUCH)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [13/20]

#define LOG   (&LOG_WL_POINTER)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [14/20]

#define LOG   (&LOG_WL_CURSOR_SURFACE)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [15/20]

#define LOG   (&LOG_WL_CURSOR_BUFFER)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [16/20]

#define LOG   (&LOG_WL_DATA_DEVICE)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [17/20]

#define LOG   (&LOG_WL_DATA_OFFER)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [18/20]

#define LOG   (&LOG_WL_DATA_SOURCE)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [19/20]

#define LOG   (&LOG_WL_RELATIVE_POINTER)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ LOG [20/20]

#define LOG   (&LOG_WL_KEYBOARD_DEPRESSED_STATE)

Definition at line 3096 of file GHOST_SystemWayland.cc.

◆ MOD_INDEX_NUM

#define MOD_INDEX_NUM   (MOD_INDEX_HYPER + 1)

◆ pushEvent

◆ SURFACE_CLEAR_PTR

#define SURFACE_CLEAR_PTR ( surface_test)
Value:
if (surface_test == wl_surface) { \
surface_test = nullptr; \
changed = true; \
} \
((void)0);
#define wl_surface

Referenced by GHOST_SystemWayland::window_surface_unref().

◆ USE_GNOME_CONFINE_HACK

#define USE_GNOME_CONFINE_HACK

GNOME (mutter 42.2 had a bug with confine not respecting scale - Hi-DPI), See: #98793. Even though this has been fixed, at time of writing it's not yet in a release. Workaround the problem by implementing confine with a software cursor. While this isn't ideal, it's not adding a lot of overhead as software cursors are already used for warping (which WAYLAND doesn't support).

Definition at line 171 of file GHOST_SystemWayland.cc.

◆ USE_KDE_TABLET_HIDDEN_CURSOR_HACK

#define USE_KDE_TABLET_HIDDEN_CURSOR_HACK

KDE (plasma 5.26.1) has a bug where the cursor surface needs to be committed (via wl_surface_commit) when it was hidden and is being set to visible again, see: #102048. See: https://bugs.kde.org/show_bug.cgi?id=461001

Definition at line 187 of file GHOST_SystemWayland.cc.

◆ USE_NON_LATIN_KB_WORKAROUND

#define USE_NON_LATIN_KB_WORKAROUND

Fix short-cut part of keyboard reading code not properly handling some keys, see: #102194.

Note
This is similar to X11 workaround by the same name, see: #47228.

Definition at line 234 of file GHOST_SystemWayland.cc.

Referenced by keyboard_handle_key().

◆ WL_FIXED_TO_INT_FOR_WINDOW_V2

#define WL_FIXED_TO_INT_FOR_WINDOW_V2 ( win,
xy )
Value:
wl_fixed_to_int((win)->wl_fixed_to_window((xy)[0])), \
wl_fixed_to_int((win)->wl_fixed_to_window((xy)[1])),
int xy[2]
Definition wm_draw.cc:178

Initializer for GHOST integer coordinates from wl_fixed_t, taking window scale into account.

Definition at line 242 of file GHOST_SystemWayland.cc.

Referenced by data_device_handle_drop(), dnd_events(), pointer_handle_enter(), pointer_handle_frame(), relative_pointer_handle_relative_motion_impl(), tablet_tool_handle_frame(), and touch_seat_handle_frame().

◆ WL_NAME_UNSET

#define WL_NAME_UNSET   uint32_t(-1)

◆ XKB_VMOD_NAME_HYPER

#define XKB_VMOD_NAME_HYPER   "Hyper"

Definition at line 320 of file GHOST_SystemWayland.cc.

Typedef Documentation

◆ GWL_RegistryEntry_RemoveFn

using GWL_RegistryEntry_RemoveFn = void (*)(GWL_Display *display, void *user_data, bool on_exit)

Remove callback for object registry.

Parameters
displayThe display which holds a reference to the global object.
user_dataOptional reference to a sub element of display, use for outputs or seats, for example when the display may hold multiple references.
on_exitEnabled when freeing on exit. When true the consistency of references between objects should be kept valid. Otherwise it can be assumed that all objects will be freed and none will be used again, so there is no need to ensure a valid state.

Definition at line 1762 of file GHOST_SystemWayland.cc.

◆ GWL_RegistryHandler_AddFn

Initial value:
void (*)(GWL_Display *display,
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]

Add callback for object registry.

Note
Any operations that depend on other interfaces being registered must be performed in the GWL_RegistryHandler_UpdateFn callback as the order interfaces are added is out of our control.
Parameters
displayThe display which holds a reference to the global object.
paramsVarious arguments needed for registration.

Definition at line 1730 of file GHOST_SystemWayland.cc.

◆ GWL_RegistryHandler_UpdateFn

Initial value:

Optional update callback to refresh internal data when another interface has been added/removed.

Parameters
displayThe display which holds a reference to the global object.
paramsVarious arguments needed for updating.

Definition at line 1749 of file GHOST_SystemWayland.cc.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GWL_IOR_READ 
GWL_IOR_WRITE 
GWL_IOR_NO_RETRY 

Definition at line 2444 of file GHOST_SystemWayland.cc.

◆ anonymous enum

anonymous enum

Tablet events.

Note
Gnome/GTK swap middle/right, where the same application in X11 will swap the middle/right mouse button when running under WAYLAND. KDE doesn't do this, and according to artists at the Blender studio, having the button closest to the nib be MMB is preferable, so use this as a default. If needs be - swapping these could be a preference.
Enumerator
BTN_STYLUS 

Use as middle-mouse.

BTN_STYLUS2 

Use as right-mouse.

BTN_STYLUS3 

NOTE(@ideasman42): Map to an additional button (not sure which hardware uses this).

Definition at line 281 of file GHOST_SystemWayland.cc.

◆ anonymous enum

anonymous enum

The event codes are used to differentiate from which mouse button an event comes from.

Enumerator
BTN_LEFT 
BTN_RIGHT 
BTN_MIDDLE 
BTN_SIDE 
BTN_EXTRA 
BTN_FORWARD 
BTN_BACK 

Definition at line 259 of file GHOST_SystemWayland.cc.

◆ anonymous enum

anonymous enum

Keyboard scan-codes.

From linux/input-event-codes.h.

Enumerator
KEY_GRAVE 
KEY_102ND 

Sometimes called OEM 102, used for German GrLess key. For the common case this key will be mapped using #XKB_KEY_less. Use a scan-code to prevent the key being unknown.

KEY_1 
KEY_2 
KEY_3 
KEY_4 
KEY_5 
KEY_6 
KEY_7 
KEY_8 
KEY_9 
KEY_0 

Definition at line 295 of file GHOST_SystemWayland.cc.

◆ anonymous enum

anonymous enum
Enumerator
MOD_INDEX_SHIFT 
MOD_INDEX_ALT 
MOD_INDEX_CTRL 
MOD_INDEX_OS 
MOD_INDEX_HYPER 

Definition at line 331 of file GHOST_SystemWayland.cc.

◆ eCursorSetMode

Enumerator
CURSOR_VISIBLE_ALWAYS_SET 
CURSOR_VISIBLE_ONLY_HIDE 
CURSOR_VISIBLE_ONLY_SHOW 

Definition at line 3042 of file GHOST_SystemWayland.cc.

◆ GWL_Pointer_EventTypes

enum class GWL_Pointer_EventTypes
strong
Enumerator
Motion 
Scroll 

Wheel & smooth scroll.

Note
The logic for scrolling is quite involved. This event is more of a catch-all that scrolling needs to be computed.
Button0_Down 
Button0_Up 
Button1_Down 
Button1_Up 
Button2_Down 
Button2_Up 
Button3_Down 
Button3_Up 
Button4_Down 
Button4_Up 
Button5_Down 
Button5_Up 
Button6_Down 
Button6_Up 

Definition at line 727 of file GHOST_SystemWayland.cc.

◆ GWL_TabletTool_EventTypes

enum class GWL_TabletTool_EventTypes
strong

Collect tablet event data before the frame callback runs.

Enumerator
Motion 
Pressure 
Tilt 
Wheel 
Stylus0_Down 
Stylus0_Up 
Stylus1_Down 
Stylus1_Up 
Stylus2_Down 
Stylus2_Up 
Stylus3_Down 
Stylus3_Up 

Definition at line 499 of file GHOST_SystemWayland.cc.

Function Documentation

◆ cursor_buffer_handle_release()

void cursor_buffer_handle_release ( void * data,
wl_buffer * wl_buffer )
static

Definition at line 3758 of file GHOST_SystemWayland.cc.

References GWL_Cursor::buffer, CLOG_DEBUG, data, LOG, and GWL_Cursor::wl.

◆ cursor_buffer_set_surface_impl()

void cursor_buffer_set_surface_impl ( const wl_cursor_image * wl_image,
wl_buffer * buffer,
wl_surface * wl_surface,
const int scale )
static

Definition at line 2762 of file GHOST_SystemWayland.cc.

References GHOST_ASSERT, and wl_surface.

Referenced by gwl_seat_cursor_buffer_set().

◆ cursor_is_software()

bool cursor_is_software ( const GHOST_TGrabCursorMode mode,
const bool use_software_confine )
static

◆ cursor_surface_handle_enter()

void cursor_surface_handle_enter ( void * data,
wl_surface * wl_surface,
wl_output * wl_output )
static

◆ cursor_surface_handle_leave()

void cursor_surface_handle_leave ( void * data,
wl_surface * wl_surface,
wl_output * wl_output )
static

◆ cursor_surface_handle_preferred_buffer_scale()

void cursor_surface_handle_preferred_buffer_scale ( void * ,
wl_surface * ,
const int32_t factor )
static

Definition at line 3851 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, LOG, and wl_surface.

◆ data_device_handle_data_offer()

void data_device_handle_data_offer ( void * ,
wl_data_device * ,
wl_data_offer * id )
static

◆ data_device_handle_drop()

◆ data_device_handle_enter()

◆ data_device_handle_leave()

◆ data_device_handle_motion()

void data_device_handle_motion ( void * data,
wl_data_device * ,
const uint32_t time,
const wl_fixed_t x,
const wl_fixed_t y )
static

◆ data_device_handle_selection()

void data_device_handle_selection ( void * data,
wl_data_device * ,
wl_data_offer * id )
static

◆ data_offer_handle_action()

void data_offer_handle_action ( void * data,
wl_data_offer * ,
const uint32_t dnd_action )
static

Definition at line 3456 of file GHOST_SystemWayland.cc.

References GWL_DataOffer::action, CLOG_DEBUG, data, GWL_DataOffer::dnd, and LOG.

◆ data_offer_handle_offer()

void data_offer_handle_offer ( void * data,
wl_data_offer * ,
const char * mime_type )
static

Definition at line 3436 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, data, LOG, and GWL_DataOffer::types.

◆ data_offer_handle_source_actions()

void data_offer_handle_source_actions ( void * data,
wl_data_offer * ,
const uint32_t source_actions )
static

◆ data_source_handle_action()

void data_source_handle_action ( void * ,
wl_data_source * ,
const uint32_t dnd_action )
static

Notify the selected action.

This event indicates the action selected by the compositor after matching the source/destination side actions. Only one action (or none) will be offered here.

Definition at line 3409 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ data_source_handle_cancelled()

void data_source_handle_cancelled ( void * data,
wl_data_source * wl_data_source )
static

◆ data_source_handle_dnd_drop_performed()

void data_source_handle_dnd_drop_performed ( void * ,
wl_data_source *  )
static

The drag-and-drop operation physically finished.

The user performed the drop action. This event does not indicate acceptance, #wl_data_source.cancelled may still be emitted afterwards if the drop destination does not accept any mime type.

Definition at line 3384 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ data_source_handle_dnd_finished()

void data_source_handle_dnd_finished ( void * ,
wl_data_source *  )
static

The drag-and-drop operation concluded.

The drop destination finished interoperating with this data source, so the client is now free to destroy this data source and free all associated data.

Definition at line 3397 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ data_source_handle_send()

void data_source_handle_send ( void * data,
wl_data_source * ,
const char * ,
const int32_t fd )
static

◆ data_source_handle_target()

void data_source_handle_target ( void * ,
wl_data_source * ,
const char *  )
static

A target accepts an offered mime type.

Sent when a target accepts pointer_focus or motion events. If a target does not accept any of the offered types, type is nullptr.

Definition at line 3333 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ dnd_events()

◆ file_descriptor_is_io_ready()

int file_descriptor_is_io_ready ( int fd,
const int flags,
const int timeout_ms )
static

◆ getCursorPositionClientRelative_impl()

◆ ghost_wayland_log_handler()

void ghost_wayland_log_handler ( const char * msg,
va_list arg )
static

Callback for WAYLAND to run when there is an error.

Note
It's useful to set a break-point on this function as some errors are fatal (for all intents and purposes) but don't crash the process.

Definition at line 2113 of file GHOST_SystemWayland.cc.

References GHOST_ISystem::getBacktraceFn().

Referenced by GHOST_SystemWayland::GHOST_SystemWayland(), and ghost_wayland_log_handler_background().

◆ ghost_wayland_log_handler_background()

void ghost_wayland_log_handler_background ( const char * msg,
va_list arg )
static

A wrapper for ghost_wayland_log_handler to be used when running in the background.

Definition at line 2125 of file GHOST_SystemWayland.cc.

References ghost_wayland_log_handler().

Referenced by GHOST_SystemWayland::GHOST_SystemWayland().

◆ ghost_wl_buffer_create_for_image()

wl_buffer * ghost_wl_buffer_create_for_image ( wl_shm * shm,
const int32_t size_xy[2],
enum wl_shm_format format,
void ** r_buffer_data,
size_t * r_buffer_data_size )
static

Return a #wl_buffer, ready to have it's data filled in or nullptr in case of failure. The caller is responsible for calling unmap(buffer_data, buffer_size).

Parameters
r_buffer_dataThe buffer to be filled.
r_buffer_data_sizeThe size of r_buffer_data in bytes.

Definition at line 2614 of file GHOST_SystemWayland.cc.

References ghost_wl_shm_format_as_size(), memfd_create_sealed(), and UNPACK2.

Referenced by ghost_wl_buffer_from_cursor_generator().

◆ ghost_wl_buffer_from_cursor_generator()

wl_buffer * ghost_wl_buffer_from_cursor_generator ( const GHOST_CursorGenerator & cg,
wl_shm * shm,
void ** buffer_data_p,
size_t * buffer_data_size_p,
const int cursor_size,
const int cursor_size_max,
const int use_dark_theme,
const int scale,
int r_bitmap_size[2],
int r_hot_spot[2] )
static

◆ ghost_wl_display_event_pump()

◆ ghost_wl_display_event_pump_from_thread()

int ghost_wl_display_event_pump_from_thread ( wl_display * wl_display,
const int fd,
std::mutex * server_mutex )
static

◆ ghost_wl_display_lock_without_input()

void ghost_wl_display_lock_without_input ( wl_display * wl_display,
std::mutex * server_mutex )
static

◆ ghost_wl_display_report_error()

void ghost_wl_display_report_error ( wl_display * display)
static

◆ ghost_wl_display_report_error_from_code()

void ghost_wl_display_report_error_from_code ( wl_display * display,
const int ecode )
static

◆ ghost_wl_display_report_error_if_set()

bool ghost_wl_display_report_error_if_set ( wl_display * display)

◆ ghost_wl_locale_from_env_with_default()

const char * ghost_wl_locale_from_env_with_default ( )
static

Access the LOCALE (with a fallback).

Definition at line 2029 of file GHOST_SystemWayland.cc.

Referenced by gwl_registry_wl_seat_add().

◆ ghost_wl_ms_from_utime_pair()

uint64_t ghost_wl_ms_from_utime_pair ( uint32_t utime_hi,
uint32_t utime_lo )
static

Return milliseconds from a microsecond uint32 pair (used by some wayland functions).

Definition at line 2021 of file GHOST_SystemWayland.cc.

Referenced by relative_pointer_handle_relative_motion().

◆ ghost_wl_output_own()

bool ghost_wl_output_own ( const wl_output * wl_output)

◆ ghost_wl_output_tag()

void ghost_wl_output_tag ( wl_output * wl_output)

Definition at line 9273 of file GHOST_SystemWayland.cc.

References ghost_wl_output_tag_id, and wl_proxy_set_tag.

Referenced by gwl_registry_wl_output_add().

◆ ghost_wl_output_user_data()

◆ ghost_wl_shm_format_as_size()

size_t ghost_wl_shm_format_as_size ( enum wl_shm_format format)
static

Definition at line 2593 of file GHOST_SystemWayland.cc.

References GHOST_ASSERT.

Referenced by ghost_wl_buffer_create_for_image().

◆ ghost_wl_surface_own()

bool ghost_wl_surface_own ( const wl_surface * wl_surface)

◆ ghost_wl_surface_own_cursor_pointer()

bool ghost_wl_surface_own_cursor_pointer ( const wl_surface * wl_surface)

◆ ghost_wl_surface_own_cursor_tablet()

bool ghost_wl_surface_own_cursor_tablet ( const wl_surface * wl_surface)

◆ ghost_wl_surface_own_with_null_check()

◆ ghost_wl_surface_tag()

void ghost_wl_surface_tag ( wl_surface * wl_surface)

◆ ghost_wl_surface_tag_cursor_pointer()

void ghost_wl_surface_tag_cursor_pointer ( wl_surface * wl_surface)

◆ ghost_wl_surface_tag_cursor_tablet()

void ghost_wl_surface_tag_cursor_tablet ( wl_surface * wl_surface)

◆ ghost_wl_surface_user_data()

◆ global_handle_add()

void global_handle_add ( void * data,
wl_registry * wl_registry,
const uint32_t name,
const char * interface,
const uint32_t version )
static

◆ global_handle_remove()

void global_handle_remove ( void * data,
wl_registry * wl_registry,
const uint32_t name )
static

Announce removal of global object.

Notify the client of removed global objects.

This event notifies the client that the global identified by name is no longer available. If the client bound to the global using the bind request, the client should now destroy that object.

Definition at line 7514 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, data, GHOST_ASSERT, gwl_registry_entry_remove_by_name(), gwl_registry_entry_update_all(), gwl_registry_handlers, LOG, name, GWL_Display::registry, GWL_Display::registry_skip_update_all, and GWL_Display::wl.

◆ gwl_clipboard_uri_ranges()

std::vector< std::string_view > gwl_clipboard_uri_ranges ( const char * data_buf,
size_t data_buf_len )
static

Return a list of URI ranges (without the file:// prefix), the result should be decoded via GHOST_URL_decode_alloc before passed to the file-system.

Definition at line 2369 of file GHOST_SystemWayland.cc.

References data, pos, and UNLIKELY.

Referenced by data_device_handle_drop(), GHOST_SystemWayland::getClipboardImage(), and GHOST_SystemWayland::hasClipboardImage().

◆ gwl_display_destroy()

◆ gwl_display_event_thread_create()

◆ gwl_display_event_thread_destroy()

void gwl_display_event_thread_destroy ( GWL_Display * display)
static

◆ gwl_display_event_thread_fn()

◆ gwl_display_seat_active_get()

◆ gwl_display_seat_active_set()

bool gwl_display_seat_active_set ( GWL_Display * display,
const GWL_Seat * seat )
static

◆ gwl_display_seat_index()

int gwl_display_seat_index ( GWL_Display * display,
const GWL_Seat * seat )
static

Definition at line 1671 of file GHOST_SystemWayland.cc.

References GHOST_ASSERT, and GWL_Display::seats.

Referenced by gwl_display_seat_active_set().

◆ gwl_pointer_handle_frame_event_add()

◆ gwl_pointer_handle_frame_event_reset()

void gwl_pointer_handle_frame_event_reset ( GWL_SeatStatePointer_Events * pointer_events)
static

◆ gwl_primary_selection_discard_offer()

◆ gwl_primary_selection_discard_source()

◆ gwl_registry_compositor_add()

void gwl_registry_compositor_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_compositor_remove()

void gwl_registry_compositor_remove ( GWL_Display * display,
void * ,
const bool  )
static

Definition at line 6703 of file GHOST_SystemWayland.cc.

References GWL_Display::compositor, and GWL_Display::wl.

◆ gwl_registry_entry_add()

◆ gwl_registry_entry_remove_all()

void gwl_registry_entry_remove_all ( GWL_Display * display)
static

◆ gwl_registry_entry_remove_by_interface_slot()

bool gwl_registry_entry_remove_by_interface_slot ( GWL_Display * display,
const int interface_slot,
const bool on_exit )
static

◆ gwl_registry_entry_remove_by_name()

◆ gwl_registry_entry_update_all()

void gwl_registry_entry_update_all ( GWL_Display * display,
const int interface_slot_exclude )
static

Run GWL_RegistryHandler.update_fn an all registered interface instances. This is needed to refresh the state of interfaces that may reference other interfaces. Called when interfaces are added/removed.

Parameters
interface_slot_excludeSkip updating slots of this type. Note that while harmless dependencies only exist between different types, so there is no reason to update all other outputs that an output was removed (for example). Pass as -1 to update all slots.

NOTE(@ideasman42): Updating all other items on a single change is typically worth avoiding. In practice this isn't a problem as so there are so few elements in display->registry_entry, so few use update functions and adding/removal at runtime is rarely called (plugging/unplugging) hardware for example So while it's possible to store dependency links to avoid unnecessary looping over data - it ends up being a non issue.

Definition at line 1925 of file GHOST_SystemWayland.cc.

References GHOST_ASSERT, gwl_registry_handler_from_interface_slot(), gwl_registry_handler_interface_slot_max(), GWL_RegistryEntry::next, params, GWL_Display::registry_entry, and GWL_RegistryHandler::update_fn.

Referenced by GHOST_SystemWayland::GHOST_SystemWayland(), global_handle_add(), and global_handle_remove().

◆ gwl_registry_handler_from_interface_slot()

const GWL_RegistryHandler * gwl_registry_handler_from_interface_slot ( int interface_slot)
static

◆ gwl_registry_handler_interface_slot_from_string()

int gwl_registry_handler_interface_slot_from_string ( const char * interface)
static

Definition at line 7442 of file GHOST_SystemWayland.cc.

References gwl_registry_handlers, interface, and STREQ.

Referenced by global_handle_add().

◆ gwl_registry_handler_interface_slot_max()

int gwl_registry_handler_interface_slot_max ( )
static

◆ gwl_registry_wl_data_device_manager_add()

void gwl_registry_wl_data_device_manager_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_wl_data_device_manager_remove()

void gwl_registry_wl_data_device_manager_remove ( GWL_Display * display,
void * ,
const bool  )
static

Definition at line 7078 of file GHOST_SystemWayland.cc.

References GWL_Display::data_device_manager, and GWL_Display::wl.

◆ gwl_registry_wl_output_add()

◆ gwl_registry_wl_output_remove()

void gwl_registry_wl_output_remove ( GWL_Display * display,
void * user_data,
const bool on_exit )
static

Definition at line 6818 of file GHOST_SystemWayland.cc.

References CLOG_WARN, GHOST_ASSERT, LOG, output, and GWL_Display::outputs.

◆ gwl_registry_wl_output_update()

void gwl_registry_wl_output_update ( GWL_Display * display,
const GWL_RegisteryUpdate_Params & params )
static

◆ gwl_registry_wl_seat_add()

◆ gwl_registry_wl_seat_remove()

◆ gwl_registry_wl_seat_update()

◆ gwl_registry_wl_shm_add()

void gwl_registry_wl_shm_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_wl_shm_remove()

void gwl_registry_wl_shm_remove ( GWL_Display * display,
void * ,
const bool  )
static

Definition at line 7058 of file GHOST_SystemWayland.cc.

References GWL_Display::shm, and GWL_Display::wl.

◆ gwl_registry_wp_cursor_shape_manager_add()

void gwl_registry_wp_cursor_shape_manager_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_wp_cursor_shape_manager_remove()

void gwl_registry_wp_cursor_shape_manager_remove ( GWL_Display * display,
void * ,
const bool  )
static

Definition at line 7292 of file GHOST_SystemWayland.cc.

References GWL_Display::cursor_shape_manager, and GWL_Display::wp.

◆ gwl_registry_wp_fractional_scale_manager_add()

void gwl_registry_wp_fractional_scale_manager_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_wp_fractional_scale_manager_remove()

void gwl_registry_wp_fractional_scale_manager_remove ( GWL_Display * display,
void * ,
const bool  )
static

◆ gwl_registry_wp_pointer_constraints_add()

void gwl_registry_wp_pointer_constraints_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_wp_pointer_constraints_remove()

void gwl_registry_wp_pointer_constraints_remove ( GWL_Display * display,
void * ,
const bool  )
static

Definition at line 7139 of file GHOST_SystemWayland.cc.

References GWL_Display::pointer_constraints, and GWL_Display::wp.

◆ gwl_registry_wp_pointer_gestures_add()

void gwl_registry_wp_pointer_gestures_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_wp_pointer_gestures_remove()

void gwl_registry_wp_pointer_gestures_remove ( GWL_Display * display,
void * ,
const bool  )
static

Definition at line 7162 of file GHOST_SystemWayland.cc.

References GWL_Display::pointer_gestures, and GWL_Display::wp.

◆ gwl_registry_wp_primary_selection_device_manager_add()

void gwl_registry_wp_primary_selection_device_manager_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_wp_primary_selection_device_manager_remove()

void gwl_registry_wp_primary_selection_device_manager_remove ( GWL_Display * display,
void * ,
const bool  )
static

◆ gwl_registry_wp_relative_pointer_manager_add()

void gwl_registry_wp_relative_pointer_manager_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_wp_relative_pointer_manager_remove()

void gwl_registry_wp_relative_pointer_manager_remove ( GWL_Display * display,
void * ,
const bool  )
static

◆ gwl_registry_wp_tablet_manager_add()

void gwl_registry_wp_tablet_manager_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_wp_tablet_manager_remove()

void gwl_registry_wp_tablet_manager_remove ( GWL_Display * display,
void * ,
const bool  )
static

Definition at line 7098 of file GHOST_SystemWayland.cc.

References GWL_Display::tablet_manager, and GWL_Display::wp.

◆ gwl_registry_wp_viewporter_add()

void gwl_registry_wp_viewporter_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_wp_viewporter_remove()

void gwl_registry_wp_viewporter_remove ( GWL_Display * display,
void * ,
const bool  )
static

Definition at line 7223 of file GHOST_SystemWayland.cc.

References GWL_Display::viewporter, and GWL_Display::wp.

◆ gwl_registry_xdg_activation_add()

void gwl_registry_xdg_activation_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_xdg_activation_remove()

void gwl_registry_xdg_activation_remove ( GWL_Display * display,
void * ,
const bool  )
static

Definition at line 7182 of file GHOST_SystemWayland.cc.

References GWL_Display::activation_manager, and GWL_Display::xdg.

◆ gwl_registry_xdg_decoration_manager_add()

◆ gwl_registry_xdg_decoration_manager_remove()

void gwl_registry_xdg_decoration_manager_remove ( GWL_Display * display,
void * ,
const bool  )
static

◆ gwl_registry_xdg_output_manager_add()

void gwl_registry_xdg_output_manager_add ( GWL_Display * display,
const GWL_RegisteryAdd_Params & params )
static

◆ gwl_registry_xdg_output_manager_remove()

void gwl_registry_xdg_output_manager_remove ( GWL_Display * display,
void * ,
const bool  )
static

Definition at line 6777 of file GHOST_SystemWayland.cc.

References GWL_Display::output_manager, and GWL_Display::xdg.

◆ gwl_registry_xdg_wm_base_add()

◆ gwl_registry_xdg_wm_base_remove()

void gwl_registry_xdg_wm_base_remove ( GWL_Display * display,
void * ,
const bool  )
static

◆ gwl_scaled_fixed_t_add_and_calc_rounded_delta()

int gwl_scaled_fixed_t_add_and_calc_rounded_delta ( GWL_ScaledFixedT * sf,
const wl_fixed_t add )
static

Definition at line 877 of file GHOST_SystemWayland.cc.

References add(), GWL_ScaledFixedT::factor, and GWL_ScaledFixedT::value.

◆ gwl_seat_capability_keyboard_disable()

◆ gwl_seat_capability_keyboard_enable()

void gwl_seat_capability_keyboard_enable ( GWL_Seat * seat)
static

◆ gwl_seat_capability_pointer_disable()

◆ gwl_seat_capability_pointer_enable()

◆ gwl_seat_capability_pointer_multitouch_check()

bool gwl_seat_capability_pointer_multitouch_check ( const GWL_Seat * seat,
const bool fallback )
static

◆ gwl_seat_capability_pointer_multitouch_disable()

◆ gwl_seat_capability_pointer_multitouch_enable()

◆ gwl_seat_capability_touch_disable()

void gwl_seat_capability_touch_disable ( GWL_Seat * seat)
static

Definition at line 6363 of file GHOST_SystemWayland.cc.

References GWL_Seat::touch, and GWL_Seat::wl.

Referenced by gwl_registry_wl_seat_remove(), and seat_handle_capabilities().

◆ gwl_seat_capability_touch_enable()

void gwl_seat_capability_touch_enable ( GWL_Seat * seat)
static

◆ gwl_seat_cursor_buffer_hide()

void gwl_seat_cursor_buffer_hide ( GWL_Seat * seat)
static

Hide the buffer defined by gwl_seat_cursor_buffer_set without changing anything else, so gwl_seat_cursor_buffer_show can be used to display it again.

The caller is responsible for setting seat->cursor.visible.

Definition at line 2987 of file GHOST_SystemWayland.cc.

References GWL_Seat::pointer, GWL_TabletTool::serial, GWL_Seat::tablet_tools, GWL_Seat::wl, and GWL_Seat::wp.

Referenced by gwl_seat_cursor_visible_set().

◆ gwl_seat_cursor_buffer_scale_calc()

int gwl_seat_cursor_buffer_scale_calc ( const GWL_Seat * seat)
static

Currently account for all cursors as the buffer is shared.

Note that a per pointing device buffer would be better, this is more of a low priority to-do.

Definition at line 2917 of file GHOST_SystemWayland.cc.

References GWL_SeatStatePointer::buffer_scale, GWL_Seat::pointer, GWL_Seat::tablet, GWL_Seat::tablet_seat, GWL_Seat::wl, and GWL_Seat::wp.

Referenced by GHOST_SystemWayland::cursor_shape_custom_set(), gwl_seat_cursor_buffer_set(), gwl_seat_cursor_buffer_show(), and update_cursor_scale().

◆ gwl_seat_cursor_buffer_set()

◆ gwl_seat_cursor_buffer_set_current()

void gwl_seat_cursor_buffer_set_current ( GWL_Seat * seat)
static

◆ gwl_seat_cursor_buffer_show()

void gwl_seat_cursor_buffer_show ( GWL_Seat * seat)
static

◆ gwl_seat_cursor_find_wl_shape_from_ghost()

std::optional< wp_cursor_shape_device_v1_shape > gwl_seat_cursor_find_wl_shape_from_ghost ( const GHOST_TStandardCursor shape)
static

Definition at line 2794 of file GHOST_SystemWayland.cc.

References GHOST_ASSERT, GHOST_kStandardCursorBlade, GHOST_kStandardCursorBothHandles, GHOST_kStandardCursorBottomLeftCorner, GHOST_kStandardCursorBottomRightCorner, GHOST_kStandardCursorBottomSide, GHOST_kStandardCursorCopy, GHOST_kStandardCursorCrosshair, GHOST_kStandardCursorCrosshairA, GHOST_kStandardCursorCrosshairB, GHOST_kStandardCursorCrosshairC, GHOST_kStandardCursorCustom, GHOST_kStandardCursorDefault, GHOST_kStandardCursorDestroy, GHOST_kStandardCursorDownArrow, GHOST_kStandardCursorEraser, GHOST_kStandardCursorEWScroll, GHOST_kStandardCursorEyedropper, GHOST_kStandardCursorHandClosed, GHOST_kStandardCursorHandOpen, GHOST_kStandardCursorHandPoint, GHOST_kStandardCursorHelp, GHOST_kStandardCursorHorizontalSplit, GHOST_kStandardCursorInfo, GHOST_kStandardCursorKnife, GHOST_kStandardCursorLeftArrow, GHOST_kStandardCursorLeftHandle, GHOST_kStandardCursorLeftRight, GHOST_kStandardCursorLeftSide, GHOST_kStandardCursorMove, GHOST_kStandardCursorNSEWScroll, GHOST_kStandardCursorNSScroll, GHOST_kStandardCursorPencil, GHOST_kStandardCursorRightArrow, GHOST_kStandardCursorRightHandle, GHOST_kStandardCursorRightSide, GHOST_kStandardCursorSlip, GHOST_kStandardCursorStop, GHOST_kStandardCursorText, GHOST_kStandardCursorTopLeftCorner, GHOST_kStandardCursorTopRightCorner, GHOST_kStandardCursorTopSide, GHOST_kStandardCursorUpArrow, GHOST_kStandardCursorUpDown, GHOST_kStandardCursorVerticalSplit, GHOST_kStandardCursorWait, GHOST_kStandardCursorZoomIn, and GHOST_kStandardCursorZoomOut.

Referenced by GHOST_SystemWayland::cursor_shape_check(), and GHOST_SystemWayland::cursor_shape_set().

◆ gwl_seat_cursor_visible_set()

◆ gwl_seat_key_layout_active_state_update_mask()

void gwl_seat_key_layout_active_state_update_mask ( GWL_Seat * seat)
static

Account for changes to #GWL_Seat::xkb::layout_active by running #xkb_state_update_mask on static states which are used for lookups.

This is also used when initializing the states.

Definition at line 1290 of file GHOST_SystemWayland.cc.

References GHOST_ASSERT, GWL_Seat::layout_active, MOD_INDEX_SHIFT, GWL_Seat::state_empty, GWL_Seat::state_empty_with_numlock, GWL_Seat::state_empty_with_shift, GWL_Seat::xkb, GWL_Seat::xkb_keymap_mod_index, GWL_Seat::xkb_keymap_mod_index_mod2, and GWL_Seat::xkb_keymap_mod_index_numlock.

Referenced by keyboard_handle_keymap(), and keyboard_handle_modifiers().

◆ gwl_seat_key_repeat_timer_add()

void gwl_seat_key_repeat_timer_add ( GWL_Seat * seat,
GHOST_TimerProcPtr key_repeat_fn,
GHOST_TUserDataPtr payload,
const bool use_delay )
static
Note
Caller must lock timer_mutex.
A seat->key_repeat.rate of zero indicates that client-side key repeat is disabled, the compositor may generate repeat events. The caller must ensure this function isn't called in that case.

Definition at line 1355 of file GHOST_SystemWayland.cc.

References GHOST_TimerManager::addTimer(), GWL_Seat::delay, GHOST_SystemWayland::getMilliSeconds(), GHOST_ASSERT, GHOST_SystemWayland::ghost_timer_manager(), GHOST_System::installTimer(), GWL_Seat::key_repeat, GWL_Seat::rate, GWL_Seat::system, GWL_Seat::timer, and timer.

Referenced by keyboard_handle_enter(), keyboard_handle_key(), and keyboard_handle_key_repeat_reset().

◆ gwl_seat_key_repeat_timer_fn()

◆ gwl_seat_key_repeat_timer_remove()

◆ gwl_seat_state_pointer_active()

◆ gwl_seat_state_pointer_from_cursor_surface()

GWL_SeatStatePointer * gwl_seat_state_pointer_from_cursor_surface ( GWL_Seat * seat,
const wl_surface * wl_surface )
static

◆ gwl_simple_buffer_free_data()

◆ gwl_simple_buffer_set_from_string()

void gwl_simple_buffer_set_from_string ( GWL_SimpleBuffer * buffer,
const char * str )
static

◆ gwl_tablet_tool_frame_event_add()

◆ gwl_tablet_tool_frame_event_reset()

void gwl_tablet_tool_frame_event_reset ( GWL_TabletTool * tablet_tool)
static

◆ gwl_xdg_decor_system_destroy()

◆ keyboard_depressed_state_key_event()

void keyboard_depressed_state_key_event ( GWL_Seat * seat,
const GHOST_TKey gkey,
const GHOST_TEventType etype )
static

◆ keyboard_depressed_state_push_events_from_change()

◆ keyboard_depressed_state_reset()

void keyboard_depressed_state_reset ( GWL_Seat * seat)
static

◆ keyboard_handle_enter()

◆ keyboard_handle_key()

◆ keyboard_handle_key_repeat_cancel()

void keyboard_handle_key_repeat_cancel ( GWL_Seat * seat)
static

◆ keyboard_handle_key_repeat_reset()

void keyboard_handle_key_repeat_reset ( GWL_Seat * seat,
const bool use_delay )
static

Restart the key-repeat timer.

Parameters
use_delayWhen false, use the interval (prevents pause when the setting changes while the key is held).
Note
Caller must lock timer_mutex.

Definition at line 5556 of file GHOST_SystemWayland.cc.

References GHOST_ITimerTask::getTimerProc(), GHOST_ITimerTask::getUserData(), GHOST_ASSERT, gwl_seat_key_repeat_timer_add(), gwl_seat_key_repeat_timer_remove(), GWL_Seat::key_repeat, and GWL_Seat::timer.

Referenced by keyboard_handle_modifiers(), and keyboard_handle_repeat_info().

◆ keyboard_handle_keymap()

◆ keyboard_handle_leave()

void keyboard_handle_leave ( void * data,
wl_keyboard * ,
const uint32_t ,
wl_surface * wl_surface )
static

Leave event.

Notification that this seat's keyboard focus is no longer on a certain wl_surface.

Definition at line 5404 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, data, ghost_wl_surface_own_with_null_check(), GWL_Seat::key_repeat, GWL_Seat::keyboard, keyboard_handle_key_repeat_cancel(), LOG, GWL_Seat::system, GWL_Seat::timer, GHOST_SystemWayland::timer_mutex, and wl_surface.

◆ keyboard_handle_modifiers()

void keyboard_handle_modifiers ( void * data,
wl_keyboard * ,
const uint32_t serial,
const uint32_t mods_depressed,
const uint32_t mods_latched,
const uint32_t mods_locked,
const uint32_t group )
static

◆ keyboard_handle_repeat_info()

void keyboard_handle_repeat_info ( void * data,
wl_keyboard * ,
const int32_t rate,
const int32_t delay )
static

◆ memfd_create_sealed()

int memfd_create_sealed ( const char * name)
static

Definition at line 2419 of file GHOST_SystemWayland.cc.

References free(), and name.

Referenced by ghost_wl_buffer_create_for_image().

◆ output_handle_description()

void output_handle_description ( void * ,
wl_output * ,
const char * description )
static

Definition at line 6612 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ output_handle_done()

void output_handle_done ( void * data,
wl_output *  )
static

Sent all information about output.

This event is sent after all other properties have been sent after binding to the output object and after any other property changes done after that. This allows changes to the output properties to be seen as atomic, even if they happen via multiple events.

Definition at line 6575 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, data, FRACTIONAL_DENOMINATOR, GHOST_ASSERT, LOG, output, and UNPACK2.

Referenced by xdg_output_handle_done().

◆ output_handle_geometry()

void output_handle_geometry ( void * data,
wl_output * ,
const int32_t ,
const int32_t ,
const int32_t physical_width,
const int32_t physical_height,
const int32_t ,
const char * make,
const char * model,
const int32_t transform )
static

Definition at line 6522 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, data, LOG, make(), output, and transform().

◆ output_handle_mode()

void output_handle_mode ( void * data,
wl_output * ,
const uint32_t flags,
const int32_t width,
const int32_t height,
const int32_t  )
static

Definition at line 6549 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, data, LOG, and output.

◆ output_handle_name()

void output_handle_name ( void * ,
wl_output * ,
const char * name )
static

Definition at line 6607 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, LOG, and name.

◆ output_handle_scale()

void output_handle_scale ( void * data,
wl_output * ,
const int32_t factor )
static

Definition at line 6599 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, data, LOG, and output.

◆ pointer_axis_as_index()

int pointer_axis_as_index ( const uint32_t axis)
static

◆ pointer_handle_axis()

◆ pointer_handle_axis_discrete()

void pointer_handle_axis_discrete ( void * data,
wl_pointer * ,
const uint32_t axis,
const int32_t discrete )
static

◆ pointer_handle_axis_source()

void pointer_handle_axis_source ( void * data,
wl_pointer * ,
const uint32_t axis_source )
static

◆ pointer_handle_axis_stop()

◆ pointer_handle_axis_value120()

void pointer_handle_axis_value120 ( void * data,
wl_pointer * ,
const uint32_t axis,
const int32_t value120 )
static

◆ pointer_handle_button()

void pointer_handle_button ( void * data,
wl_pointer * ,
const uint32_t serial,
const uint32_t time,
const uint32_t button,
const uint32_t state )
static

◆ pointer_handle_enter()

◆ pointer_handle_frame()

void pointer_handle_frame ( void * data,
wl_pointer *  )
static

Definition at line 4025 of file GHOST_SystemWayland.cc.

References GWL_SeatStatePointerScroll::axis_source, Button0_Down, Button0_Up, Button1_Down, Button1_Up, Button2_Down, Button2_Up, Button3_Down, Button3_Up, Button4_Down, Button4_Up, Button5_Down, Button5_Up, Button6_Down, Button6_Up, CLOG_DEBUG, data, GWL_SeatStatePointerScroll::discrete120_xy, GWL_SeatStatePointerScroll::discrete120_xy_accum, GWL_SeatStatePointerScroll::discrete_xy, GWL_SeatStatePointerScroll::event_ms, GWL_SeatStatePointer_Events::frame_event_ms, GWL_SeatStatePointer_Events::frame_pending, GWL_SeatStatePointer_Events::frame_types, GWL_SeatStatePointer_Events::frame_types_num, GHOST_SystemWayland::getMilliSeconds(), GHOST_ASSERT, GHOST_kEventButtonDown, GHOST_kEventButtonUp, GHOST_kEventCursorMove, GHOST_kEventWheelAxisHorizontal, GHOST_kEventWheelAxisVertical, GHOST_kTrackpadEventScroll, GHOST_TABLET_DATA_NONE, ghost_wl_surface_user_data(), gwl_pointer_events_ebutton, gwl_pointer_handle_frame_event_reset(), GWL_SeatStatePointerScroll::has_event_ms, i, GWL_SeatStatePointerScroll::inverted_xy, LOG, Motion, GWL_Seat::pointer, GWL_Seat::pointer_events, GWL_Seat::pointer_scroll, GHOST_SystemWayland::pushEvent_maybe_pending(), Scroll, GWL_SeatStatePointerScroll::smooth_as_discrete, smooth_as_discrete_steps, GWL_SeatStatePointerScroll::smooth_xy, GWL_SeatStatePointerScroll_SmoothAsDiscrete::smooth_xy_accum, GWL_Seat::system, UNPACK2, GWL_Seat::use_pointer_scroll_smooth_as_discrete, WL_FIXED_TO_INT_FOR_WINDOW_V2, and wl_surface.

◆ pointer_handle_leave()

void pointer_handle_leave ( void * data,
wl_pointer * ,
const uint32_t ,
wl_surface * wl_surface )
static

◆ pointer_handle_motion()

void pointer_handle_motion ( void * data,
wl_pointer * ,
const uint32_t time,
const wl_fixed_t surface_x,
const wl_fixed_t surface_y )
static

◆ primary_selection_device_handle_data_offer()

void primary_selection_device_handle_data_offer ( void * ,
zwp_primary_selection_device_v1 * ,
zwp_primary_selection_offer_v1 * id )
static

◆ primary_selection_device_handle_selection()

void primary_selection_device_handle_selection ( void * data,
zwp_primary_selection_device_v1 * ,
zwp_primary_selection_offer_v1 * id )
static

◆ primary_selection_offer_offer()

void primary_selection_offer_offer ( void * data,
zwp_primary_selection_offer_v1 * id,
const char * type )
static

◆ primary_selection_source_cancelled()

void primary_selection_source_cancelled ( void * data,
zwp_primary_selection_source_v1 * source )
static

◆ primary_selection_source_send()

void primary_selection_source_send ( void * data,
zwp_primary_selection_source_v1 * ,
const char * ,
const int32_t fd )
static

◆ pthread_set_min_priority()

void pthread_set_min_priority ( pthread_t handle)
static

Definition at line 2407 of file GHOST_SystemWayland.cc.

Referenced by gwl_display_event_thread_create().

◆ read_buffer_from_data_offer()

char * read_buffer_from_data_offer ( GWL_DataOffer * data_offer,
const char * mime_receive,
std::mutex * mutex,
const bool nil_terminate,
size_t * r_len )
static

◆ read_buffer_from_primary_selection_offer()

char * read_buffer_from_primary_selection_offer ( GWL_PrimarySelection_DataOffer * data_offer,
const char * mime_receive,
std::mutex * mutex,
const bool nil_terminate,
size_t * r_len )
static

◆ read_exhaustive()

ssize_t read_exhaustive ( const int fd,
void * data,
size_t nbytes )
static

A version of read which will read nbytes or as many bytes as possible, useful as the LIBC version may read less than requested.

Definition at line 2650 of file GHOST_SystemWayland.cc.

References data, read, and UNLIKELY.

Referenced by read_file_as_buffer().

◆ read_file_as_buffer()

char * read_file_as_buffer ( const int fd,
const bool nil_terminate,
size_t * r_len )
static

Read from fd into a buffer which is returned. Use for files where seeking to determine the final size isn't supported (pipes for example).

Returns
the buffer or null on failure. On failure errno will be set.

Definition at line 2678 of file GHOST_SystemWayland.cc.

References data, free(), len, next, read_exhaustive(), and UNLIKELY.

Referenced by read_buffer_from_data_offer(), and read_buffer_from_primary_selection_offer().

◆ relative_pointer_handle_relative_motion()

void relative_pointer_handle_relative_motion ( void * data,
zwp_relative_pointer_v1 * ,
const uint32_t utime_hi,
const uint32_t utime_lo,
const wl_fixed_t dx,
const wl_fixed_t dy,
const wl_fixed_t ,
const wl_fixed_t  )
static

◆ relative_pointer_handle_relative_motion_impl()

◆ rgba_straight_to_premul()

uint32_t rgba_straight_to_premul ( uint32_t rgba_uint)
static

Definition at line 1962 of file GHOST_SystemWayland.cc.

Referenced by ghost_wl_buffer_from_cursor_generator().

◆ rgba_straight_to_premul_inverted()

uint32_t rgba_straight_to_premul_inverted ( uint32_t rgba_uint)
static

Definition at line 1972 of file GHOST_SystemWayland.cc.

Referenced by ghost_wl_buffer_from_cursor_generator().

◆ round_up_uint()

uint32_t round_up_uint ( const uint32_t x,
const uint32_t multiple )
static

Definition at line 1957 of file GHOST_SystemWayland.cc.

References x.

Referenced by ghost_wl_buffer_from_cursor_generator().

◆ seat_grab_state_from_mode()

GWL_SeatStateGrab seat_grab_state_from_mode ( const GHOST_TGrabCursorMode mode,
const bool use_software_confine )
static

◆ seat_handle_capabilities()

◆ seat_handle_name()

void seat_handle_name ( void * data,
wl_seat * ,
const char * name )
static

Definition at line 6408 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, data, LOG, and name.

◆ setCursorGrab_use_software_confine()

bool setCursorGrab_use_software_confine ( const GHOST_TGrabCursorMode mode,
wl_surface * wl_surface )
static

◆ setCursorPositionClientRelative_impl()

◆ shell_handle_ping()

void shell_handle_ping ( void * ,
xdg_wm_base * xdg_wm_base,
const uint32_t serial )
static

Definition at line 6640 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ sub_abs_u64()

uint64_t sub_abs_u64 ( const uint64_t a,
const uint64_t b )
static

Definition at line 2013 of file GHOST_SystemWayland.cc.

References b.

Referenced by GHOST_SystemWayland::ms_from_input_time().

◆ system_clipboard_get()

◆ system_clipboard_get_primary_selection()

◆ system_clipboard_put()

◆ system_clipboard_put_primary_selection()

◆ system_clipboard_text_mime_type()

const char * system_clipboard_text_mime_type ( const std::unordered_set< std::string > & data_offer_types)
static

Return a mime type which is supported by GHOST and exists in types (defined by the data offer).

Definition at line 7996 of file GHOST_SystemWayland.cc.

References ARRAY_SIZE, ghost_wl_mime_text_plain, ghost_wl_mime_text_utf8, and i.

Referenced by system_clipboard_get(), and system_clipboard_get_primary_selection().

◆ tablet_seat_handle_pad_added()

void tablet_seat_handle_pad_added ( void * ,
zwp_tablet_seat_v2 * ,
zwp_tablet_pad_v2 * id )
static

Definition at line 5191 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ tablet_seat_handle_tablet_added()

void tablet_seat_handle_tablet_added ( void * ,
zwp_tablet_seat_v2 * ,
zwp_tablet_v2 * id )
static

Definition at line 5162 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ tablet_seat_handle_tool_added()

◆ tablet_tool_handle_button()

void tablet_tool_handle_button ( void * data,
zwp_tablet_tool_v2 * ,
const uint32_t serial,
const uint32_t button,
const uint32_t state )
static

◆ tablet_tool_handle_capability()

void tablet_tool_handle_capability ( void * ,
zwp_tablet_tool_v2 * ,
const uint32_t capability )
static

Definition at line 4802 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ tablet_tool_handle_distance()

void tablet_tool_handle_distance ( void * ,
zwp_tablet_tool_v2 * ,
const uint32_t distance )
static

Definition at line 4936 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, distance(), and LOG.

◆ tablet_tool_handle_done()

void tablet_tool_handle_done ( void * ,
zwp_tablet_tool_v2 *  )
static

Definition at line 4815 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ tablet_tool_handle_down()

void tablet_tool_handle_down ( void * data,
zwp_tablet_tool_v2 * ,
const uint32_t serial )
static

◆ tablet_tool_handle_frame()

◆ tablet_tool_handle_hardware_id_wacom()

void tablet_tool_handle_hardware_id_wacom ( void * ,
zwp_tablet_tool_v2 * ,
const uint32_t ,
const uint32_t  )
static

Definition at line 4794 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ tablet_tool_handle_hardware_serial()

void tablet_tool_handle_hardware_serial ( void * ,
zwp_tablet_tool_v2 * ,
const uint32_t ,
const uint32_t  )
static

Definition at line 4786 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ tablet_tool_handle_motion()

void tablet_tool_handle_motion ( void * data,
zwp_tablet_tool_v2 * ,
const wl_fixed_t x,
const wl_fixed_t y )
static

◆ tablet_tool_handle_pressure()

void tablet_tool_handle_pressure ( void * data,
zwp_tablet_tool_v2 * ,
const uint32_t pressure )
static

◆ tablet_tool_handle_proximity_in()

◆ tablet_tool_handle_proximity_out()

void tablet_tool_handle_proximity_out ( void * data,
zwp_tablet_tool_v2 *  )
static

◆ tablet_tool_handle_removed()

void tablet_tool_handle_removed ( void * data,
zwp_tablet_tool_v2 * zwp_tablet_tool_v2 )
static

◆ tablet_tool_handle_rotation()

void tablet_tool_handle_rotation ( void * ,
zwp_tablet_tool_v2 * ,
const wl_fixed_t degrees )
static

Definition at line 4963 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, degrees(), and LOG.

◆ tablet_tool_handle_slider()

void tablet_tool_handle_slider ( void * ,
zwp_tablet_tool_v2 * ,
const int32_t position )
static

Definition at line 4970 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ tablet_tool_handle_tilt()

void tablet_tool_handle_tilt ( void * data,
zwp_tablet_tool_v2 * ,
const wl_fixed_t tilt_x,
const wl_fixed_t tilt_y )
static

◆ tablet_tool_handle_type()

void tablet_tool_handle_type ( void * data,
zwp_tablet_tool_v2 * ,
const uint32_t tool_type )
static

◆ tablet_tool_handle_up()

void tablet_tool_handle_up ( void * data,
zwp_tablet_tool_v2 *  )
static

◆ tablet_tool_handle_wheel()

void tablet_tool_handle_wheel ( void * data,
zwp_tablet_tool_v2 * ,
const wl_fixed_t ,
const int32_t clicks )
static

◆ tablet_tool_map_type()

GHOST_TTabletMode tablet_tool_map_type ( enum zwp_tablet_tool_v2_type wp_tablet_tool_type)
static

◆ touch_seat_handle_cancel()

void touch_seat_handle_cancel ( void * ,
wl_touch *  )
static

Definition at line 4731 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ touch_seat_handle_down()

◆ touch_seat_handle_frame()

◆ touch_seat_handle_motion()

void touch_seat_handle_motion ( void * data,
wl_touch * ,
const uint32_t time,
const int32_t id,
const wl_fixed_t x,
const wl_fixed_t y )
static

◆ touch_seat_handle_orientation()

void touch_seat_handle_orientation ( void * ,
wl_touch * ,
const int32_t ,
const wl_fixed_t  )
static

Definition at line 4746 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ touch_seat_handle_shape()

void touch_seat_handle_shape ( void * ,
wl_touch * ,
const int32_t ,
const wl_fixed_t ,
const wl_fixed_t  )
static

Definition at line 4737 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ touch_seat_handle_up()

void touch_seat_handle_up ( void * data,
wl_touch * ,
const uint32_t ,
const uint32_t time,
const int32_t id )
static

◆ update_cursor_scale()

◆ xdg_output_handle_description()

void xdg_output_handle_description ( void * ,
zxdg_output_v1 * ,
const char * description )
static

Definition at line 6496 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, and LOG.

◆ xdg_output_handle_done()

void xdg_output_handle_done ( void * data,
zxdg_output_v1 *  )
static

Definition at line 6478 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, data, LOG, output, and output_handle_done().

◆ xdg_output_handle_logical_position()

void xdg_output_handle_logical_position ( void * data,
zxdg_output_v1 * ,
const int32_t x,
const int32_t y )
static

Definition at line 6430 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, data, LOG, output, x, and y.

◆ xdg_output_handle_logical_size()

void xdg_output_handle_logical_size ( void * data,
zxdg_output_v1 * ,
const int32_t width,
const int32_t height )
static

◆ xdg_output_handle_name()

void xdg_output_handle_name ( void * ,
zxdg_output_v1 * ,
const char * name )
static

Definition at line 6489 of file GHOST_SystemWayland.cc.

References CLOG_DEBUG, LOG, and name.

◆ xkb_compose_state_feed_and_get_utf8()

bool xkb_compose_state_feed_and_get_utf8 ( xkb_compose_state * compose_state,
xkb_state * state,
const xkb_keycode_t key,
char r_utf8_buf[sizeof(GHOST_TEventKeyData::utf8_buf)] )
static

◆ xkb_map_gkey()

◆ xkb_map_gkey_or_scan_code()

GHOST_TKey xkb_map_gkey_or_scan_code ( const xkb_keysym_t sym,
const uint32_t key )
static

Map the keys using the users keyboard layout, if that fails fall back to physical locations. This is needed so users with keyboard layouts that don't expose GHOST_kKeyAccentGrave (typically the key under escape) in the layout can still use this key in keyboard shortcuts.

Parameters
keyThe key's scan-code, compatible with values in linux/input-event-codes.h.

Definition at line 2270 of file GHOST_SystemWayland.cc.

References GHOST_kKeyAccentGrave, GHOST_kKeyGrLess, GHOST_kKeyUnknown, GHOST_PRINT, KEY_102ND, KEY_GRAVE, UNLIKELY, and xkb_map_gkey().

Referenced by keyboard_handle_enter(), and keyboard_handle_key().

◆ xkb_state_key_get_one_sym_without_modifiers()

xkb_keysym_t xkb_state_key_get_one_sym_without_modifiers ( xkb_state * xkb_state_empty,
xkb_state * xkb_state_empty_with_numlock,
xkb_state * xkb_state_empty_with_shift,
const bool xkb_use_non_latin_workaround,
const xkb_keycode_t key )
static

A version of #xkb_state_key_get_one_sym which returns the key without any modifiers pressed. Needed because GHOST_TKey uses these values as key-codes.

Definition at line 5433 of file GHOST_SystemWayland.cc.

References EVDEV_OFFSET, GHOST_ASSERT, KEY_0, and KEY_1.

Referenced by keyboard_handle_key().

Variable Documentation

◆ cursor_buffer_listener

const wl_buffer_listener cursor_buffer_listener
static
Initial value:
= {
}
static void cursor_buffer_handle_release(void *data, wl_buffer *wl_buffer)

Definition at line 3771 of file GHOST_SystemWayland.cc.

Referenced by GHOST_SystemWayland::cursor_shape_custom_set().

◆ cursor_surface_listener

const wl_surface_listener cursor_surface_listener
static
Initial value:
= {
}
static void cursor_surface_handle_enter(void *data, wl_surface *wl_surface, wl_output *wl_output)
static void cursor_surface_handle_leave(void *data, wl_surface *wl_surface, wl_output *wl_output)

Definition at line 3871 of file GHOST_SystemWayland.cc.

Referenced by gwl_seat_capability_pointer_enable(), and tablet_seat_handle_tool_added().

◆ data_device_listener

const wl_data_device_listener data_device_listener
static
Initial value:
= {
}
static void data_device_handle_drop(void *data, wl_data_device *)
static void data_device_handle_selection(void *data, wl_data_device *, wl_data_offer *id)
static void data_device_handle_data_offer(void *, wl_data_device *, wl_data_offer *id)
static void data_device_handle_leave(void *data, wl_data_device *)
static void data_device_handle_motion(void *data, wl_data_device *, const uint32_t time, const wl_fixed_t x, const wl_fixed_t y)
static void data_device_handle_enter(void *data, wl_data_device *, const uint32_t serial, wl_surface *wl_surface, const wl_fixed_t x, const wl_fixed_t y, wl_data_offer *id)

Definition at line 3738 of file GHOST_SystemWayland.cc.

Referenced by gwl_registry_wl_seat_update().

◆ data_offer_listener

const wl_data_offer_listener data_offer_listener
static
Initial value:
= {
}
static void data_offer_handle_source_actions(void *data, wl_data_offer *, const uint32_t source_actions)
static void data_offer_handle_action(void *data, wl_data_offer *, const uint32_t dnd_action)
static void data_offer_handle_offer(void *data, wl_data_offer *, const char *mime_type)

Definition at line 3466 of file GHOST_SystemWayland.cc.

Referenced by data_device_handle_data_offer().

◆ data_source_listener

const wl_data_source_listener data_source_listener
static
Initial value:
= {
}
static void data_source_handle_target(void *, wl_data_source *, const char *)
static void data_source_handle_cancelled(void *data, wl_data_source *wl_data_source)
static void data_source_handle_send(void *data, wl_data_source *, const char *, const int32_t fd)
static void data_source_handle_dnd_finished(void *, wl_data_source *)
static void data_source_handle_action(void *, wl_data_source *, const uint32_t dnd_action)
static void data_source_handle_dnd_drop_performed(void *, wl_data_source *)

Definition at line 3416 of file GHOST_SystemWayland.cc.

Referenced by GHOST_SystemWayland::putClipboardImage(), and system_clipboard_put().

◆ default_cursor_size

const int default_cursor_size = 24
static

Definition at line 2338 of file GHOST_SystemWayland.cc.

Referenced by gwl_seat_capability_pointer_enable().

◆ events_pending_default_size

size_t events_pending_default_size = 4096 / sizeof(void *)
constexpr

Default size for pending event vector.

Definition at line 150 of file GHOST_SystemWayland.cc.

Referenced by gwl_display_event_thread_create(), and GHOST_SystemWayland::processEvents().

◆ g_modifier_info_table

const GWL_ModifierInfo g_modifier_info_table[MOD_INDEX_NUM]
static

◆ ghost_wl_app_id

const char* ghost_wl_app_id
static
Initial value:
= (
"blender"
)

Definition at line 9346 of file GHOST_SystemWayland.cc.

Referenced by GHOST_SystemWayland::xdg_app_id_get().

◆ ghost_wl_mime_img_png

const char* ghost_wl_mime_img_png = "image/png"
staticconstexpr

◆ ghost_wl_mime_preference_order

const char* ghost_wl_mime_preference_order[]
static
Initial value:
= {
}
static constexpr const char * ghost_wl_mime_text_plain
static constexpr const char * ghost_wl_mime_text_uri_list
static constexpr const char * ghost_wl_mime_text_utf8

Definition at line 2344 of file GHOST_SystemWayland.cc.

Referenced by data_device_handle_drop(), and data_device_handle_enter().

◆ ghost_wl_mime_preference_order_type

const GHOST_TDragnDropTypes ghost_wl_mime_preference_order_type[]
static
Initial value:

Definition at line 2350 of file GHOST_SystemWayland.cc.

Referenced by dnd_events().

◆ ghost_wl_mime_send

const char* ghost_wl_mime_send[]
static
Initial value:
= {
"UTF8_STRING",
"COMPOUND_TEXT",
"TEXT",
"STRING",
"text/plain;charset=utf-8",
"text/plain",
}

Definition at line 2356 of file GHOST_SystemWayland.cc.

Referenced by system_clipboard_put(), and system_clipboard_put_primary_selection().

◆ ghost_wl_mime_text_plain

const char* ghost_wl_mime_text_plain = "text/plain"
staticconstexpr

◆ ghost_wl_mime_text_uri_list

const char* ghost_wl_mime_text_uri_list = "text/uri-list"
staticconstexpr

◆ ghost_wl_mime_text_utf8

const char* ghost_wl_mime_text_utf8 = "text/plain;charset=utf-8"
staticconstexpr

◆ ghost_wl_output_tag_id

const char* ghost_wl_output_tag_id = "GHOST-output"
static

Definition at line 9238 of file GHOST_SystemWayland.cc.

Referenced by ghost_wl_output_own(), and ghost_wl_output_tag().

◆ ghost_wl_surface_cursor_pointer_tag_id

const char* ghost_wl_surface_cursor_pointer_tag_id = "GHOST-cursor-pointer"
static

◆ ghost_wl_surface_cursor_tablet_tag_id

const char* ghost_wl_surface_cursor_tablet_tag_id = "GHOST-cursor-tablet"
static

◆ ghost_wl_surface_tag_id

const char* ghost_wl_surface_tag_id = "GHOST-window"
static

Definition at line 9239 of file GHOST_SystemWayland.cc.

Referenced by ghost_wl_surface_own(), and ghost_wl_surface_tag().

◆ gwl_pointer_events_ebutton

const GHOST_TButton gwl_pointer_events_ebutton[]
static
Initial value:

Definition at line 765 of file GHOST_SystemWayland.cc.

Referenced by pointer_handle_frame().

◆ gwl_registry_handlers

const GWL_RegistryHandler gwl_registry_handlers[]
static

Map interfaces to initialization functions.

Note
This list also defines the order interfaces are removed. On exit interface removal runs from last to first to avoid potential bugs caused by undefined order of removal.

In general fundamental, low level objects such as the compositor and shared memory should be declared earlier and other interfaces that may use them should be declared later.

Definition at line 7311 of file GHOST_SystemWayland.cc.

Referenced by global_handle_add(), global_handle_remove(), gwl_registry_handler_from_interface_slot(), gwl_registry_handler_interface_slot_from_string(), and gwl_registry_handler_interface_slot_max().

◆ gwl_tablet_tool_ebutton

const GHOST_TButton gwl_tablet_tool_ebutton[]
static

◆ has_wl_trackpad_physical_direction

signed char has_wl_trackpad_physical_direction = -1
static

◆ keyboard_listener

const wl_keyboard_listener keyboard_listener
static
Initial value:
= {
}
static void keyboard_handle_repeat_info(void *data, wl_keyboard *, const int32_t rate, const int32_t delay)
static void keyboard_handle_modifiers(void *data, wl_keyboard *, const uint32_t serial, const uint32_t mods_depressed, const uint32_t mods_latched, const uint32_t mods_locked, const uint32_t group)
static void keyboard_handle_keymap(void *data, wl_keyboard *, const uint32_t format, const int32_t fd, const uint32_t size)
static void keyboard_handle_key(void *data, wl_keyboard *, const uint32_t serial, const uint32_t time, const uint32_t key, const uint32_t state)
static void keyboard_handle_leave(void *data, wl_keyboard *, const uint32_t, wl_surface *wl_surface)
static void keyboard_handle_enter(void *data, wl_keyboard *, const uint32_t serial, wl_surface *wl_surface, wl_array *keys)

Definition at line 5781 of file GHOST_SystemWayland.cc.

Referenced by gwl_seat_capability_keyboard_enable().

◆ LOG_WL_CURSOR_BUFFER

CLG_LogRef LOG_WL_CURSOR_BUFFER = {"ghost.wl.handle.cursor_buffer"}
static

Definition at line 3755 of file GHOST_SystemWayland.cc.

◆ LOG_WL_CURSOR_SURFACE

CLG_LogRef LOG_WL_CURSOR_SURFACE = {"ghost.wl.handle.cursor_surface"}
static

Definition at line 3783 of file GHOST_SystemWayland.cc.

◆ LOG_WL_DATA_DEVICE

CLG_LogRef LOG_WL_DATA_DEVICE = {"ghost.wl.handle.data_device"}
static

Definition at line 3480 of file GHOST_SystemWayland.cc.

◆ LOG_WL_DATA_OFFER

CLG_LogRef LOG_WL_DATA_OFFER = {"ghost.wl.handle.data_offer"}
static

Definition at line 3433 of file GHOST_SystemWayland.cc.

◆ LOG_WL_DATA_SOURCE

CLG_LogRef LOG_WL_DATA_SOURCE = {"ghost.wl.handle.data_source"}
static

Definition at line 3239 of file GHOST_SystemWayland.cc.

◆ LOG_WL_KEYBOARD

CLG_LogRef LOG_WL_KEYBOARD = {"ghost.wl.handle.keyboard"}
static

Definition at line 5212 of file GHOST_SystemWayland.cc.

◆ LOG_WL_KEYBOARD_DEPRESSED_STATE

CLG_LogRef LOG_WL_KEYBOARD_DEPRESSED_STATE = {"ghost.wl.keyboard.depressed"}
static

Definition at line 3095 of file GHOST_SystemWayland.cc.

Referenced by GHOST_SystemWayland::getModifierKeys().

◆ LOG_WL_OUTPUT

CLG_LogRef LOG_WL_OUTPUT = {"ghost.wl.handle.output"}
static

Definition at line 6519 of file GHOST_SystemWayland.cc.

◆ LOG_WL_POINTER

CLG_LogRef LOG_WL_POINTER = {"ghost.wl.handle.pointer"}
static

Definition at line 3889 of file GHOST_SystemWayland.cc.

◆ LOG_WL_PRIMARY_SELECTION_DEVICE

CLG_LogRef LOG_WL_PRIMARY_SELECTION_DEVICE = {"ghost.wl.handle.primary_selection_device"}
static

Definition at line 5827 of file GHOST_SystemWayland.cc.

◆ LOG_WL_PRIMARY_SELECTION_OFFER

CLG_LogRef LOG_WL_PRIMARY_SELECTION_OFFER = {"ghost.wl.handle.primary_selection_offer"}
static

Definition at line 5798 of file GHOST_SystemWayland.cc.

◆ LOG_WL_PRIMARY_SELECTION_SOURCE

CLG_LogRef LOG_WL_PRIMARY_SELECTION_SOURCE = {"ghost.wl.handle.primary_selection_source"}
static

Definition at line 5880 of file GHOST_SystemWayland.cc.

◆ LOG_WL_REGISTRY

CLG_LogRef LOG_WL_REGISTRY = {"ghost.wl.handle.registry"}
static

Definition at line 6689 of file GHOST_SystemWayland.cc.

◆ LOG_WL_RELATIVE_POINTER

CLG_LogRef LOG_WL_RELATIVE_POINTER = {"ghost.wl.handle.relative_pointer"}
static

Definition at line 3166 of file GHOST_SystemWayland.cc.

◆ LOG_WL_SEAT

CLG_LogRef LOG_WL_SEAT = {"ghost.wl.handle.seat"}
static

Definition at line 6143 of file GHOST_SystemWayland.cc.

◆ LOG_WL_TABLET_SEAT

CLG_LogRef LOG_WL_TABLET_SEAT = {"ghost.wl.handle.tablet_seat"}
static

Definition at line 5159 of file GHOST_SystemWayland.cc.

◆ LOG_WL_TABLET_TOOL

CLG_LogRef LOG_WL_TABLET_TOOL = {"ghost.wl.handle.tablet_tool"}
static

Definition at line 4772 of file GHOST_SystemWayland.cc.

◆ LOG_WL_TOUCH

CLG_LogRef LOG_WL_TOUCH = {"ghost.wl.handle.touch"}
static

Definition at line 4560 of file GHOST_SystemWayland.cc.

◆ LOG_WL_XDG_OUTPUT

CLG_LogRef LOG_WL_XDG_OUTPUT = {"ghost.wl.handle.xdg_output"}
static

Definition at line 6427 of file GHOST_SystemWayland.cc.

◆ LOG_WL_XDG_WM_BASE

CLG_LogRef LOG_WL_XDG_WM_BASE = {"ghost.wl.handle.xdg_wm_base"}
static

Definition at line 6637 of file GHOST_SystemWayland.cc.

◆ output_listener

const wl_output_listener output_listener
static
Initial value:
= {
}
static void output_handle_geometry(void *data, wl_output *, const int32_t, const int32_t, const int32_t physical_width, const int32_t physical_height, const int32_t, const char *make, const char *model, const int32_t transform)
static void output_handle_done(void *data, wl_output *wl_output)
static void output_handle_scale(void *data, wl_output *, const int32_t factor)
static void output_handle_mode(void *data, wl_output *, const uint32_t flags, const int32_t width, const int32_t height, const int32_t)
static void output_handle_description(void *, wl_output *, const char *description)
static void output_handle_name(void *, wl_output *, const char *name)

Definition at line 6620 of file GHOST_SystemWayland.cc.

Referenced by gwl_registry_wl_output_add().

◆ pointer_listener

const wl_pointer_listener pointer_listener
static
Initial value:
= {
}
static void pointer_handle_frame(void *data, wl_pointer *)
static void pointer_handle_axis(void *data, wl_pointer *, const uint32_t time, const uint32_t axis, const wl_fixed_t value)
static void pointer_handle_axis_discrete(void *data, wl_pointer *, const uint32_t axis, const int32_t discrete)
static void pointer_handle_button(void *data, wl_pointer *, const uint32_t serial, const uint32_t time, const uint32_t button, const uint32_t state)
static void pointer_handle_enter(void *data, wl_pointer *, const uint32_t serial, wl_surface *wl_surface, const wl_fixed_t surface_x, const wl_fixed_t surface_y)
static void pointer_handle_motion(void *data, wl_pointer *, const uint32_t time, const wl_fixed_t surface_x, const wl_fixed_t surface_y)
static void pointer_handle_axis_source(void *data, wl_pointer *, const uint32_t axis_source)
static void pointer_handle_leave(void *data, wl_pointer *, const uint32_t, wl_surface *wl_surface)
static void pointer_handle_axis_stop(void *data, wl_pointer *, const uint32_t time, const uint32_t axis)
static void pointer_handle_axis_value120(void *data, wl_pointer *, const uint32_t axis, const int32_t value120)

Definition at line 4287 of file GHOST_SystemWayland.cc.

Referenced by gwl_seat_capability_pointer_enable().

◆ primary_selection_device_listener

const zwp_primary_selection_device_v1_listener primary_selection_device_listener
static
Initial value:
= {
}
static void primary_selection_device_handle_selection(void *data, zwp_primary_selection_device_v1 *, zwp_primary_selection_offer_v1 *id)
static void primary_selection_device_handle_data_offer(void *, zwp_primary_selection_device_v1 *, zwp_primary_selection_offer_v1 *id)

Definition at line 5867 of file GHOST_SystemWayland.cc.

Referenced by gwl_registry_wl_seat_update().

◆ primary_selection_offer_listener

const zwp_primary_selection_offer_v1_listener primary_selection_offer_listener
static
Initial value:
= {
}
static void primary_selection_offer_offer(void *data, zwp_primary_selection_offer_v1 *id, const char *type)

Definition at line 5815 of file GHOST_SystemWayland.cc.

Referenced by primary_selection_device_handle_data_offer().

◆ primary_selection_source_listener

const zwp_primary_selection_source_v1_listener primary_selection_source_listener
static
Initial value:
= {
}
static void primary_selection_source_send(void *data, zwp_primary_selection_source_v1 *, const char *, const int32_t fd)
static void primary_selection_source_cancelled(void *data, zwp_primary_selection_source_v1 *source)

Definition at line 5919 of file GHOST_SystemWayland.cc.

Referenced by system_clipboard_put_primary_selection().

◆ registry_listener

const wl_registry_listener registry_listener
static
Initial value:
= {
}
static void global_handle_add(void *data, wl_registry *wl_registry, const uint32_t name, const char *interface, const uint32_t version)
static void global_handle_remove(void *data, wl_registry *wl_registry, const uint32_t name)

Definition at line 7537 of file GHOST_SystemWayland.cc.

Referenced by GHOST_SystemWayland::GHOST_SystemWayland().

◆ relative_pointer_listener

const zwp_relative_pointer_v1_listener relative_pointer_listener
static
Initial value:
= {
}
static void relative_pointer_handle_relative_motion(void *data, zwp_relative_pointer_v1 *, const uint32_t utime_hi, const uint32_t utime_lo, const wl_fixed_t dx, const wl_fixed_t dy, const wl_fixed_t, const wl_fixed_t)

Definition at line 3227 of file GHOST_SystemWayland.cc.

Referenced by GHOST_SystemWayland::window_cursor_grab_set().

◆ seat_listener

const wl_seat_listener seat_listener
static
Initial value:
= {
}
static void seat_handle_capabilities(void *data, wl_seat *wl_seat, const uint32_t capabilities)
static void seat_handle_name(void *data, wl_seat *, const char *name)

Definition at line 6414 of file GHOST_SystemWayland.cc.

Referenced by gwl_registry_wl_seat_add().

◆ shell_listener

const xdg_wm_base_listener shell_listener
static
Initial value:
= {
}
static void shell_handle_ping(void *, xdg_wm_base *xdg_wm_base, const uint32_t serial)

Definition at line 6646 of file GHOST_SystemWayland.cc.

Referenced by gwl_registry_xdg_wm_base_add().

◆ smooth_as_discrete_steps

int smooth_as_discrete_steps = 2400
staticconstexpr

Number of smooth steps for a discrete step (matches X11 for touch-pads).

Definition at line 831 of file GHOST_SystemWayland.cc.

Referenced by pointer_handle_frame().

◆ tablet_seat_listener

const zwp_tablet_seat_v2_listener tablet_seat_listener
static
Initial value:
= {
}
static void tablet_seat_handle_tool_added(void *data, zwp_tablet_seat_v2 *, zwp_tablet_tool_v2 *id)
static void tablet_seat_handle_tablet_added(void *, zwp_tablet_seat_v2 *, zwp_tablet_v2 *id)
static void tablet_seat_handle_pad_added(void *, zwp_tablet_seat_v2 *, zwp_tablet_pad_v2 *id)

Definition at line 5198 of file GHOST_SystemWayland.cc.

Referenced by gwl_registry_wl_seat_update().

◆ tablet_tool_listner

const zwp_tablet_tool_v2_listener tablet_tool_listner
static
Initial value:
= {
}
static void tablet_tool_handle_button(void *data, zwp_tablet_tool_v2 *, const uint32_t serial, const uint32_t button, const uint32_t state)
static void tablet_tool_handle_distance(void *, zwp_tablet_tool_v2 *, const uint32_t distance)
static void tablet_tool_handle_type(void *data, zwp_tablet_tool_v2 *, const uint32_t tool_type)
static void tablet_tool_handle_proximity_out(void *data, zwp_tablet_tool_v2 *)
static void tablet_tool_handle_done(void *, zwp_tablet_tool_v2 *)
static void tablet_tool_handle_frame(void *data, zwp_tablet_tool_v2 *, const uint32_t time)
static void tablet_tool_handle_hardware_id_wacom(void *, zwp_tablet_tool_v2 *, const uint32_t, const uint32_t)
static void tablet_tool_handle_motion(void *data, zwp_tablet_tool_v2 *, const wl_fixed_t x, const wl_fixed_t y)
static void tablet_tool_handle_hardware_serial(void *, zwp_tablet_tool_v2 *, const uint32_t, const uint32_t)
static void tablet_tool_handle_tilt(void *data, zwp_tablet_tool_v2 *, const wl_fixed_t tilt_x, const wl_fixed_t tilt_y)
static void tablet_tool_handle_removed(void *data, zwp_tablet_tool_v2 *zwp_tablet_tool_v2)
static void tablet_tool_handle_capability(void *, zwp_tablet_tool_v2 *, const uint32_t capability)
static void tablet_tool_handle_rotation(void *, zwp_tablet_tool_v2 *, const wl_fixed_t degrees)
static void tablet_tool_handle_proximity_in(void *data, zwp_tablet_tool_v2 *, const uint32_t serial, zwp_tablet_v2 *, wl_surface *wl_surface)
static void tablet_tool_handle_wheel(void *data, zwp_tablet_tool_v2 *, const wl_fixed_t, const int32_t clicks)
static void tablet_tool_handle_down(void *data, zwp_tablet_tool_v2 *, const uint32_t serial)
static void tablet_tool_handle_up(void *data, zwp_tablet_tool_v2 *)
static void tablet_tool_handle_slider(void *, zwp_tablet_tool_v2 *, const int32_t position)
static void tablet_tool_handle_pressure(void *data, zwp_tablet_tool_v2 *, const uint32_t pressure)

Definition at line 5129 of file GHOST_SystemWayland.cc.

Referenced by tablet_seat_handle_tool_added().

◆ touch_seat_listener

const wl_touch_listener touch_seat_listener
static
Initial value:
= {
}
static void touch_seat_handle_cancel(void *, wl_touch *)
static void touch_seat_handle_down(void *data, wl_touch *, const uint32_t serial, const uint32_t time, wl_surface *surface, const int32_t id, const wl_fixed_t x, const wl_fixed_t y)
static void touch_seat_handle_motion(void *data, wl_touch *, const uint32_t time, const int32_t id, const wl_fixed_t x, const wl_fixed_t y)
static void touch_seat_handle_up(void *data, wl_touch *, const uint32_t, const uint32_t time, const int32_t id)
static void touch_seat_handle_frame(void *data, wl_touch *)
static void touch_seat_handle_shape(void *, wl_touch *, const int32_t, const wl_fixed_t, const wl_fixed_t)
static void touch_seat_handle_orientation(void *, wl_touch *, const int32_t, const wl_fixed_t)

Definition at line 4754 of file GHOST_SystemWayland.cc.

Referenced by gwl_seat_capability_touch_enable().

◆ use_gnome_confine_hack

bool use_gnome_confine_hack = false
static

Always use software confine (not just in GNOME). Useful for developing with compositors that don't need this workaround.

Definition at line 179 of file GHOST_SystemWayland.cc.

Referenced by setCursorGrab_use_software_confine(), and xdg_output_handle_logical_size().

◆ xdg_output_listener

const zxdg_output_v1_listener xdg_output_listener
static
Initial value:
= {
}
static void xdg_output_handle_name(void *, zxdg_output_v1 *, const char *name)
static void xdg_output_handle_description(void *, zxdg_output_v1 *, const char *description)
static void xdg_output_handle_logical_position(void *data, zxdg_output_v1 *, const int32_t x, const int32_t y)
static void xdg_output_handle_logical_size(void *data, zxdg_output_v1 *, const int32_t width, const int32_t height)
static void xdg_output_handle_done(void *data, zxdg_output_v1 *)

Definition at line 6503 of file GHOST_SystemWayland.cc.

Referenced by gwl_registry_wl_output_update().