|
|
|
|
@@ -103,9 +103,9 @@ static bool has_libdecor = true;
|
|
|
|
|
/** \name Forward Declarations
|
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
|
static void keyboard_handle_key_repeat_cancel(struct GWL_Seat *seat);
|
|
|
|
|
static void keyboard_handle_key_repeat_cancel(GWL_Seat *seat);
|
|
|
|
|
|
|
|
|
|
static void output_handle_done(void *data, struct wl_output *wl_output);
|
|
|
|
|
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);
|
|
|
|
|
@@ -119,14 +119,12 @@ static void gwl_registry_entry_remove_all(GWL_Display *display);
|
|
|
|
|
struct GWL_RegistryHandler;
|
|
|
|
|
static int gwl_registry_handler_interface_slot_max();
|
|
|
|
|
static int gwl_registry_handler_interface_slot_from_string(const char *interface);
|
|
|
|
|
static const struct GWL_RegistryHandler *gwl_registry_handler_from_interface_slot(
|
|
|
|
|
int interface_slot);
|
|
|
|
|
static const GWL_RegistryHandler *gwl_registry_handler_from_interface_slot(int interface_slot);
|
|
|
|
|
|
|
|
|
|
#ifdef USE_EVENT_BACKGROUND_THREAD
|
|
|
|
|
static void gwl_display_event_thread_destroy(GWL_Display *display);
|
|
|
|
|
|
|
|
|
|
static void ghost_wl_display_lock_without_input(struct wl_display *wl_display,
|
|
|
|
|
std::mutex *server_mutex);
|
|
|
|
|
static void ghost_wl_display_lock_without_input(wl_display *wl_display, std::mutex *server_mutex);
|
|
|
|
|
|
|
|
|
|
/** Default size for pending event vector. */
|
|
|
|
|
constexpr size_t events_pending_default_size = 4096 / sizeof(void *);
|
|
|
|
|
@@ -376,10 +374,10 @@ struct GWL_Cursor {
|
|
|
|
|
bool is_hardware = true;
|
|
|
|
|
/** When true, a custom image is used to display the cursor (stored in `wl_image`). */
|
|
|
|
|
bool is_custom = false;
|
|
|
|
|
struct wl_surface *wl_surface_cursor = nullptr;
|
|
|
|
|
wl_surface *wl_surface_cursor = nullptr;
|
|
|
|
|
struct wl_buffer *wl_buffer = nullptr;
|
|
|
|
|
struct wl_cursor_image wl_image = {0};
|
|
|
|
|
struct wl_cursor_theme *wl_theme = nullptr;
|
|
|
|
|
wl_cursor_image wl_image = {0};
|
|
|
|
|
wl_cursor_theme *wl_theme = nullptr;
|
|
|
|
|
void *custom_data = nullptr;
|
|
|
|
|
/** The size of `custom_data` in bytes. */
|
|
|
|
|
size_t custom_data_size = 0;
|
|
|
|
|
@@ -403,9 +401,9 @@ struct GWL_Cursor {
|
|
|
|
|
* Since are no API's to access properties of the tool, store the values here.
|
|
|
|
|
*/
|
|
|
|
|
struct GWL_TabletTool {
|
|
|
|
|
struct GWL_Seat *seat = nullptr;
|
|
|
|
|
GWL_Seat *seat = nullptr;
|
|
|
|
|
/** Tablets have a separate cursor to the 'pointer', this surface is used for cursor drawing. */
|
|
|
|
|
struct wl_surface *wl_surface_cursor = nullptr;
|
|
|
|
|
wl_surface *wl_surface_cursor = nullptr;
|
|
|
|
|
/** Used to delay clearing tablet focused wl_surface until the frame is handled. */
|
|
|
|
|
bool proximity = false;
|
|
|
|
|
|
|
|
|
|
@@ -422,7 +420,7 @@ struct GWL_TabletTool {
|
|
|
|
|
* Data storage used for clipboard paste & drag-and-drop.
|
|
|
|
|
*/
|
|
|
|
|
struct GWL_DataOffer {
|
|
|
|
|
struct wl_data_offer *id = nullptr;
|
|
|
|
|
wl_data_offer *id = nullptr;
|
|
|
|
|
std::unordered_set<std::string> types;
|
|
|
|
|
|
|
|
|
|
struct {
|
|
|
|
|
@@ -451,7 +449,7 @@ struct GWL_DataOffer {
|
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
|
struct GWL_DataSource {
|
|
|
|
|
struct wl_data_source *wl_source = nullptr;
|
|
|
|
|
wl_data_source *wl_source = nullptr;
|
|
|
|
|
GWL_SimpleBuffer buffer_out;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@@ -470,7 +468,7 @@ struct GWL_DataSource {
|
|
|
|
|
* Therefor keyboard events must always check the window has not been cleared.
|
|
|
|
|
*/
|
|
|
|
|
struct GWL_KeyRepeatPlayload {
|
|
|
|
|
struct GWL_Seat *seat = nullptr;
|
|
|
|
|
GWL_Seat *seat = nullptr;
|
|
|
|
|
|
|
|
|
|
xkb_keycode_t key_code;
|
|
|
|
|
|
|
|
|
|
@@ -520,7 +518,7 @@ struct GWL_SeatStatePointer {
|
|
|
|
|
* The wl_surface last used with this pointing device
|
|
|
|
|
* (events with this pointing device will be sent here).
|
|
|
|
|
*/
|
|
|
|
|
struct wl_surface *wl_surface_window = nullptr;
|
|
|
|
|
wl_surface *wl_surface_window = nullptr;
|
|
|
|
|
|
|
|
|
|
GHOST_Buttons buttons = GHOST_Buttons();
|
|
|
|
|
};
|
|
|
|
|
@@ -584,7 +582,7 @@ struct GWL_SeatStateKeyboard {
|
|
|
|
|
* The wl_surface last used with this pointing device
|
|
|
|
|
* (events with this pointing device will be sent here).
|
|
|
|
|
*/
|
|
|
|
|
struct wl_surface *wl_surface_window = nullptr;
|
|
|
|
|
wl_surface *wl_surface_window = nullptr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@@ -598,7 +596,7 @@ struct GWL_KeyboardDepressedState {
|
|
|
|
|
|
|
|
|
|
#ifdef WITH_GHOST_WAYLAND_LIBDECOR
|
|
|
|
|
struct GWL_LibDecor_System {
|
|
|
|
|
struct libdecor *context = nullptr;
|
|
|
|
|
libdecor *context = nullptr;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void gwl_libdecor_system_destroy(GWL_LibDecor_System *decor)
|
|
|
|
|
@@ -612,14 +610,14 @@ static void gwl_libdecor_system_destroy(GWL_LibDecor_System *decor)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
struct GWL_XDG_Decor_System {
|
|
|
|
|
struct xdg_wm_base *shell = nullptr;
|
|
|
|
|
xdg_wm_base *shell = nullptr;
|
|
|
|
|
uint32_t shell_name = WL_NAME_UNSET;
|
|
|
|
|
|
|
|
|
|
struct zxdg_decoration_manager_v1 *manager = nullptr;
|
|
|
|
|
zxdg_decoration_manager_v1 *manager = nullptr;
|
|
|
|
|
uint32_t manager_name = WL_NAME_UNSET;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static void gwl_xdg_decor_system_destroy(struct GWL_Display *display, GWL_XDG_Decor_System *decor)
|
|
|
|
|
static void gwl_xdg_decor_system_destroy(GWL_Display *display, GWL_XDG_Decor_System *decor)
|
|
|
|
|
{
|
|
|
|
|
if (decor->manager) {
|
|
|
|
|
gwl_registry_entry_remove_by_name(display, decor->manager_name, nullptr);
|
|
|
|
|
@@ -633,13 +631,13 @@ static void gwl_xdg_decor_system_destroy(struct GWL_Display *display, GWL_XDG_De
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct GWL_PrimarySelection_DataOffer {
|
|
|
|
|
struct zwp_primary_selection_offer_v1 *id = nullptr;
|
|
|
|
|
zwp_primary_selection_offer_v1 *id = nullptr;
|
|
|
|
|
|
|
|
|
|
std::unordered_set<std::string> types;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct GWL_PrimarySelection_DataSource {
|
|
|
|
|
struct zwp_primary_selection_source_v1 *wp_source = nullptr;
|
|
|
|
|
zwp_primary_selection_source_v1 *wp_source = nullptr;
|
|
|
|
|
GWL_SimpleBuffer buffer_out;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@@ -685,16 +683,16 @@ struct GWL_Seat {
|
|
|
|
|
struct wl_pointer *wl_pointer = nullptr;
|
|
|
|
|
struct wl_touch *wl_touch = nullptr;
|
|
|
|
|
struct wl_keyboard *wl_keyboard = nullptr;
|
|
|
|
|
struct zwp_tablet_seat_v2 *wp_tablet_seat = nullptr;
|
|
|
|
|
zwp_tablet_seat_v2 *wp_tablet_seat = nullptr;
|
|
|
|
|
|
|
|
|
|
#ifdef ZWP_POINTER_GESTURE_HOLD_V1_INTERFACE
|
|
|
|
|
struct zwp_pointer_gesture_hold_v1 *wp_pointer_gesture_hold = nullptr;
|
|
|
|
|
zwp_pointer_gesture_hold_v1 *wp_pointer_gesture_hold = nullptr;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZWP_POINTER_GESTURE_PINCH_V1_INTERFACE
|
|
|
|
|
struct zwp_pointer_gesture_pinch_v1 *wp_pointer_gesture_pinch = nullptr;
|
|
|
|
|
zwp_pointer_gesture_pinch_v1 *wp_pointer_gesture_pinch = nullptr;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZWP_POINTER_GESTURE_SWIPE_V1_INTERFACE
|
|
|
|
|
struct zwp_pointer_gesture_swipe_v1 *wp_pointer_gesture_swipe = nullptr;
|
|
|
|
|
zwp_pointer_gesture_swipe_v1 *wp_pointer_gesture_swipe = nullptr;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/** All currently active tablet tools (needed for changing the cursor). */
|
|
|
|
|
@@ -718,11 +716,11 @@ struct GWL_Seat {
|
|
|
|
|
/** The cursor location (in pixel-space) when hidden grab started (#GHOST_kGrabHide). */
|
|
|
|
|
wl_fixed_t grab_lock_xy[2] = {0, 0};
|
|
|
|
|
|
|
|
|
|
struct GWL_Cursor cursor;
|
|
|
|
|
GWL_Cursor cursor;
|
|
|
|
|
|
|
|
|
|
struct zwp_relative_pointer_v1 *wp_relative_pointer = nullptr;
|
|
|
|
|
struct zwp_locked_pointer_v1 *wp_locked_pointer = nullptr;
|
|
|
|
|
struct zwp_confined_pointer_v1 *wp_confined_pointer = nullptr;
|
|
|
|
|
zwp_relative_pointer_v1 *wp_relative_pointer = nullptr;
|
|
|
|
|
zwp_locked_pointer_v1 *wp_locked_pointer = nullptr;
|
|
|
|
|
zwp_confined_pointer_v1 *wp_confined_pointer = nullptr;
|
|
|
|
|
|
|
|
|
|
struct xkb_context *xkb_context = nullptr;
|
|
|
|
|
|
|
|
|
|
@@ -748,7 +746,7 @@ struct GWL_Seat {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/** Keys held matching `xkb_state`. */
|
|
|
|
|
struct GWL_KeyboardDepressedState key_depressed;
|
|
|
|
|
GWL_KeyboardDepressedState key_depressed;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Cache result of `xkb_keymap_mod_get_index`
|
|
|
|
|
@@ -771,22 +769,22 @@ struct GWL_Seat {
|
|
|
|
|
GHOST_ITimerTask *timer = nullptr;
|
|
|
|
|
} key_repeat;
|
|
|
|
|
|
|
|
|
|
struct wl_surface *wl_surface_window_focus_dnd = nullptr;
|
|
|
|
|
wl_surface *wl_surface_window_focus_dnd = nullptr;
|
|
|
|
|
|
|
|
|
|
struct wl_data_device *wl_data_device = nullptr;
|
|
|
|
|
/** Drag & Drop. */
|
|
|
|
|
struct GWL_DataOffer *data_offer_dnd = nullptr;
|
|
|
|
|
GWL_DataOffer *data_offer_dnd = nullptr;
|
|
|
|
|
std::mutex data_offer_dnd_mutex;
|
|
|
|
|
|
|
|
|
|
/** Copy & Paste. */
|
|
|
|
|
struct GWL_DataOffer *data_offer_copy_paste = nullptr;
|
|
|
|
|
GWL_DataOffer *data_offer_copy_paste = nullptr;
|
|
|
|
|
std::mutex data_offer_copy_paste_mutex;
|
|
|
|
|
|
|
|
|
|
struct GWL_DataSource *data_source = nullptr;
|
|
|
|
|
GWL_DataSource *data_source = nullptr;
|
|
|
|
|
std::mutex data_source_mutex;
|
|
|
|
|
|
|
|
|
|
struct zwp_primary_selection_device_v1 *wp_primary_selection_device = nullptr;
|
|
|
|
|
struct GWL_PrimarySelection primary_selection;
|
|
|
|
|
zwp_primary_selection_device_v1 *wp_primary_selection_device = nullptr;
|
|
|
|
|
GWL_PrimarySelection primary_selection;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Last input device that was active (pointer/tablet/keyboard).
|
|
|
|
|
@@ -875,7 +873,7 @@ struct GWL_Display {
|
|
|
|
|
bool registry_skip_update_all = false;
|
|
|
|
|
|
|
|
|
|
/** Registry entries, kept to allow updating & removal at run-time. */
|
|
|
|
|
struct GWL_RegistryEntry *registry_entry = nullptr;
|
|
|
|
|
GWL_RegistryEntry *registry_entry = nullptr;
|
|
|
|
|
|
|
|
|
|
struct wl_registry *wl_registry = nullptr;
|
|
|
|
|
struct wl_display *wl_display = nullptr;
|
|
|
|
|
@@ -887,7 +885,7 @@ struct GWL_Display {
|
|
|
|
|
#endif
|
|
|
|
|
GWL_XDG_Decor_System *xdg_decor = nullptr;
|
|
|
|
|
|
|
|
|
|
struct zxdg_output_manager_v1 *xdg_output_manager = nullptr;
|
|
|
|
|
zxdg_output_manager_v1 *xdg_output_manager = nullptr;
|
|
|
|
|
struct wl_shm *wl_shm = nullptr;
|
|
|
|
|
std::vector<GWL_Output *> outputs;
|
|
|
|
|
std::vector<GWL_Seat *> seats;
|
|
|
|
|
@@ -906,14 +904,14 @@ struct GWL_Display {
|
|
|
|
|
|
|
|
|
|
/* Managers. */
|
|
|
|
|
struct wl_data_device_manager *wl_data_device_manager = nullptr;
|
|
|
|
|
struct zwp_tablet_manager_v2 *wp_tablet_manager = nullptr;
|
|
|
|
|
struct zwp_relative_pointer_manager_v1 *wp_relative_pointer_manager = nullptr;
|
|
|
|
|
struct zwp_primary_selection_device_manager_v1 *wp_primary_selection_device_manager = nullptr;
|
|
|
|
|
struct xdg_activation_v1 *xdg_activation_manager = nullptr;
|
|
|
|
|
struct wp_fractional_scale_manager_v1 *wp_fractional_scale_manager = nullptr;
|
|
|
|
|
zwp_tablet_manager_v2 *wp_tablet_manager = nullptr;
|
|
|
|
|
zwp_relative_pointer_manager_v1 *wp_relative_pointer_manager = nullptr;
|
|
|
|
|
zwp_primary_selection_device_manager_v1 *wp_primary_selection_device_manager = nullptr;
|
|
|
|
|
xdg_activation_v1 *xdg_activation_manager = nullptr;
|
|
|
|
|
wp_fractional_scale_manager_v1 *wp_fractional_scale_manager = nullptr;
|
|
|
|
|
struct wp_viewporter *wp_viewporter = nullptr;
|
|
|
|
|
struct zwp_pointer_constraints_v1 *wp_pointer_constraints = nullptr;
|
|
|
|
|
struct zwp_pointer_gestures_v1 *wp_pointer_gestures = nullptr;
|
|
|
|
|
zwp_pointer_constraints_v1 *wp_pointer_constraints = nullptr;
|
|
|
|
|
zwp_pointer_gestures_v1 *wp_pointer_gestures = nullptr;
|
|
|
|
|
|
|
|
|
|
/* Threaded event handling. */
|
|
|
|
|
#ifdef USE_EVENT_BACKGROUND_THREAD
|
|
|
|
|
@@ -1295,7 +1293,7 @@ static void gwl_registry_entry_update_all(GWL_Display *display, const int interf
|
|
|
|
|
/** \name Private Utility Functions
|
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
|
static void ghost_wl_display_report_error(struct wl_display *display)
|
|
|
|
|
static void ghost_wl_display_report_error(wl_display *display)
|
|
|
|
|
{
|
|
|
|
|
int ecode = wl_display_get_error(display);
|
|
|
|
|
GHOST_ASSERT(ecode, "Error not set!");
|
|
|
|
|
@@ -1638,7 +1636,7 @@ static int file_descriptor_is_io_ready(int fd, const int flags, const int timeou
|
|
|
|
|
/* Note: We don't bother to account for elapsed time if we get EINTR */
|
|
|
|
|
do {
|
|
|
|
|
#ifdef HAVE_POLL
|
|
|
|
|
struct pollfd info;
|
|
|
|
|
pollfd info;
|
|
|
|
|
|
|
|
|
|
info.fd = fd;
|
|
|
|
|
info.events = 0;
|
|
|
|
|
@@ -1681,7 +1679,7 @@ static int file_descriptor_is_io_ready(int fd, const int flags, const int timeou
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int ghost_wl_display_event_pump(struct wl_display *wl_display)
|
|
|
|
|
static int ghost_wl_display_event_pump(wl_display *wl_display)
|
|
|
|
|
{
|
|
|
|
|
/* Based on SDL's `Wayland_PumpEvents`. */
|
|
|
|
|
int err;
|
|
|
|
|
@@ -1709,8 +1707,7 @@ static int ghost_wl_display_event_pump(struct wl_display *wl_display)
|
|
|
|
|
|
|
|
|
|
#ifdef USE_EVENT_BACKGROUND_THREAD
|
|
|
|
|
|
|
|
|
|
static void ghost_wl_display_lock_without_input(struct wl_display *wl_display,
|
|
|
|
|
std::mutex *server_mutex)
|
|
|
|
|
static void ghost_wl_display_lock_without_input(wl_display *wl_display, std::mutex *server_mutex)
|
|
|
|
|
{
|
|
|
|
|
const int fd = wl_display_get_fd(wl_display);
|
|
|
|
|
int state;
|
|
|
|
|
@@ -1727,7 +1724,7 @@ static void ghost_wl_display_lock_without_input(struct wl_display *wl_display,
|
|
|
|
|
} while (state == 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static int ghost_wl_display_event_pump_from_thread(struct wl_display *wl_display,
|
|
|
|
|
static int ghost_wl_display_event_pump_from_thread(wl_display *wl_display,
|
|
|
|
|
const int fd,
|
|
|
|
|
std::mutex *server_mutex)
|
|
|
|
|
{
|
|
|
|
|
@@ -1794,7 +1791,7 @@ static size_t ghost_wl_shm_format_as_size(enum wl_shm_format format)
|
|
|
|
|
* \param r_buffer_data: The buffer to be filled.
|
|
|
|
|
* \param r_buffer_data_size: The size of `r_buffer_data` in bytes.
|
|
|
|
|
*/
|
|
|
|
|
static wl_buffer *ghost_wl_buffer_create_for_image(struct wl_shm *shm,
|
|
|
|
|
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,
|
|
|
|
|
@@ -1808,7 +1805,7 @@ static wl_buffer *ghost_wl_buffer_create_for_image(struct wl_shm *shm,
|
|
|
|
|
if (posix_fallocate(fd, 0, buffer_size) == 0) {
|
|
|
|
|
void *buffer_data = mmap(nullptr, buffer_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
|
|
|
|
if (buffer_data != MAP_FAILED) {
|
|
|
|
|
struct wl_shm_pool *pool = wl_shm_create_pool(shm, fd, buffer_size);
|
|
|
|
|
wl_shm_pool *pool = wl_shm_create_pool(shm, fd, buffer_size);
|
|
|
|
|
buffer = wl_shm_pool_create_buffer(pool, 0, UNPACK2(size_xy), buffer_stride, format);
|
|
|
|
|
wl_shm_pool_destroy(pool);
|
|
|
|
|
if (buffer) {
|
|
|
|
|
@@ -1944,7 +1941,7 @@ static void relative_pointer_handle_relative_motion_impl(GWL_Seat *seat,
|
|
|
|
|
|
|
|
|
|
static void relative_pointer_handle_relative_motion(
|
|
|
|
|
void *data,
|
|
|
|
|
struct zwp_relative_pointer_v1 * /*zwp_relative_pointer_v1*/,
|
|
|
|
|
zwp_relative_pointer_v1 * /*zwp_relative_pointer_v1*/,
|
|
|
|
|
const uint32_t /*utime_hi*/,
|
|
|
|
|
const uint32_t /*utime_lo*/,
|
|
|
|
|
const wl_fixed_t dx,
|
|
|
|
|
@@ -2142,14 +2139,14 @@ static char *read_buffer_from_primary_selection_offer(GWL_PrimarySelection_DataO
|
|
|
|
|
* a target does not accept any of the offered types, type is nullptr.
|
|
|
|
|
*/
|
|
|
|
|
static void data_source_handle_target(void * /*data*/,
|
|
|
|
|
struct wl_data_source * /*wl_data_source*/,
|
|
|
|
|
wl_data_source * /*wl_data_source*/,
|
|
|
|
|
const char * /*mime_type*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "target");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void data_source_handle_send(void *data,
|
|
|
|
|
struct wl_data_source * /*wl_data_source*/,
|
|
|
|
|
wl_data_source * /*wl_data_source*/,
|
|
|
|
|
const char * /*mime_type*/,
|
|
|
|
|
const int32_t fd)
|
|
|
|
|
{
|
|
|
|
|
@@ -2173,7 +2170,7 @@ static void data_source_handle_send(void *data,
|
|
|
|
|
write_thread.detach();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void data_source_handle_cancelled(void *data, struct wl_data_source *wl_data_source)
|
|
|
|
|
static void data_source_handle_cancelled(void *data, wl_data_source *wl_data_source)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "cancelled");
|
|
|
|
|
GWL_Seat *seat = static_cast<GWL_Seat *>(data);
|
|
|
|
|
@@ -2193,7 +2190,7 @@ static void data_source_handle_cancelled(void *data, struct wl_data_source *wl_d
|
|
|
|
|
* emitted afterwards if the drop destination does not accept any mime type.
|
|
|
|
|
*/
|
|
|
|
|
static void data_source_handle_dnd_drop_performed(void * /*data*/,
|
|
|
|
|
struct wl_data_source * /*wl_data_source*/)
|
|
|
|
|
wl_data_source * /*wl_data_source*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "dnd_drop_performed");
|
|
|
|
|
}
|
|
|
|
|
@@ -2205,8 +2202,7 @@ static void data_source_handle_dnd_drop_performed(void * /*data*/,
|
|
|
|
|
* source, so the client is now free to destroy this data source
|
|
|
|
|
* and free all associated data.
|
|
|
|
|
*/
|
|
|
|
|
static void data_source_handle_dnd_finished(void * /*data*/,
|
|
|
|
|
struct wl_data_source * /*wl_data_source*/)
|
|
|
|
|
static void data_source_handle_dnd_finished(void * /*data*/, wl_data_source * /*wl_data_source*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "dnd_finished");
|
|
|
|
|
}
|
|
|
|
|
@@ -2219,7 +2215,7 @@ static void data_source_handle_dnd_finished(void * /*data*/,
|
|
|
|
|
* action (or none) will be offered here.
|
|
|
|
|
*/
|
|
|
|
|
static void data_source_handle_action(void * /*data*/,
|
|
|
|
|
struct wl_data_source * /*wl_data_source*/,
|
|
|
|
|
wl_data_source * /*wl_data_source*/,
|
|
|
|
|
const uint32_t dnd_action)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "handle_action (dnd_action=%u)", dnd_action);
|
|
|
|
|
@@ -2246,7 +2242,7 @@ static CLG_LogRef LOG_WL_DATA_OFFER = {"ghost.wl.handle.data_offer"};
|
|
|
|
|
#define LOG (&LOG_WL_DATA_OFFER)
|
|
|
|
|
|
|
|
|
|
static void data_offer_handle_offer(void *data,
|
|
|
|
|
struct wl_data_offer * /*wl_data_offer*/,
|
|
|
|
|
wl_data_offer * /*wl_data_offer*/,
|
|
|
|
|
const char *mime_type)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "offer (mime_type=%s)", mime_type);
|
|
|
|
|
@@ -2255,7 +2251,7 @@ static void data_offer_handle_offer(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void data_offer_handle_source_actions(void *data,
|
|
|
|
|
struct wl_data_offer * /*wl_data_offer*/,
|
|
|
|
|
wl_data_offer * /*wl_data_offer*/,
|
|
|
|
|
const uint32_t source_actions)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "source_actions (%u)", source_actions);
|
|
|
|
|
@@ -2264,7 +2260,7 @@ static void data_offer_handle_source_actions(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void data_offer_handle_action(void *data,
|
|
|
|
|
struct wl_data_offer * /*wl_data_offer*/,
|
|
|
|
|
wl_data_offer * /*wl_data_offer*/,
|
|
|
|
|
const uint32_t dnd_action)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "actions (%u)", dnd_action);
|
|
|
|
|
@@ -2290,8 +2286,8 @@ static CLG_LogRef LOG_WL_DATA_DEVICE = {"ghost.wl.handle.data_device"};
|
|
|
|
|
#define LOG (&LOG_WL_DATA_DEVICE)
|
|
|
|
|
|
|
|
|
|
static void data_device_handle_data_offer(void * /*data*/,
|
|
|
|
|
struct wl_data_device * /*wl_data_device*/,
|
|
|
|
|
struct wl_data_offer *id)
|
|
|
|
|
wl_data_device * /*wl_data_device*/,
|
|
|
|
|
wl_data_offer *id)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "data_offer");
|
|
|
|
|
|
|
|
|
|
@@ -2301,12 +2297,12 @@ static void data_device_handle_data_offer(void * /*data*/,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void data_device_handle_enter(void *data,
|
|
|
|
|
struct wl_data_device * /*wl_data_device*/,
|
|
|
|
|
wl_data_device * /*wl_data_device*/,
|
|
|
|
|
const uint32_t serial,
|
|
|
|
|
struct wl_surface *wl_surface,
|
|
|
|
|
wl_surface *wl_surface,
|
|
|
|
|
const wl_fixed_t x,
|
|
|
|
|
const wl_fixed_t y,
|
|
|
|
|
struct wl_data_offer *id)
|
|
|
|
|
wl_data_offer *id)
|
|
|
|
|
{
|
|
|
|
|
if (!ghost_wl_surface_own_with_null_check(wl_surface)) {
|
|
|
|
|
CLOG_INFO(LOG, 2, "enter (skipped)");
|
|
|
|
|
@@ -2342,7 +2338,7 @@ static void data_device_handle_enter(void *data,
|
|
|
|
|
dnd_events(seat, GHOST_kEventDraggingEntered);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void data_device_handle_leave(void *data, struct wl_data_device * /*wl_data_device*/)
|
|
|
|
|
static void data_device_handle_leave(void *data, wl_data_device * /*wl_data_device*/)
|
|
|
|
|
{
|
|
|
|
|
GWL_Seat *seat = static_cast<GWL_Seat *>(data);
|
|
|
|
|
std::lock_guard lock{seat->data_offer_dnd_mutex};
|
|
|
|
|
@@ -2360,7 +2356,7 @@ static void data_device_handle_leave(void *data, struct wl_data_device * /*wl_da
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void data_device_handle_motion(void *data,
|
|
|
|
|
struct wl_data_device * /*wl_data_device*/,
|
|
|
|
|
wl_data_device * /*wl_data_device*/,
|
|
|
|
|
const uint32_t /*time*/,
|
|
|
|
|
const wl_fixed_t x,
|
|
|
|
|
const wl_fixed_t y)
|
|
|
|
|
@@ -2376,7 +2372,7 @@ static void data_device_handle_motion(void *data,
|
|
|
|
|
dnd_events(seat, GHOST_kEventDraggingUpdated);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void data_device_handle_drop(void *data, struct wl_data_device * /*wl_data_device*/)
|
|
|
|
|
static void data_device_handle_drop(void *data, wl_data_device * /*wl_data_device*/)
|
|
|
|
|
{
|
|
|
|
|
GWL_Seat *seat = static_cast<GWL_Seat *>(data);
|
|
|
|
|
std::lock_guard lock{seat->data_offer_dnd_mutex};
|
|
|
|
|
@@ -2484,8 +2480,8 @@ static void data_device_handle_drop(void *data, struct wl_data_device * /*wl_dat
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void data_device_handle_selection(void *data,
|
|
|
|
|
struct wl_data_device * /*wl_data_device*/,
|
|
|
|
|
struct wl_data_offer *id)
|
|
|
|
|
wl_data_device * /*wl_data_device*/,
|
|
|
|
|
wl_data_offer *id)
|
|
|
|
|
{
|
|
|
|
|
GWL_Seat *seat = static_cast<GWL_Seat *>(data);
|
|
|
|
|
|
|
|
|
|
@@ -2531,7 +2527,7 @@ static const wl_data_device_listener data_device_listener = {
|
|
|
|
|
static CLG_LogRef LOG_WL_CURSOR_BUFFER = {"ghost.wl.handle.cursor_buffer"};
|
|
|
|
|
#define LOG (&LOG_WL_CURSOR_BUFFER)
|
|
|
|
|
|
|
|
|
|
static void cursor_buffer_handle_release(void *data, struct wl_buffer *wl_buffer)
|
|
|
|
|
static void cursor_buffer_handle_release(void *data, wl_buffer *wl_buffer)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "release");
|
|
|
|
|
|
|
|
|
|
@@ -2584,9 +2580,7 @@ static bool update_cursor_scale(GWL_Cursor &cursor,
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void cursor_surface_handle_enter(void *data,
|
|
|
|
|
struct wl_surface *wl_surface,
|
|
|
|
|
struct wl_output *wl_output)
|
|
|
|
|
static void cursor_surface_handle_enter(void *data, wl_surface *wl_surface, wl_output *wl_output)
|
|
|
|
|
{
|
|
|
|
|
if (!ghost_wl_output_own(wl_output)) {
|
|
|
|
|
CLOG_INFO(LOG, 2, "handle_enter (skipped)");
|
|
|
|
|
@@ -2602,9 +2596,7 @@ static void cursor_surface_handle_enter(void *data,
|
|
|
|
|
update_cursor_scale(seat->cursor, seat->system->wl_shm(), seat_state_pointer, wl_surface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void cursor_surface_handle_leave(void *data,
|
|
|
|
|
struct wl_surface *wl_surface,
|
|
|
|
|
struct wl_output *wl_output)
|
|
|
|
|
static void cursor_surface_handle_leave(void *data, wl_surface *wl_surface, wl_output *wl_output)
|
|
|
|
|
{
|
|
|
|
|
if (!(wl_output && ghost_wl_output_own(wl_output))) {
|
|
|
|
|
CLOG_INFO(LOG, 2, "handle_leave (skipped)");
|
|
|
|
|
@@ -2637,9 +2629,9 @@ static CLG_LogRef LOG_WL_POINTER = {"ghost.wl.handle.pointer"};
|
|
|
|
|
#define LOG (&LOG_WL_POINTER)
|
|
|
|
|
|
|
|
|
|
static void pointer_handle_enter(void *data,
|
|
|
|
|
struct wl_pointer * /*wl_pointer*/,
|
|
|
|
|
wl_pointer * /*wl_pointer*/,
|
|
|
|
|
const uint32_t serial,
|
|
|
|
|
struct wl_surface *wl_surface,
|
|
|
|
|
wl_surface *wl_surface,
|
|
|
|
|
const wl_fixed_t surface_x,
|
|
|
|
|
const wl_fixed_t surface_y)
|
|
|
|
|
{
|
|
|
|
|
@@ -2677,9 +2669,9 @@ static void pointer_handle_enter(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void pointer_handle_leave(void *data,
|
|
|
|
|
struct wl_pointer * /*wl_pointer*/,
|
|
|
|
|
wl_pointer * /*wl_pointer*/,
|
|
|
|
|
const uint32_t /*serial*/,
|
|
|
|
|
struct wl_surface *wl_surface)
|
|
|
|
|
wl_surface *wl_surface)
|
|
|
|
|
{
|
|
|
|
|
/* First clear the `pointer.wl_surface`, since the window won't exist when closing the window. */
|
|
|
|
|
static_cast<GWL_Seat *>(data)->pointer.wl_surface_window = nullptr;
|
|
|
|
|
@@ -2691,7 +2683,7 @@ static void pointer_handle_leave(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void pointer_handle_motion(void *data,
|
|
|
|
|
struct wl_pointer * /*wl_pointer*/,
|
|
|
|
|
wl_pointer * /*wl_pointer*/,
|
|
|
|
|
const uint32_t /*time*/,
|
|
|
|
|
const wl_fixed_t surface_x,
|
|
|
|
|
const wl_fixed_t surface_y)
|
|
|
|
|
@@ -2716,7 +2708,7 @@ static void pointer_handle_motion(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void pointer_handle_button(void *data,
|
|
|
|
|
struct wl_pointer * /*wl_pointer*/,
|
|
|
|
|
wl_pointer * /*wl_pointer*/,
|
|
|
|
|
const uint32_t serial,
|
|
|
|
|
const uint32_t /*time*/,
|
|
|
|
|
const uint32_t button,
|
|
|
|
|
@@ -2771,7 +2763,7 @@ static void pointer_handle_button(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void pointer_handle_axis(void *data,
|
|
|
|
|
struct wl_pointer * /*wl_pointer*/,
|
|
|
|
|
wl_pointer * /*wl_pointer*/,
|
|
|
|
|
const uint32_t /*time*/,
|
|
|
|
|
const uint32_t axis,
|
|
|
|
|
const wl_fixed_t value)
|
|
|
|
|
@@ -2787,7 +2779,7 @@ static void pointer_handle_axis(void *data,
|
|
|
|
|
seat->pointer_scroll.smooth_xy[index] = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void pointer_handle_frame(void *data, struct wl_pointer * /*wl_pointer*/)
|
|
|
|
|
static void pointer_handle_frame(void *data, wl_pointer * /*wl_pointer*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "frame");
|
|
|
|
|
GWL_Seat *seat = static_cast<GWL_Seat *>(data);
|
|
|
|
|
@@ -2853,7 +2845,7 @@ static void pointer_handle_frame(void *data, struct wl_pointer * /*wl_pointer*/)
|
|
|
|
|
seat->pointer_scroll.inverted_xy[1] = false;
|
|
|
|
|
}
|
|
|
|
|
static void pointer_handle_axis_source(void *data,
|
|
|
|
|
struct wl_pointer * /*wl_pointer*/,
|
|
|
|
|
wl_pointer * /*wl_pointer*/,
|
|
|
|
|
uint32_t axis_source)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "axis_source (axis_source=%u)", axis_source);
|
|
|
|
|
@@ -2861,14 +2853,14 @@ static void pointer_handle_axis_source(void *data,
|
|
|
|
|
seat->pointer_scroll.axis_source = (enum wl_pointer_axis_source)axis_source;
|
|
|
|
|
}
|
|
|
|
|
static void pointer_handle_axis_stop(void * /*data*/,
|
|
|
|
|
struct wl_pointer * /*wl_pointer*/,
|
|
|
|
|
wl_pointer * /*wl_pointer*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
uint32_t axis)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "axis_stop (axis=%u)", axis);
|
|
|
|
|
}
|
|
|
|
|
static void pointer_handle_axis_discrete(void *data,
|
|
|
|
|
struct wl_pointer * /*wl_pointer*/,
|
|
|
|
|
wl_pointer * /*wl_pointer*/,
|
|
|
|
|
uint32_t axis,
|
|
|
|
|
int32_t discrete)
|
|
|
|
|
{
|
|
|
|
|
@@ -2883,7 +2875,7 @@ static void pointer_handle_axis_discrete(void *data,
|
|
|
|
|
seat->pointer_scroll.discrete_xy[index] = discrete;
|
|
|
|
|
}
|
|
|
|
|
static void pointer_handle_axis_value120(void * /*data*/,
|
|
|
|
|
struct wl_pointer * /*wl_pointer*/,
|
|
|
|
|
wl_pointer * /*wl_pointer*/,
|
|
|
|
|
uint32_t axis,
|
|
|
|
|
int32_t value120)
|
|
|
|
|
{
|
|
|
|
|
@@ -2893,7 +2885,7 @@ static void pointer_handle_axis_value120(void * /*data*/,
|
|
|
|
|
}
|
|
|
|
|
#ifdef WL_POINTER_AXIS_RELATIVE_DIRECTION_ENUM /* Requires WAYLAND 1.22 or newer. */
|
|
|
|
|
static void pointer_handle_axis_relative_direction(void *data,
|
|
|
|
|
struct wl_pointer * /*wl_pointer*/,
|
|
|
|
|
wl_pointer * /*wl_pointer*/,
|
|
|
|
|
uint32_t axis,
|
|
|
|
|
uint32_t direction)
|
|
|
|
|
{
|
|
|
|
|
@@ -2938,21 +2930,20 @@ static CLG_LogRef LOG_WL_POINTER_GESTURE_HOLD = {"ghost.wl.handle.pointer_gestur
|
|
|
|
|
|
|
|
|
|
static void gesture_hold_handle_begin(
|
|
|
|
|
void * /*data*/,
|
|
|
|
|
struct zwp_pointer_gesture_hold_v1 * /*zwp_pointer_gesture_hold_v1*/,
|
|
|
|
|
zwp_pointer_gesture_hold_v1 * /*zwp_pointer_gesture_hold_v1*/,
|
|
|
|
|
uint32_t /*serial*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
struct wl_surface * /*surface*/,
|
|
|
|
|
wl_surface * /*surface*/,
|
|
|
|
|
uint32_t fingers)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "begin (fingers=%u)", fingers);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void gesture_hold_handle_end(
|
|
|
|
|
void * /*data*/,
|
|
|
|
|
struct zwp_pointer_gesture_hold_v1 * /*zwp_pointer_gesture_hold_v1*/,
|
|
|
|
|
uint32_t /*serial*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
int32_t cancelled)
|
|
|
|
|
static void gesture_hold_handle_end(void * /*data*/,
|
|
|
|
|
zwp_pointer_gesture_hold_v1 * /*zwp_pointer_gesture_hold_v1*/,
|
|
|
|
|
uint32_t /*serial*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
int32_t cancelled)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "end (cancelled=%i)", cancelled);
|
|
|
|
|
}
|
|
|
|
|
@@ -2976,10 +2967,10 @@ static CLG_LogRef LOG_WL_POINTER_GESTURE_PINCH = {"ghost.wl.handle.pointer_gestu
|
|
|
|
|
# define LOG (&LOG_WL_POINTER_GESTURE_PINCH)
|
|
|
|
|
|
|
|
|
|
static void gesture_pinch_handle_begin(void *data,
|
|
|
|
|
struct zwp_pointer_gesture_pinch_v1 * /*pinch*/,
|
|
|
|
|
zwp_pointer_gesture_pinch_v1 * /*pinch*/,
|
|
|
|
|
uint32_t /*serial*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
struct wl_surface * /*surface*/,
|
|
|
|
|
wl_surface * /*surface*/,
|
|
|
|
|
uint32_t fingers)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "begin (fingers=%u)", fingers);
|
|
|
|
|
@@ -3021,7 +3012,7 @@ static void gesture_pinch_handle_begin(void *data,
|
|
|
|
|
* however as the operators are not even using coordinates compatible with each other,
|
|
|
|
|
* it would be better to resolve this by passing rotation & zoom levels directly,
|
|
|
|
|
* instead of attempting to handle them as cursor coordinates. */
|
|
|
|
|
const struct GWL_WindowScaleParams &scale_params = win->scale_params();
|
|
|
|
|
const GWL_WindowScaleParams &scale_params = win->scale_params();
|
|
|
|
|
seat->pointer_gesture_pinch.scale.factor = gwl_window_scale_int_to(
|
|
|
|
|
scale_params, seat->pointer_gesture_pinch.scale.factor);
|
|
|
|
|
seat->pointer_gesture_pinch.rotation.factor = gwl_window_scale_int_to(
|
|
|
|
|
@@ -3030,7 +3021,7 @@ static void gesture_pinch_handle_begin(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void gesture_pinch_handle_update(void *data,
|
|
|
|
|
struct zwp_pointer_gesture_pinch_v1 * /*pinch*/,
|
|
|
|
|
zwp_pointer_gesture_pinch_v1 * /*pinch*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
wl_fixed_t dx,
|
|
|
|
|
wl_fixed_t dy,
|
|
|
|
|
@@ -3092,7 +3083,7 @@ static void gesture_pinch_handle_update(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void gesture_pinch_handle_end(void * /*data*/,
|
|
|
|
|
struct zwp_pointer_gesture_pinch_v1 * /*pinch*/,
|
|
|
|
|
zwp_pointer_gesture_pinch_v1 * /*pinch*/,
|
|
|
|
|
uint32_t /*serial*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
int32_t cancelled)
|
|
|
|
|
@@ -3126,10 +3117,10 @@ static CLG_LogRef LOG_WL_POINTER_GESTURE_SWIPE = {"ghost.wl.handle.pointer_gestu
|
|
|
|
|
|
|
|
|
|
static void gesture_swipe_handle_begin(
|
|
|
|
|
void * /*data*/,
|
|
|
|
|
struct zwp_pointer_gesture_swipe_v1 * /*zwp_pointer_gesture_swipe_v1*/,
|
|
|
|
|
zwp_pointer_gesture_swipe_v1 * /*zwp_pointer_gesture_swipe_v1*/,
|
|
|
|
|
uint32_t /*serial*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
struct wl_surface * /*surface*/,
|
|
|
|
|
wl_surface * /*surface*/,
|
|
|
|
|
uint32_t fingers)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "begin (fingers=%u)", fingers);
|
|
|
|
|
@@ -3137,7 +3128,7 @@ static void gesture_swipe_handle_begin(
|
|
|
|
|
|
|
|
|
|
static void gesture_swipe_handle_update(
|
|
|
|
|
void * /*data*/,
|
|
|
|
|
struct zwp_pointer_gesture_swipe_v1 * /*zwp_pointer_gesture_swipe_v1*/,
|
|
|
|
|
zwp_pointer_gesture_swipe_v1 * /*zwp_pointer_gesture_swipe_v1*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
wl_fixed_t dx,
|
|
|
|
|
wl_fixed_t dy)
|
|
|
|
|
@@ -3147,7 +3138,7 @@ static void gesture_swipe_handle_update(
|
|
|
|
|
|
|
|
|
|
static void gesture_swipe_handle_end(
|
|
|
|
|
void * /*data*/,
|
|
|
|
|
struct zwp_pointer_gesture_swipe_v1 * /*zwp_pointer_gesture_swipe_v1*/,
|
|
|
|
|
zwp_pointer_gesture_swipe_v1 * /*zwp_pointer_gesture_swipe_v1*/,
|
|
|
|
|
uint32_t /*serial*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
int32_t cancelled)
|
|
|
|
|
@@ -3178,10 +3169,10 @@ static CLG_LogRef LOG_WL_TOUCH = {"ghost.wl.handle.touch"};
|
|
|
|
|
#define LOG (&LOG_WL_TOUCH)
|
|
|
|
|
|
|
|
|
|
static void touch_seat_handle_down(void * /*data*/,
|
|
|
|
|
struct wl_touch * /*wl_touch*/,
|
|
|
|
|
wl_touch * /*wl_touch*/,
|
|
|
|
|
uint32_t /*serial*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
struct wl_surface * /*wl_surface*/,
|
|
|
|
|
wl_surface * /*wl_surface*/,
|
|
|
|
|
int32_t /*id*/,
|
|
|
|
|
wl_fixed_t /*x*/,
|
|
|
|
|
wl_fixed_t /*y*/)
|
|
|
|
|
@@ -3190,7 +3181,7 @@ static void touch_seat_handle_down(void * /*data*/,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void touch_seat_handle_up(void * /*data*/,
|
|
|
|
|
struct wl_touch * /*wl_touch*/,
|
|
|
|
|
wl_touch * /*wl_touch*/,
|
|
|
|
|
uint32_t /*serial*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
int32_t /*id*/)
|
|
|
|
|
@@ -3199,7 +3190,7 @@ static void touch_seat_handle_up(void * /*data*/,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void touch_seat_handle_motion(void * /*data*/,
|
|
|
|
|
struct wl_touch * /*wl_touch*/,
|
|
|
|
|
wl_touch * /*wl_touch*/,
|
|
|
|
|
uint32_t /*time*/,
|
|
|
|
|
int32_t /*id*/,
|
|
|
|
|
wl_fixed_t /*x*/,
|
|
|
|
|
@@ -3208,19 +3199,19 @@ static void touch_seat_handle_motion(void * /*data*/,
|
|
|
|
|
CLOG_INFO(LOG, 2, "motion");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void touch_seat_handle_frame(void * /*data*/, struct wl_touch * /*wl_touch*/)
|
|
|
|
|
static void touch_seat_handle_frame(void * /*data*/, wl_touch * /*wl_touch*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "frame");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void touch_seat_handle_cancel(void * /*data*/, struct wl_touch * /*wl_touch*/)
|
|
|
|
|
static void touch_seat_handle_cancel(void * /*data*/, wl_touch * /*wl_touch*/)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
CLOG_INFO(LOG, 2, "cancel");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void touch_seat_handle_shape(void * /*data*/,
|
|
|
|
|
struct wl_touch * /*touch*/,
|
|
|
|
|
wl_touch * /*touch*/,
|
|
|
|
|
int32_t /*id*/,
|
|
|
|
|
wl_fixed_t /*major*/,
|
|
|
|
|
wl_fixed_t /*minor*/)
|
|
|
|
|
@@ -3229,7 +3220,7 @@ static void touch_seat_handle_shape(void * /*data*/,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void touch_seat_handle_orientation(void * /*data*/,
|
|
|
|
|
struct wl_touch * /*touch*/,
|
|
|
|
|
wl_touch * /*touch*/,
|
|
|
|
|
int32_t /*id*/,
|
|
|
|
|
wl_fixed_t /*orientation*/)
|
|
|
|
|
{
|
|
|
|
|
@@ -3258,7 +3249,7 @@ static CLG_LogRef LOG_WL_TABLET_TOOL = {"ghost.wl.handle.tablet_tool"};
|
|
|
|
|
#define LOG (&LOG_WL_TABLET_TOOL)
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_type(void *data,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const uint32_t tool_type)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "type (type=%u)", tool_type);
|
|
|
|
|
@@ -3269,24 +3260,23 @@ static void tablet_tool_handle_type(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_hardware_serial(void * /*data*/,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const uint32_t /*hardware_serial_hi*/,
|
|
|
|
|
const uint32_t /*hardware_serial_lo*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "hardware_serial");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_hardware_id_wacom(
|
|
|
|
|
void * /*data*/,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const uint32_t /*hardware_id_hi*/,
|
|
|
|
|
const uint32_t /*hardware_id_lo*/)
|
|
|
|
|
static void tablet_tool_handle_hardware_id_wacom(void * /*data*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const uint32_t /*hardware_id_hi*/,
|
|
|
|
|
const uint32_t /*hardware_id_lo*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "hardware_id_wacom");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_capability(void * /*data*/,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const uint32_t capability)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG,
|
|
|
|
|
@@ -3299,12 +3289,11 @@ static void tablet_tool_handle_capability(void * /*data*/,
|
|
|
|
|
(capability & ZWP_TABLET_TOOL_V2_CAPABILITY_WHEEL) != 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_done(void * /*data*/,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/)
|
|
|
|
|
static void tablet_tool_handle_done(void * /*data*/, zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "done");
|
|
|
|
|
}
|
|
|
|
|
static void tablet_tool_handle_removed(void *data, struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2)
|
|
|
|
|
static void tablet_tool_handle_removed(void *data, zwp_tablet_tool_v2 *zwp_tablet_tool_v2)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "removed");
|
|
|
|
|
|
|
|
|
|
@@ -3319,10 +3308,10 @@ static void tablet_tool_handle_removed(void *data, struct zwp_tablet_tool_v2 *zw
|
|
|
|
|
delete tablet_tool;
|
|
|
|
|
}
|
|
|
|
|
static void tablet_tool_handle_proximity_in(void *data,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const uint32_t serial,
|
|
|
|
|
struct zwp_tablet_v2 * /*tablet*/,
|
|
|
|
|
struct wl_surface *wl_surface)
|
|
|
|
|
zwp_tablet_v2 * /*tablet*/,
|
|
|
|
|
wl_surface *wl_surface)
|
|
|
|
|
{
|
|
|
|
|
if (!ghost_wl_surface_own_with_null_check(wl_surface)) {
|
|
|
|
|
CLOG_INFO(LOG, 2, "proximity_in (skipped)");
|
|
|
|
|
@@ -3357,7 +3346,7 @@ static void tablet_tool_handle_proximity_in(void *data,
|
|
|
|
|
seat->system->cursor_shape_set(win->getCursorShape());
|
|
|
|
|
}
|
|
|
|
|
static void tablet_tool_handle_proximity_out(void *data,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/)
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "proximity_out");
|
|
|
|
|
GWL_TabletTool *tablet_tool = static_cast<GWL_TabletTool *>(data);
|
|
|
|
|
@@ -3367,7 +3356,7 @@ static void tablet_tool_handle_proximity_out(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_down(void *data,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const uint32_t serial)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "down");
|
|
|
|
|
@@ -3387,7 +3376,7 @@ static void tablet_tool_handle_down(void *data,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_up(void *data, struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/)
|
|
|
|
|
static void tablet_tool_handle_up(void *data, zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "up");
|
|
|
|
|
|
|
|
|
|
@@ -3406,7 +3395,7 @@ static void tablet_tool_handle_up(void *data, struct zwp_tablet_tool_v2 * /*zwp_
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_motion(void *data,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const wl_fixed_t x,
|
|
|
|
|
const wl_fixed_t y)
|
|
|
|
|
{
|
|
|
|
|
@@ -3422,7 +3411,7 @@ static void tablet_tool_handle_motion(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_pressure(void *data,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const uint32_t pressure)
|
|
|
|
|
{
|
|
|
|
|
const float pressure_unit = float(pressure) / 65535;
|
|
|
|
|
@@ -3433,14 +3422,14 @@ static void tablet_tool_handle_pressure(void *data,
|
|
|
|
|
td.Pressure = pressure_unit;
|
|
|
|
|
}
|
|
|
|
|
static void tablet_tool_handle_distance(void * /*data*/,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const uint32_t distance)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "distance (distance=%u)", distance);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_tilt(void *data,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const wl_fixed_t tilt_x,
|
|
|
|
|
const wl_fixed_t tilt_y)
|
|
|
|
|
{
|
|
|
|
|
@@ -3459,20 +3448,20 @@ static void tablet_tool_handle_tilt(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_rotation(void * /*data*/,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const wl_fixed_t degrees)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "rotation (degrees=%.4f)", wl_fixed_to_double(degrees));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_tool_handle_slider(void * /*data*/,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const int32_t position)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "slider (position=%d)", position);
|
|
|
|
|
}
|
|
|
|
|
static void tablet_tool_handle_wheel(void *data,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const wl_fixed_t /*degrees*/,
|
|
|
|
|
const int32_t clicks)
|
|
|
|
|
{
|
|
|
|
|
@@ -3490,7 +3479,7 @@ static void tablet_tool_handle_wheel(void *data,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
static void tablet_tool_handle_button(void *data,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const uint32_t serial,
|
|
|
|
|
const uint32_t button,
|
|
|
|
|
const uint32_t state)
|
|
|
|
|
@@ -3533,7 +3522,7 @@ static void tablet_tool_handle_button(void *data,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
static void tablet_tool_handle_frame(void *data,
|
|
|
|
|
struct zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 * /*zwp_tablet_tool_v2*/,
|
|
|
|
|
const uint32_t /*time*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "frame");
|
|
|
|
|
@@ -3594,15 +3583,15 @@ static CLG_LogRef LOG_WL_TABLET_SEAT = {"ghost.wl.handle.tablet_seat"};
|
|
|
|
|
#define LOG (&LOG_WL_TABLET_SEAT)
|
|
|
|
|
|
|
|
|
|
static void tablet_seat_handle_tablet_added(void * /*data*/,
|
|
|
|
|
struct zwp_tablet_seat_v2 * /*zwp_tablet_seat_v2*/,
|
|
|
|
|
struct zwp_tablet_v2 *id)
|
|
|
|
|
zwp_tablet_seat_v2 * /*zwp_tablet_seat_v2*/,
|
|
|
|
|
zwp_tablet_v2 *id)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "tablet_added (id=%p)", id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_seat_handle_tool_added(void *data,
|
|
|
|
|
struct zwp_tablet_seat_v2 * /*zwp_tablet_seat_v2*/,
|
|
|
|
|
struct zwp_tablet_tool_v2 *id)
|
|
|
|
|
zwp_tablet_seat_v2 * /*zwp_tablet_seat_v2*/,
|
|
|
|
|
zwp_tablet_tool_v2 *id)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "tool_added (id=%p)", id);
|
|
|
|
|
|
|
|
|
|
@@ -3622,8 +3611,8 @@ static void tablet_seat_handle_tool_added(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void tablet_seat_handle_pad_added(void * /*data*/,
|
|
|
|
|
struct zwp_tablet_seat_v2 * /*zwp_tablet_seat_v2*/,
|
|
|
|
|
struct zwp_tablet_pad_v2 *id)
|
|
|
|
|
zwp_tablet_seat_v2 * /*zwp_tablet_seat_v2*/,
|
|
|
|
|
zwp_tablet_pad_v2 *id)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "pad_added (id=%p)", id);
|
|
|
|
|
}
|
|
|
|
|
@@ -3646,7 +3635,7 @@ static CLG_LogRef LOG_WL_KEYBOARD = {"ghost.wl.handle.keyboard"};
|
|
|
|
|
#define LOG (&LOG_WL_KEYBOARD)
|
|
|
|
|
|
|
|
|
|
static void keyboard_handle_keymap(void *data,
|
|
|
|
|
struct wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
const uint32_t format,
|
|
|
|
|
const int32_t fd,
|
|
|
|
|
const uint32_t size)
|
|
|
|
|
@@ -3665,7 +3654,7 @@ static void keyboard_handle_keymap(void *data,
|
|
|
|
|
throw std::runtime_error("keymap mmap failed: " + std::string(std::strerror(errno)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct xkb_keymap *keymap = xkb_keymap_new_from_string(
|
|
|
|
|
xkb_keymap *keymap = xkb_keymap_new_from_string(
|
|
|
|
|
seat->xkb_context, map_str, XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
|
|
|
|
munmap(map_str, size);
|
|
|
|
|
close(fd);
|
|
|
|
|
@@ -3738,10 +3727,10 @@ static void keyboard_handle_keymap(void *data,
|
|
|
|
|
* Notification that this seat's keyboard focus is on a certain wl_surface.
|
|
|
|
|
*/
|
|
|
|
|
static void keyboard_handle_enter(void *data,
|
|
|
|
|
struct wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
const uint32_t serial,
|
|
|
|
|
struct wl_surface *wl_surface,
|
|
|
|
|
struct wl_array *keys)
|
|
|
|
|
wl_surface *wl_surface,
|
|
|
|
|
wl_array *keys)
|
|
|
|
|
{
|
|
|
|
|
/* Null when just destroyed. */
|
|
|
|
|
if (!ghost_wl_surface_own_with_null_check(wl_surface)) {
|
|
|
|
|
@@ -3782,9 +3771,9 @@ static void keyboard_handle_enter(void *data,
|
|
|
|
|
* Notification that this seat's keyboard focus is no longer on a certain wl_surface.
|
|
|
|
|
*/
|
|
|
|
|
static void keyboard_handle_leave(void *data,
|
|
|
|
|
struct wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
const uint32_t /*serial*/,
|
|
|
|
|
struct wl_surface *wl_surface)
|
|
|
|
|
wl_surface *wl_surface)
|
|
|
|
|
{
|
|
|
|
|
if (!ghost_wl_surface_own_with_null_check(wl_surface)) {
|
|
|
|
|
CLOG_INFO(LOG, 2, "leave (skipped)");
|
|
|
|
|
@@ -3811,9 +3800,9 @@ static void keyboard_handle_leave(void *data,
|
|
|
|
|
* Needed because #GHOST_TKey uses these values as key-codes.
|
|
|
|
|
*/
|
|
|
|
|
static xkb_keysym_t xkb_state_key_get_one_sym_without_modifiers(
|
|
|
|
|
struct xkb_state *xkb_state_empty,
|
|
|
|
|
struct xkb_state *xkb_state_empty_with_numlock,
|
|
|
|
|
struct xkb_state *xkb_state_empty_with_shift,
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
@@ -3886,7 +3875,7 @@ static void keyboard_handle_key_repeat_reset(GWL_Seat *seat, const bool use_dela
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void keyboard_handle_key(void *data,
|
|
|
|
|
struct wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
const uint32_t serial,
|
|
|
|
|
const uint32_t /*time*/,
|
|
|
|
|
const uint32_t key,
|
|
|
|
|
@@ -3926,7 +3915,7 @@ static void keyboard_handle_key(void *data,
|
|
|
|
|
std::lock_guard lock_timer_guard{*seat->system->timer_mutex};
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
struct GWL_KeyRepeatPlayload *key_repeat_payload = nullptr;
|
|
|
|
|
GWL_KeyRepeatPlayload *key_repeat_payload = nullptr;
|
|
|
|
|
|
|
|
|
|
/* Delete previous timer. */
|
|
|
|
|
if (seat->key_repeat.timer) {
|
|
|
|
|
@@ -4008,8 +3997,7 @@ static void keyboard_handle_key(void *data,
|
|
|
|
|
|
|
|
|
|
if (key_repeat_payload) {
|
|
|
|
|
auto key_repeat_fn = [](GHOST_ITimerTask *task, uint64_t /*time*/) {
|
|
|
|
|
struct GWL_KeyRepeatPlayload *payload = static_cast<GWL_KeyRepeatPlayload *>(
|
|
|
|
|
task->getUserData());
|
|
|
|
|
GWL_KeyRepeatPlayload *payload = static_cast<GWL_KeyRepeatPlayload *>(task->getUserData());
|
|
|
|
|
|
|
|
|
|
GWL_Seat *seat = payload->seat;
|
|
|
|
|
if (wl_surface *wl_surface_focus = seat->keyboard.wl_surface_window) {
|
|
|
|
|
@@ -4032,7 +4020,7 @@ static void keyboard_handle_key(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void keyboard_handle_modifiers(void *data,
|
|
|
|
|
struct wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
const uint32_t serial,
|
|
|
|
|
const uint32_t mods_depressed,
|
|
|
|
|
const uint32_t mods_latched,
|
|
|
|
|
@@ -4065,7 +4053,7 @@ static void keyboard_handle_modifiers(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void keyboard_handle_repeat_info(void *data,
|
|
|
|
|
struct wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
wl_keyboard * /*wl_keyboard*/,
|
|
|
|
|
const int32_t rate,
|
|
|
|
|
const int32_t delay)
|
|
|
|
|
{
|
|
|
|
|
@@ -4107,7 +4095,7 @@ static CLG_LogRef LOG_WL_PRIMARY_SELECTION_OFFER = {"ghost.wl.handle.primary_sel
|
|
|
|
|
#define LOG (&LOG_WL_PRIMARY_SELECTION_OFFER)
|
|
|
|
|
|
|
|
|
|
static void primary_selection_offer_offer(void *data,
|
|
|
|
|
struct zwp_primary_selection_offer_v1 *id,
|
|
|
|
|
zwp_primary_selection_offer_v1 *id,
|
|
|
|
|
const char *type)
|
|
|
|
|
{
|
|
|
|
|
GWL_PrimarySelection_DataOffer *data_offer = static_cast<GWL_PrimarySelection_DataOffer *>(data);
|
|
|
|
|
@@ -4136,8 +4124,8 @@ static CLG_LogRef LOG_WL_PRIMARY_SELECTION_DEVICE = {"ghost.wl.handle.primary_se
|
|
|
|
|
|
|
|
|
|
static void primary_selection_device_handle_data_offer(
|
|
|
|
|
void * /*data*/,
|
|
|
|
|
struct zwp_primary_selection_device_v1 * /*zwp_primary_selection_device_v1*/,
|
|
|
|
|
struct zwp_primary_selection_offer_v1 *id)
|
|
|
|
|
zwp_primary_selection_device_v1 * /*zwp_primary_selection_device_v1*/,
|
|
|
|
|
zwp_primary_selection_offer_v1 *id)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "data_offer");
|
|
|
|
|
|
|
|
|
|
@@ -4148,8 +4136,8 @@ static void primary_selection_device_handle_data_offer(
|
|
|
|
|
|
|
|
|
|
static void primary_selection_device_handle_selection(
|
|
|
|
|
void *data,
|
|
|
|
|
struct zwp_primary_selection_device_v1 * /*zwp_primary_selection_device_v1*/,
|
|
|
|
|
struct zwp_primary_selection_offer_v1 *id)
|
|
|
|
|
zwp_primary_selection_device_v1 * /*zwp_primary_selection_device_v1*/,
|
|
|
|
|
zwp_primary_selection_offer_v1 *id)
|
|
|
|
|
{
|
|
|
|
|
GWL_PrimarySelection *primary = static_cast<GWL_PrimarySelection *>(data);
|
|
|
|
|
|
|
|
|
|
@@ -4188,7 +4176,7 @@ static CLG_LogRef LOG_WL_PRIMARY_SELECTION_SOURCE = {"ghost.wl.handle.primary_se
|
|
|
|
|
#define LOG (&LOG_WL_PRIMARY_SELECTION_SOURCE)
|
|
|
|
|
|
|
|
|
|
static void primary_selection_source_send(void *data,
|
|
|
|
|
struct zwp_primary_selection_source_v1 * /*source*/,
|
|
|
|
|
zwp_primary_selection_source_v1 * /*source*/,
|
|
|
|
|
const char * /*mime_type*/,
|
|
|
|
|
int32_t fd)
|
|
|
|
|
{
|
|
|
|
|
@@ -4212,8 +4200,7 @@ static void primary_selection_source_send(void *data,
|
|
|
|
|
write_thread.detach();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void primary_selection_source_cancelled(void *data,
|
|
|
|
|
struct zwp_primary_selection_source_v1 *source)
|
|
|
|
|
static void primary_selection_source_cancelled(void *data, zwp_primary_selection_source_v1 *source)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "cancelled");
|
|
|
|
|
|
|
|
|
|
@@ -4280,7 +4267,7 @@ static void gwl_seat_capability_pointer_enable(GWL_Seat *seat)
|
|
|
|
|
if (pointer_gestures) {
|
|
|
|
|
#ifdef ZWP_POINTER_GESTURE_HOLD_V1_INTERFACE
|
|
|
|
|
{ /* Hold gesture. */
|
|
|
|
|
struct zwp_pointer_gesture_hold_v1 *gesture = zwp_pointer_gestures_v1_get_hold_gesture(
|
|
|
|
|
zwp_pointer_gesture_hold_v1 *gesture = zwp_pointer_gestures_v1_get_hold_gesture(
|
|
|
|
|
pointer_gestures, seat->wl_pointer);
|
|
|
|
|
zwp_pointer_gesture_hold_v1_set_user_data(gesture, seat);
|
|
|
|
|
zwp_pointer_gesture_hold_v1_add_listener(gesture, &gesture_hold_listener, seat);
|
|
|
|
|
@@ -4289,7 +4276,7 @@ static void gwl_seat_capability_pointer_enable(GWL_Seat *seat)
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZWP_POINTER_GESTURE_PINCH_V1_INTERFACE
|
|
|
|
|
{ /* Pinch gesture. */
|
|
|
|
|
struct zwp_pointer_gesture_pinch_v1 *gesture = zwp_pointer_gestures_v1_get_pinch_gesture(
|
|
|
|
|
zwp_pointer_gesture_pinch_v1 *gesture = zwp_pointer_gestures_v1_get_pinch_gesture(
|
|
|
|
|
pointer_gestures, seat->wl_pointer);
|
|
|
|
|
zwp_pointer_gesture_pinch_v1_set_user_data(gesture, seat);
|
|
|
|
|
zwp_pointer_gesture_pinch_v1_add_listener(gesture, &gesture_pinch_listener, seat);
|
|
|
|
|
@@ -4298,7 +4285,7 @@ static void gwl_seat_capability_pointer_enable(GWL_Seat *seat)
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZWP_POINTER_GESTURE_SWIPE_V1_INTERFACE
|
|
|
|
|
{ /* Swipe gesture. */
|
|
|
|
|
struct zwp_pointer_gesture_swipe_v1 *gesture = zwp_pointer_gestures_v1_get_swipe_gesture(
|
|
|
|
|
zwp_pointer_gesture_swipe_v1 *gesture = zwp_pointer_gestures_v1_get_swipe_gesture(
|
|
|
|
|
pointer_gestures, seat->wl_pointer);
|
|
|
|
|
zwp_pointer_gesture_swipe_v1_set_user_data(gesture, seat);
|
|
|
|
|
zwp_pointer_gesture_swipe_v1_add_listener(gesture, &gesture_swipe_listener, seat);
|
|
|
|
|
@@ -4318,7 +4305,7 @@ static void gwl_seat_capability_pointer_disable(GWL_Seat *seat)
|
|
|
|
|
if (pointer_gestures) {
|
|
|
|
|
#ifdef ZWP_POINTER_GESTURE_HOLD_V1_INTERFACE
|
|
|
|
|
{ /* Hold gesture. */
|
|
|
|
|
struct zwp_pointer_gesture_hold_v1 **gesture_p = &seat->wp_pointer_gesture_hold;
|
|
|
|
|
zwp_pointer_gesture_hold_v1 **gesture_p = &seat->wp_pointer_gesture_hold;
|
|
|
|
|
if (*gesture_p) {
|
|
|
|
|
zwp_pointer_gesture_hold_v1_destroy(*gesture_p);
|
|
|
|
|
*gesture_p = nullptr;
|
|
|
|
|
@@ -4327,7 +4314,7 @@ static void gwl_seat_capability_pointer_disable(GWL_Seat *seat)
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZWP_POINTER_GESTURE_PINCH_V1_INTERFACE
|
|
|
|
|
{ /* Pinch gesture. */
|
|
|
|
|
struct zwp_pointer_gesture_pinch_v1 **gesture_p = &seat->wp_pointer_gesture_pinch;
|
|
|
|
|
zwp_pointer_gesture_pinch_v1 **gesture_p = &seat->wp_pointer_gesture_pinch;
|
|
|
|
|
if (*gesture_p) {
|
|
|
|
|
zwp_pointer_gesture_pinch_v1_destroy(*gesture_p);
|
|
|
|
|
*gesture_p = nullptr;
|
|
|
|
|
@@ -4336,7 +4323,7 @@ static void gwl_seat_capability_pointer_disable(GWL_Seat *seat)
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef ZWP_POINTER_GESTURE_SWIPE_V1_INTERFACE
|
|
|
|
|
{ /* Swipe gesture. */
|
|
|
|
|
struct zwp_pointer_gesture_swipe_v1 **gesture_p = &seat->wp_pointer_gesture_swipe;
|
|
|
|
|
zwp_pointer_gesture_swipe_v1 **gesture_p = &seat->wp_pointer_gesture_swipe;
|
|
|
|
|
if (*gesture_p) {
|
|
|
|
|
zwp_pointer_gesture_swipe_v1_destroy(*gesture_p);
|
|
|
|
|
*gesture_p = nullptr;
|
|
|
|
|
@@ -4406,7 +4393,7 @@ static void gwl_seat_capability_touch_disable(GWL_Seat *seat)
|
|
|
|
|
|
|
|
|
|
static void seat_handle_capabilities(void *data,
|
|
|
|
|
/* Only used in an assert. */
|
|
|
|
|
[[maybe_unused]] struct wl_seat *wl_seat,
|
|
|
|
|
[[maybe_unused]] wl_seat *wl_seat,
|
|
|
|
|
const uint32_t capabilities)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG,
|
|
|
|
|
@@ -4441,7 +4428,7 @@ static void seat_handle_capabilities(void *data,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void seat_handle_name(void *data, struct wl_seat * /*wl_seat*/, const char *name)
|
|
|
|
|
static void seat_handle_name(void *data, wl_seat * /*wl_seat*/, const char *name)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "name (name=\"%s\")", name);
|
|
|
|
|
static_cast<GWL_Seat *>(data)->name = std::string(name);
|
|
|
|
|
@@ -4464,7 +4451,7 @@ static CLG_LogRef LOG_WL_XDG_OUTPUT = {"ghost.wl.handle.xdg_output"};
|
|
|
|
|
#define LOG (&LOG_WL_XDG_OUTPUT)
|
|
|
|
|
|
|
|
|
|
static void xdg_output_handle_logical_position(void *data,
|
|
|
|
|
struct zxdg_output_v1 * /*xdg_output*/,
|
|
|
|
|
zxdg_output_v1 * /*xdg_output*/,
|
|
|
|
|
const int32_t x,
|
|
|
|
|
const int32_t y)
|
|
|
|
|
{
|
|
|
|
|
@@ -4477,7 +4464,7 @@ static void xdg_output_handle_logical_position(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void xdg_output_handle_logical_size(void *data,
|
|
|
|
|
struct zxdg_output_v1 * /*xdg_output*/,
|
|
|
|
|
zxdg_output_v1 * /*xdg_output*/,
|
|
|
|
|
const int32_t width,
|
|
|
|
|
const int32_t height)
|
|
|
|
|
{
|
|
|
|
|
@@ -4512,7 +4499,7 @@ static void xdg_output_handle_logical_size(void *data,
|
|
|
|
|
output->has_size_logical = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void xdg_output_handle_done(void *data, struct zxdg_output_v1 * /*xdg_output*/)
|
|
|
|
|
static void xdg_output_handle_done(void *data, zxdg_output_v1 * /*xdg_output*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "done");
|
|
|
|
|
/* NOTE: `xdg-output.done` events are deprecated and only apply below version 3 of the protocol.
|
|
|
|
|
@@ -4524,14 +4511,14 @@ static void xdg_output_handle_done(void *data, struct zxdg_output_v1 * /*xdg_out
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void xdg_output_handle_name(void * /*data*/,
|
|
|
|
|
struct zxdg_output_v1 * /*xdg_output*/,
|
|
|
|
|
zxdg_output_v1 * /*xdg_output*/,
|
|
|
|
|
const char *name)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "name (name=\"%s\")", name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void xdg_output_handle_description(void * /*data*/,
|
|
|
|
|
struct zxdg_output_v1 * /*xdg_output*/,
|
|
|
|
|
zxdg_output_v1 * /*xdg_output*/,
|
|
|
|
|
const char *description)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "description (description=\"%s\")", description);
|
|
|
|
|
@@ -4557,7 +4544,7 @@ static CLG_LogRef LOG_WL_OUTPUT = {"ghost.wl.handle.output"};
|
|
|
|
|
#define LOG (&LOG_WL_OUTPUT)
|
|
|
|
|
|
|
|
|
|
static void output_handle_geometry(void *data,
|
|
|
|
|
struct wl_output * /*wl_output*/,
|
|
|
|
|
wl_output * /*wl_output*/,
|
|
|
|
|
const int32_t /*x*/,
|
|
|
|
|
const int32_t /*y*/,
|
|
|
|
|
const int32_t physical_width,
|
|
|
|
|
@@ -4585,7 +4572,7 @@ static void output_handle_geometry(void *data,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void output_handle_mode(void *data,
|
|
|
|
|
struct wl_output * /*wl_output*/,
|
|
|
|
|
wl_output * /*wl_output*/,
|
|
|
|
|
const uint32_t flags,
|
|
|
|
|
const int32_t width,
|
|
|
|
|
const int32_t height,
|
|
|
|
|
@@ -4617,7 +4604,7 @@ static void output_handle_mode(void *data,
|
|
|
|
|
* changes done after that. This allows changes to the output
|
|
|
|
|
* properties to be seen as atomic, even if they happen via multiple events.
|
|
|
|
|
*/
|
|
|
|
|
static void output_handle_done(void *data, struct wl_output * /*wl_output*/)
|
|
|
|
|
static void output_handle_done(void *data, wl_output * /*wl_output*/)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "done");
|
|
|
|
|
|
|
|
|
|
@@ -4646,7 +4633,7 @@ static void output_handle_done(void *data, struct wl_output * /*wl_output*/)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void output_handle_scale(void *data, struct wl_output * /*wl_output*/, const int32_t factor)
|
|
|
|
|
static void output_handle_scale(void *data, wl_output * /*wl_output*/, const int32_t factor)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "scale");
|
|
|
|
|
GWL_Output *output = static_cast<GWL_Output *>(data);
|
|
|
|
|
@@ -4672,9 +4659,7 @@ static const wl_output_listener output_listener = {
|
|
|
|
|
static CLG_LogRef LOG_WL_XDG_WM_BASE = {"ghost.wl.handle.xdg_wm_base"};
|
|
|
|
|
#define LOG (&LOG_WL_XDG_WM_BASE)
|
|
|
|
|
|
|
|
|
|
static void shell_handle_ping(void * /*data*/,
|
|
|
|
|
struct xdg_wm_base *xdg_wm_base,
|
|
|
|
|
const uint32_t serial)
|
|
|
|
|
static void shell_handle_ping(void * /*data*/, xdg_wm_base *xdg_wm_base, const uint32_t serial)
|
|
|
|
|
{
|
|
|
|
|
CLOG_INFO(LOG, 2, "ping");
|
|
|
|
|
xdg_wm_base_pong(xdg_wm_base, serial);
|
|
|
|
|
@@ -4697,7 +4682,7 @@ static const xdg_wm_base_listener shell_listener = {
|
|
|
|
|
static CLG_LogRef LOG_WL_LIBDECOR = {"ghost.wl.handle.libdecor"};
|
|
|
|
|
# define LOG (&LOG_WL_LIBDECOR)
|
|
|
|
|
|
|
|
|
|
static void decor_handle_error(struct libdecor * /*context*/,
|
|
|
|
|
static void decor_handle_error(libdecor * /*context*/,
|
|
|
|
|
enum libdecor_error error,
|
|
|
|
|
const char *message)
|
|
|
|
|
{
|
|
|
|
|
@@ -4709,7 +4694,7 @@ static void decor_handle_error(struct libdecor * /*context*/,
|
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static struct libdecor_interface libdecor_interface = {
|
|
|
|
|
static libdecor_interface libdecor_interface = {
|
|
|
|
|
decor_handle_error,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
@@ -4739,7 +4724,7 @@ static void gwl_registry_compositor_remove(GWL_Display *display,
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct wl_compositor **value_p = &display->wl_compositor;
|
|
|
|
|
wl_compositor **value_p = &display->wl_compositor;
|
|
|
|
|
wl_compositor_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
}
|
|
|
|
|
@@ -4761,7 +4746,7 @@ static void gwl_registry_xdg_wm_base_remove(GWL_Display *display,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
GWL_XDG_Decor_System &decor = *display->xdg_decor;
|
|
|
|
|
struct xdg_wm_base **value_p = &decor.shell;
|
|
|
|
|
xdg_wm_base **value_p = &decor.shell;
|
|
|
|
|
uint32_t *name_p = &decor.shell_name;
|
|
|
|
|
xdg_wm_base_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
@@ -4784,7 +4769,7 @@ static void gwl_registry_xdg_decoration_manager_remove(GWL_Display *display,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
GWL_XDG_Decor_System &decor = *display->xdg_decor;
|
|
|
|
|
struct zxdg_decoration_manager_v1 **value_p = &decor.manager;
|
|
|
|
|
zxdg_decoration_manager_v1 **value_p = &decor.manager;
|
|
|
|
|
uint32_t *name_p = &decor.manager_name;
|
|
|
|
|
zxdg_decoration_manager_v1_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
@@ -4804,7 +4789,7 @@ static void gwl_registry_xdg_output_manager_remove(GWL_Display *display,
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct zxdg_output_manager_v1 **value_p = &display->xdg_output_manager;
|
|
|
|
|
zxdg_output_manager_v1 **value_p = &display->xdg_output_manager;
|
|
|
|
|
zxdg_output_manager_v1_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
}
|
|
|
|
|
@@ -5035,7 +5020,7 @@ static void gwl_registry_wl_shm_remove(GWL_Display *display,
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct wl_shm **value_p = &display->wl_shm;
|
|
|
|
|
wl_shm **value_p = &display->wl_shm;
|
|
|
|
|
wl_shm_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
}
|
|
|
|
|
@@ -5053,7 +5038,7 @@ static void gwl_registry_wl_data_device_manager_remove(GWL_Display *display,
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct wl_data_device_manager **value_p = &display->wl_data_device_manager;
|
|
|
|
|
wl_data_device_manager **value_p = &display->wl_data_device_manager;
|
|
|
|
|
wl_data_device_manager_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
}
|
|
|
|
|
@@ -5071,7 +5056,7 @@ static void gwl_registry_wp_tablet_manager_remove(GWL_Display *display,
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct zwp_tablet_manager_v2 **value_p = &display->wp_tablet_manager;
|
|
|
|
|
zwp_tablet_manager_v2 **value_p = &display->wp_tablet_manager;
|
|
|
|
|
zwp_tablet_manager_v2_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
}
|
|
|
|
|
@@ -5090,7 +5075,7 @@ static void gwl_registry_wp_relative_pointer_manager_remove(GWL_Display *display
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct zwp_relative_pointer_manager_v1 **value_p = &display->wp_relative_pointer_manager;
|
|
|
|
|
zwp_relative_pointer_manager_v1 **value_p = &display->wp_relative_pointer_manager;
|
|
|
|
|
zwp_relative_pointer_manager_v1_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
}
|
|
|
|
|
@@ -5108,7 +5093,7 @@ static void gwl_registry_wp_pointer_constraints_remove(GWL_Display *display,
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct zwp_pointer_constraints_v1 **value_p = &display->wp_pointer_constraints;
|
|
|
|
|
zwp_pointer_constraints_v1 **value_p = &display->wp_pointer_constraints;
|
|
|
|
|
zwp_pointer_constraints_v1_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
}
|
|
|
|
|
@@ -5126,7 +5111,7 @@ static void gwl_registry_wp_pointer_gestures_remove(GWL_Display *display,
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct zwp_pointer_gestures_v1 **value_p = &display->wp_pointer_gestures;
|
|
|
|
|
zwp_pointer_gestures_v1 **value_p = &display->wp_pointer_gestures;
|
|
|
|
|
zwp_pointer_gestures_v1_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
}
|
|
|
|
|
@@ -5144,7 +5129,7 @@ static void gwl_registry_xdg_activation_remove(GWL_Display *display,
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct xdg_activation_v1 **value_p = &display->xdg_activation_manager;
|
|
|
|
|
xdg_activation_v1 **value_p = &display->xdg_activation_manager;
|
|
|
|
|
xdg_activation_v1_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
}
|
|
|
|
|
@@ -5163,7 +5148,7 @@ static void gwl_registry_wp_fractional_scale_manager_remove(GWL_Display *display
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct wp_fractional_scale_manager_v1 **value_p = &display->wp_fractional_scale_manager;
|
|
|
|
|
wp_fractional_scale_manager_v1 **value_p = &display->wp_fractional_scale_manager;
|
|
|
|
|
wp_fractional_scale_manager_v1_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
}
|
|
|
|
|
@@ -5181,7 +5166,7 @@ static void gwl_registry_wp_viewporter_remove(GWL_Display *display,
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct wp_viewporter **value_p = &display->wp_viewporter;
|
|
|
|
|
wp_viewporter **value_p = &display->wp_viewporter;
|
|
|
|
|
wp_viewporter_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
}
|
|
|
|
|
@@ -5189,7 +5174,7 @@ static void gwl_registry_wp_viewporter_remove(GWL_Display *display,
|
|
|
|
|
/* #GWL_Display.wp_primary_selection_device_manager */
|
|
|
|
|
|
|
|
|
|
static void gwl_registry_wp_primary_selection_device_manager_add(
|
|
|
|
|
struct GWL_Display *display, const GWL_RegisteryAdd_Params *params)
|
|
|
|
|
GWL_Display *display, const GWL_RegisteryAdd_Params *params)
|
|
|
|
|
{
|
|
|
|
|
display->wp_primary_selection_device_manager =
|
|
|
|
|
static_cast<zwp_primary_selection_device_manager_v1 *>(
|
|
|
|
|
@@ -5203,7 +5188,7 @@ static void gwl_registry_wp_primary_selection_device_manager_remove(GWL_Display
|
|
|
|
|
void * /*user_data*/,
|
|
|
|
|
const bool /*on_exit*/)
|
|
|
|
|
{
|
|
|
|
|
struct zwp_primary_selection_device_manager_v1 **value_p =
|
|
|
|
|
zwp_primary_selection_device_manager_v1 **value_p =
|
|
|
|
|
&display->wp_primary_selection_device_manager;
|
|
|
|
|
zwp_primary_selection_device_manager_v1_destroy(*value_p);
|
|
|
|
|
*value_p = nullptr;
|
|
|
|
|
@@ -5356,7 +5341,7 @@ static const GWL_RegistryHandler *gwl_registry_handler_from_interface_slot(int i
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void global_handle_add(void *data,
|
|
|
|
|
[[maybe_unused]] struct wl_registry *wl_registry,
|
|
|
|
|
[[maybe_unused]] wl_registry *wl_registry,
|
|
|
|
|
const uint32_t name,
|
|
|
|
|
const char *interface,
|
|
|
|
|
const uint32_t version)
|
|
|
|
|
@@ -5420,7 +5405,7 @@ static void global_handle_add(void *data,
|
|
|
|
|
* using the bind request, the client should now destroy that object.
|
|
|
|
|
*/
|
|
|
|
|
static void global_handle_remove(void *data,
|
|
|
|
|
[[maybe_unused]] struct wl_registry *wl_registry,
|
|
|
|
|
[[maybe_unused]] wl_registry *wl_registry,
|
|
|
|
|
const uint32_t name)
|
|
|
|
|
{
|
|
|
|
|
GWL_Display *display = static_cast<GWL_Display *>(data);
|
|
|
|
|
@@ -5530,7 +5515,7 @@ GHOST_SystemWayland::GHOST_SystemWayland(bool background)
|
|
|
|
|
/* Register interfaces. */
|
|
|
|
|
{
|
|
|
|
|
display_->registry_skip_update_all = true;
|
|
|
|
|
struct wl_registry *registry = wl_display_get_registry(display_->wl_display);
|
|
|
|
|
wl_registry *registry = wl_display_get_registry(display_->wl_display);
|
|
|
|
|
display_->wl_registry = registry;
|
|
|
|
|
wl_registry_add_listener(registry, ®istry_listener, display_);
|
|
|
|
|
/* First round-trip to receive all registry objects. */
|
|
|
|
|
@@ -5894,7 +5879,7 @@ static char *system_clipboard_get_primary_selection(GWL_Display *display)
|
|
|
|
|
auto read_clipboard_fn = [](GWL_PrimarySelection_DataOffer *data_offer,
|
|
|
|
|
const char *mime_receive,
|
|
|
|
|
std::mutex *mutex,
|
|
|
|
|
struct ThreadResult *thread_result) {
|
|
|
|
|
ThreadResult *thread_result) {
|
|
|
|
|
size_t data_len = 0;
|
|
|
|
|
thread_result->data = read_buffer_from_primary_selection_offer(
|
|
|
|
|
data_offer, mime_receive, mutex, true, &data_len);
|
|
|
|
|
@@ -5943,7 +5928,7 @@ static char *system_clipboard_get(GWL_Display *display)
|
|
|
|
|
auto read_clipboard_fn = [](GWL_DataOffer *data_offer,
|
|
|
|
|
const char *mime_receive,
|
|
|
|
|
std::mutex *mutex,
|
|
|
|
|
struct ThreadResult *thread_result) {
|
|
|
|
|
ThreadResult *thread_result) {
|
|
|
|
|
size_t data_len = 0;
|
|
|
|
|
thread_result->data = read_buffer_from_data_offer(
|
|
|
|
|
data_offer, mime_receive, mutex, true, &data_len);
|
|
|
|
|
@@ -6252,7 +6237,7 @@ void GHOST_SystemWayland::getAllDisplayDimensions(uint32_t &width, uint32_t &hei
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static GHOST_Context *createOffscreenContext_impl(GHOST_SystemWayland *system,
|
|
|
|
|
struct wl_display *wl_display,
|
|
|
|
|
wl_display *wl_display,
|
|
|
|
|
wl_egl_window *egl_window)
|
|
|
|
|
{
|
|
|
|
|
/* Caller must lock `system->server_mutex`. */
|
|
|
|
|
@@ -6354,7 +6339,7 @@ GHOST_TSuccess GHOST_SystemWayland::disposeContext(GHOST_IContext *context)
|
|
|
|
|
#ifdef USE_EVENT_BACKGROUND_THREAD
|
|
|
|
|
std::lock_guard lock_server_guard{*server_mutex};
|
|
|
|
|
#endif
|
|
|
|
|
struct wl_surface *wl_surface = (struct wl_surface *)((GHOST_Context *)context)->getUserData();
|
|
|
|
|
wl_surface *wl_surface = (struct wl_surface *)((GHOST_Context *)context)->getUserData();
|
|
|
|
|
/* Delete the context before the window so the context is able to release
|
|
|
|
|
* native resources (such as the #EGLSurface) before WAYLAND frees them. */
|
|
|
|
|
delete context;
|
|
|
|
|
@@ -6433,7 +6418,7 @@ static void cursor_buffer_show(const GWL_Seat *seat)
|
|
|
|
|
const int scale = cursor->is_custom ? cursor->custom_scale : seat->tablet.theme_scale;
|
|
|
|
|
const int32_t hotspot_x = int32_t(cursor->wl_image.hotspot_x) / scale;
|
|
|
|
|
const int32_t hotspot_y = int32_t(cursor->wl_image.hotspot_y) / scale;
|
|
|
|
|
for (struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2 : seat->tablet_tools) {
|
|
|
|
|
for (zwp_tablet_tool_v2 *zwp_tablet_tool_v2 : seat->tablet_tools) {
|
|
|
|
|
GWL_TabletTool *tablet_tool = static_cast<GWL_TabletTool *>(
|
|
|
|
|
zwp_tablet_tool_v2_get_user_data(zwp_tablet_tool_v2));
|
|
|
|
|
zwp_tablet_tool_v2_set_cursor(zwp_tablet_tool_v2,
|
|
|
|
|
@@ -6457,7 +6442,7 @@ static void cursor_buffer_show(const GWL_Seat *seat)
|
|
|
|
|
static void cursor_buffer_hide(const GWL_Seat *seat)
|
|
|
|
|
{
|
|
|
|
|
wl_pointer_set_cursor(seat->wl_pointer, seat->pointer.serial, nullptr, 0, 0);
|
|
|
|
|
for (struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2 : seat->tablet_tools) {
|
|
|
|
|
for (zwp_tablet_tool_v2 *zwp_tablet_tool_v2 : seat->tablet_tools) {
|
|
|
|
|
zwp_tablet_tool_v2_set_cursor(zwp_tablet_tool_v2, seat->tablet.serial, nullptr, 0, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -6465,8 +6450,7 @@ static void cursor_buffer_hide(const GWL_Seat *seat)
|
|
|
|
|
/**
|
|
|
|
|
* Needed to ensure the cursor size is always a multiple of scale.
|
|
|
|
|
*/
|
|
|
|
|
static int cursor_buffer_compatible_scale_from_image(const struct wl_cursor_image *wl_image,
|
|
|
|
|
int scale)
|
|
|
|
|
static int cursor_buffer_compatible_scale_from_image(const wl_cursor_image *wl_image, int scale)
|
|
|
|
|
{
|
|
|
|
|
const int32_t image_size_x = int32_t(wl_image->width);
|
|
|
|
|
const int32_t image_size_y = int32_t(wl_image->height);
|
|
|
|
|
@@ -6481,7 +6465,7 @@ static int cursor_buffer_compatible_scale_from_image(const struct wl_cursor_imag
|
|
|
|
|
|
|
|
|
|
static void cursor_buffer_set_surface_impl(const GWL_Seat *seat,
|
|
|
|
|
wl_buffer *buffer,
|
|
|
|
|
struct wl_surface *wl_surface,
|
|
|
|
|
wl_surface *wl_surface,
|
|
|
|
|
const int scale)
|
|
|
|
|
{
|
|
|
|
|
const wl_cursor_image *wl_image = &seat->cursor.wl_image;
|
|
|
|
|
@@ -6523,7 +6507,7 @@ static void cursor_buffer_set(const GWL_Seat *seat, wl_buffer *buffer)
|
|
|
|
|
wl_image, cursor->is_custom ? cursor->custom_scale : seat->tablet.theme_scale);
|
|
|
|
|
const int32_t hotspot_x = int32_t(wl_image->hotspot_x) / scale;
|
|
|
|
|
const int32_t hotspot_y = int32_t(wl_image->hotspot_y) / scale;
|
|
|
|
|
for (struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2 : seat->tablet_tools) {
|
|
|
|
|
for (zwp_tablet_tool_v2 *zwp_tablet_tool_v2 : seat->tablet_tools) {
|
|
|
|
|
GWL_TabletTool *tablet_tool = static_cast<GWL_TabletTool *>(
|
|
|
|
|
zwp_tablet_tool_v2_get_user_data(zwp_tablet_tool_v2));
|
|
|
|
|
cursor_buffer_set_surface_impl(seat, buffer, tablet_tool->wl_surface_cursor, scale);
|
|
|
|
|
@@ -6624,8 +6608,8 @@ GHOST_TSuccess GHOST_SystemWayland::cursor_shape_set(const GHOST_TStandardCursor
|
|
|
|
|
return GHOST_kFailure;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct wl_cursor_image *image = wl_cursor->images[0];
|
|
|
|
|
struct wl_buffer *buffer = wl_cursor_image_get_buffer(image);
|
|
|
|
|
wl_cursor_image *image = wl_cursor->images[0];
|
|
|
|
|
wl_buffer *buffer = wl_cursor_image_get_buffer(image);
|
|
|
|
|
if (!buffer) {
|
|
|
|
|
return GHOST_kFailure;
|
|
|
|
|
}
|
|
|
|
|
@@ -6860,50 +6844,49 @@ 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 struct wl_output *wl_output)
|
|
|
|
|
bool ghost_wl_output_own(const wl_output *wl_output)
|
|
|
|
|
{
|
|
|
|
|
return wl_proxy_get_tag((struct wl_proxy *)wl_output) == &ghost_wl_output_tag_id;
|
|
|
|
|
return wl_proxy_get_tag((wl_proxy *)wl_output) == &ghost_wl_output_tag_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ghost_wl_surface_own(const struct wl_surface *wl_surface)
|
|
|
|
|
bool ghost_wl_surface_own(const wl_surface *wl_surface)
|
|
|
|
|
{
|
|
|
|
|
return wl_proxy_get_tag((struct wl_proxy *)wl_surface) == &ghost_wl_surface_tag_id;
|
|
|
|
|
return wl_proxy_get_tag((wl_proxy *)wl_surface) == &ghost_wl_surface_tag_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ghost_wl_surface_own_with_null_check(const struct wl_surface *wl_surface)
|
|
|
|
|
bool ghost_wl_surface_own_with_null_check(const wl_surface *wl_surface)
|
|
|
|
|
{
|
|
|
|
|
return wl_surface && ghost_wl_surface_own(wl_surface);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ghost_wl_surface_own_cursor_pointer(const struct wl_surface *wl_surface)
|
|
|
|
|
bool ghost_wl_surface_own_cursor_pointer(const wl_surface *wl_surface)
|
|
|
|
|
{
|
|
|
|
|
return wl_proxy_get_tag((struct wl_proxy *)wl_surface) ==
|
|
|
|
|
&ghost_wl_surface_cursor_pointer_tag_id;
|
|
|
|
|
return wl_proxy_get_tag((wl_proxy *)wl_surface) == &ghost_wl_surface_cursor_pointer_tag_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool ghost_wl_surface_own_cursor_tablet(const struct wl_surface *wl_surface)
|
|
|
|
|
bool ghost_wl_surface_own_cursor_tablet(const wl_surface *wl_surface)
|
|
|
|
|
{
|
|
|
|
|
return wl_proxy_get_tag((struct wl_proxy *)wl_surface) == &ghost_wl_surface_cursor_tablet_tag_id;
|
|
|
|
|
return wl_proxy_get_tag((wl_proxy *)wl_surface) == &ghost_wl_surface_cursor_tablet_tag_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ghost_wl_output_tag(struct wl_output *wl_output)
|
|
|
|
|
void ghost_wl_output_tag(wl_output *wl_output)
|
|
|
|
|
{
|
|
|
|
|
wl_proxy_set_tag((struct wl_proxy *)wl_output, &ghost_wl_output_tag_id);
|
|
|
|
|
wl_proxy_set_tag((wl_proxy *)wl_output, &ghost_wl_output_tag_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ghost_wl_surface_tag(struct wl_surface *wl_surface)
|
|
|
|
|
void ghost_wl_surface_tag(wl_surface *wl_surface)
|
|
|
|
|
{
|
|
|
|
|
wl_proxy_set_tag((struct wl_proxy *)wl_surface, &ghost_wl_surface_tag_id);
|
|
|
|
|
wl_proxy_set_tag((wl_proxy *)wl_surface, &ghost_wl_surface_tag_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ghost_wl_surface_tag_cursor_pointer(struct wl_surface *wl_surface)
|
|
|
|
|
void ghost_wl_surface_tag_cursor_pointer(wl_surface *wl_surface)
|
|
|
|
|
{
|
|
|
|
|
wl_proxy_set_tag((struct wl_proxy *)wl_surface, &ghost_wl_surface_cursor_pointer_tag_id);
|
|
|
|
|
wl_proxy_set_tag((wl_proxy *)wl_surface, &ghost_wl_surface_cursor_pointer_tag_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ghost_wl_surface_tag_cursor_tablet(struct wl_surface *wl_surface)
|
|
|
|
|
void ghost_wl_surface_tag_cursor_tablet(wl_surface *wl_surface)
|
|
|
|
|
{
|
|
|
|
|
wl_proxy_set_tag((struct wl_proxy *)wl_surface, &ghost_wl_surface_cursor_tablet_tag_id);
|
|
|
|
|
wl_proxy_set_tag((wl_proxy *)wl_surface, &ghost_wl_surface_cursor_tablet_tag_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** \} */
|
|
|
|
|
@@ -6924,26 +6907,26 @@ wl_compositor *GHOST_SystemWayland::wl_compositor()
|
|
|
|
|
return display_->wl_compositor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct zwp_primary_selection_device_manager_v1 *GHOST_SystemWayland::wp_primary_selection_manager()
|
|
|
|
|
zwp_primary_selection_device_manager_v1 *GHOST_SystemWayland::wp_primary_selection_manager()
|
|
|
|
|
{
|
|
|
|
|
return display_->wp_primary_selection_device_manager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct xdg_activation_v1 *GHOST_SystemWayland::xdg_activation_manager()
|
|
|
|
|
xdg_activation_v1 *GHOST_SystemWayland::xdg_activation_manager()
|
|
|
|
|
{
|
|
|
|
|
return display_->xdg_activation_manager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct wp_fractional_scale_manager_v1 *GHOST_SystemWayland::wp_fractional_scale_manager()
|
|
|
|
|
wp_fractional_scale_manager_v1 *GHOST_SystemWayland::wp_fractional_scale_manager()
|
|
|
|
|
{
|
|
|
|
|
return display_->wp_fractional_scale_manager;
|
|
|
|
|
}
|
|
|
|
|
struct wp_viewporter *GHOST_SystemWayland::wp_viewporter()
|
|
|
|
|
wp_viewporter *GHOST_SystemWayland::wp_viewporter()
|
|
|
|
|
{
|
|
|
|
|
return display_->wp_viewporter;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct zwp_pointer_gestures_v1 *GHOST_SystemWayland::wp_pointer_gestures()
|
|
|
|
|
zwp_pointer_gestures_v1 *GHOST_SystemWayland::wp_pointer_gestures()
|
|
|
|
|
{
|
|
|
|
|
return display_->wp_pointer_gestures;
|
|
|
|
|
}
|
|
|
|
|
@@ -6994,7 +6977,7 @@ const std::vector<GWL_Output *> &GHOST_SystemWayland::outputs() const
|
|
|
|
|
return display_->outputs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct wl_shm *GHOST_SystemWayland::wl_shm() const
|
|
|
|
|
wl_shm *GHOST_SystemWayland::wl_shm() const
|
|
|
|
|
{
|
|
|
|
|
return display_->wl_shm;
|
|
|
|
|
}
|
|
|
|
|
@@ -7012,7 +6995,7 @@ GHOST_TimerManager *GHOST_SystemWayland::ghost_timer_manager()
|
|
|
|
|
/** \name Public WAYLAND Query Access
|
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
|
struct GWL_Output *ghost_wl_output_user_data(struct wl_output *wl_output)
|
|
|
|
|
GWL_Output *ghost_wl_output_user_data(wl_output *wl_output)
|
|
|
|
|
{
|
|
|
|
|
GHOST_ASSERT(wl_output, "output must not be NULL");
|
|
|
|
|
GHOST_ASSERT(ghost_wl_output_own(wl_output), "output is not owned by GHOST");
|
|
|
|
|
@@ -7020,7 +7003,7 @@ struct GWL_Output *ghost_wl_output_user_data(struct wl_output *wl_output)
|
|
|
|
|
return output;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GHOST_WindowWayland *ghost_wl_surface_user_data(struct wl_surface *wl_surface)
|
|
|
|
|
GHOST_WindowWayland *ghost_wl_surface_user_data(wl_surface *wl_surface)
|
|
|
|
|
{
|
|
|
|
|
GHOST_ASSERT(wl_surface, "wl_surface must not be NULL");
|
|
|
|
|
GHOST_ASSERT(ghost_wl_surface_own(wl_surface), "wl_surface is not owned by GHOST");
|
|
|
|
|
@@ -7049,12 +7032,12 @@ GHOST_TSuccess GHOST_SystemWayland::pushEvent_maybe_pending(GHOST_IEvent *event)
|
|
|
|
|
return pushEvent(event);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GHOST_SystemWayland::seat_active_set(const struct GWL_Seat *seat)
|
|
|
|
|
void GHOST_SystemWayland::seat_active_set(const GWL_Seat *seat)
|
|
|
|
|
{
|
|
|
|
|
gwl_display_seat_active_set(display_, seat);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct wl_seat *GHOST_SystemWayland::wl_seat_active_get_with_input_serial(uint32_t &serial)
|
|
|
|
|
wl_seat *GHOST_SystemWayland::wl_seat_active_get_with_input_serial(uint32_t &serial)
|
|
|
|
|
{
|
|
|
|
|
GWL_Seat *seat = gwl_display_seat_active_get(display_);
|
|
|
|
|
if (seat) {
|
|
|
|
|
@@ -7139,7 +7122,7 @@ void GHOST_SystemWayland::output_scale_update(GWL_Output *output)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (seat->tablet.outputs.count(output)) {
|
|
|
|
|
for (struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2 : seat->tablet_tools) {
|
|
|
|
|
for (zwp_tablet_tool_v2 *zwp_tablet_tool_v2 : seat->tablet_tools) {
|
|
|
|
|
GWL_TabletTool *tablet_tool = static_cast<GWL_TabletTool *>(
|
|
|
|
|
zwp_tablet_tool_v2_get_user_data(zwp_tablet_tool_v2));
|
|
|
|
|
if (tablet_tool->wl_surface_cursor != nullptr) {
|
|
|
|
|
@@ -7159,7 +7142,7 @@ bool GHOST_SystemWayland::window_cursor_grab_set(const GHOST_TGrabCursorMode mod
|
|
|
|
|
const GHOST_Rect *wrap_bounds,
|
|
|
|
|
const GHOST_TAxisFlag wrap_axis,
|
|
|
|
|
wl_surface *wl_surface,
|
|
|
|
|
const struct GWL_WindowScaleParams &scale_params)
|
|
|
|
|
const GWL_WindowScaleParams &scale_params)
|
|
|
|
|
{
|
|
|
|
|
/* Caller must lock `server_mutex`. */
|
|
|
|
|
|
|
|
|
|
@@ -7185,10 +7168,9 @@ bool GHOST_SystemWayland::window_cursor_grab_set(const GHOST_TGrabCursorMode mod
|
|
|
|
|
const bool use_software_confine = false;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
const struct GWL_SeatStateGrab grab_state_prev = seat_grab_state_from_mode(mode_current,
|
|
|
|
|
was_software_confine);
|
|
|
|
|
const struct GWL_SeatStateGrab grab_state_next = seat_grab_state_from_mode(mode,
|
|
|
|
|
use_software_confine);
|
|
|
|
|
const GWL_SeatStateGrab grab_state_prev = seat_grab_state_from_mode(mode_current,
|
|
|
|
|
was_software_confine);
|
|
|
|
|
const GWL_SeatStateGrab grab_state_next = seat_grab_state_from_mode(mode, use_software_confine);
|
|
|
|
|
|
|
|
|
|
/* Check for wrap as #GHOST_kCapabilityCursorWarp isn't supported. */
|
|
|
|
|
const bool use_visible = !(ELEM(mode, GHOST_kGrabHide, GHOST_kGrabWrap) || use_software_confine);
|
|
|
|
|
|