feat: add more protocols + touch support:
* add touch support (experimental) * add support for wlr_cursor_shape_v1 * add support for wlr_relative_pointer_manager_v1
This commit is contained in:
324
seat.c
324
seat.c
@@ -4,34 +4,54 @@
|
||||
#include <stdlib.h>
|
||||
#include <wlr/util/log.h>
|
||||
#include <assert.h>
|
||||
#include <strings.h>
|
||||
#include <wlr/types/wlr_touch.h>
|
||||
#include "seat.h"
|
||||
#include "view.h"
|
||||
#include "output.h"
|
||||
#include "idle.h"
|
||||
|
||||
static void configure_keyboard(struct diyac_seat* seat, struct diyac_input* input, bool force)
|
||||
static struct wlr_output *output_by_name(struct diyac_server *server, const char *name)
|
||||
{
|
||||
(void) seat;
|
||||
assert(name);
|
||||
struct diyac_output *output;
|
||||
wl_list_for_each(output, &server->outputs, link)
|
||||
{
|
||||
if (!strcasecmp(output->wlr_output->name, name))
|
||||
{
|
||||
return output->wlr_output;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void configure_keyboard(struct diyac_seat *seat, struct diyac_input *input, bool force)
|
||||
{
|
||||
(void)seat;
|
||||
struct wlr_input_device *device = input->device;
|
||||
assert(device->type == WLR_INPUT_DEVICE_KEYBOARD);
|
||||
struct diyac_keyboard *keyboard = (struct diyac_keyboard *)input;
|
||||
struct wlr_keyboard *kb = wlr_keyboard_from_input_device(device);
|
||||
|
||||
if(!keyboard->is_virtual || force)
|
||||
if (!keyboard->is_virtual || force)
|
||||
{
|
||||
/*
|
||||
* Set layout based on environment variables XKB_DEFAULT_LAYOUT,
|
||||
* XKB_DEFAULT_OPTIONS, and friends.
|
||||
*/
|
||||
struct xkb_rule_names rules = { 0 };
|
||||
* Set layout based on environment variables XKB_DEFAULT_LAYOUT,
|
||||
* XKB_DEFAULT_OPTIONS, and friends.
|
||||
*/
|
||||
struct xkb_rule_names rules = {0};
|
||||
struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||
struct xkb_keymap *keymap = xkb_map_new_from_names(context, &rules,XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||
if (keymap) {
|
||||
if (!wlr_keyboard_keymaps_match(kb->keymap, keymap)) {
|
||||
struct xkb_keymap *keymap = xkb_map_new_from_names(context, &rules, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||
if (keymap)
|
||||
{
|
||||
if (!wlr_keyboard_keymaps_match(kb->keymap, keymap))
|
||||
{
|
||||
wlr_keyboard_set_keymap(kb, keymap);
|
||||
}
|
||||
xkb_keymap_unref(keymap);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
wlr_log(WLR_ERROR, "Failed to create xkb keymap");
|
||||
}
|
||||
xkb_context_unref(context);
|
||||
@@ -39,11 +59,10 @@ static void configure_keyboard(struct diyac_seat* seat, struct diyac_input* inpu
|
||||
wlr_keyboard_set_repeat_info(kb, 25, 600);
|
||||
}
|
||||
|
||||
|
||||
static void keyboard_handle_modifiers(
|
||||
struct wl_listener *listener, void *data)
|
||||
{
|
||||
(void) data;
|
||||
(void)data;
|
||||
/* This event is raised when a modifier key, such as shift or alt, is
|
||||
* pressed. We simply communicate this to the client. */
|
||||
struct diyac_keyboard *keyboard =
|
||||
@@ -131,7 +150,7 @@ static void keyboard_handle_key(
|
||||
|
||||
static void input_handle_destroy(struct wl_listener *listener, void *data)
|
||||
{
|
||||
(void) data;
|
||||
(void)data;
|
||||
/* This event is raised by the keyboard base wlr_input_device to signal
|
||||
* the destruction of the wlr_keyboard. It will no longer receive events
|
||||
* and should be destroyed.
|
||||
@@ -140,10 +159,10 @@ static void input_handle_destroy(struct wl_listener *listener, void *data)
|
||||
wl_list_remove(&input->link);
|
||||
wl_list_remove(&input->destroy.link);
|
||||
|
||||
if(input->device->type == WLR_INPUT_DEVICE_KEYBOARD)
|
||||
if (input->device->type == WLR_INPUT_DEVICE_KEYBOARD)
|
||||
{
|
||||
struct diyac_keyboard* keyboard = (struct diyac_keyboard*) input;
|
||||
if(keyboard->is_virtual)
|
||||
struct diyac_keyboard *keyboard = (struct diyac_keyboard *)input;
|
||||
if (keyboard->is_virtual)
|
||||
{
|
||||
wlr_log(WLR_INFO, "Virtual keyboard destroyed");
|
||||
}
|
||||
@@ -153,8 +172,8 @@ static void input_handle_destroy(struct wl_listener *listener, void *data)
|
||||
free(input);
|
||||
}
|
||||
|
||||
static struct diyac_input* server_new_keyboard(struct diyac_seat *seat,
|
||||
struct wlr_input_device *device, bool is_virtual)
|
||||
static struct diyac_input *server_new_keyboard(struct diyac_seat *seat,
|
||||
struct wlr_input_device *device, bool is_virtual)
|
||||
{
|
||||
struct wlr_keyboard *wlr_keyboard = wlr_keyboard_from_input_device(device);
|
||||
|
||||
@@ -168,36 +187,203 @@ static struct diyac_input* server_new_keyboard(struct diyac_seat *seat,
|
||||
* Force configure default keyboard keymap for all new
|
||||
* keyboard, including virtual keyboard
|
||||
*/
|
||||
configure_keyboard(seat,&keyboard->input, true);
|
||||
configure_keyboard(seat, &keyboard->input, true);
|
||||
|
||||
/* Here we set up listeners for keyboard events. */
|
||||
keyboard->modifiers.notify = keyboard_handle_modifiers;
|
||||
wl_signal_add(&wlr_keyboard->events.modifiers, &keyboard->modifiers);
|
||||
|
||||
|
||||
keyboard->key.notify = keyboard_handle_key;
|
||||
wl_signal_add(&wlr_keyboard->events.key, &keyboard->key);
|
||||
|
||||
wlr_seat_set_keyboard(seat->wlr_seat, keyboard->wlr_keyboard);
|
||||
|
||||
/* And add the keyboard to our list of keyboards */
|
||||
//wl_list_insert(&server->seat.keyboards, &keyboard->link);
|
||||
return (struct diyac_input*) keyboard;
|
||||
// wl_list_insert(&server->seat.keyboards, &keyboard->link);
|
||||
return (struct diyac_input *)keyboard;
|
||||
}
|
||||
/*
|
||||
static void configure_libinput(struct wlr_input_device *wlr_input_device)
|
||||
{
|
||||
if (!wlr_input_device) {
|
||||
wlr_log(WLR_ERROR, "no wlr_input_device");
|
||||
return;
|
||||
}
|
||||
struct input *input = wlr_input_device->data;
|
||||
|
||||
static struct diyac_input* server_new_pointer(struct diyac_seat *seat,
|
||||
struct wlr_input_device *device)
|
||||
if (!wlr_input_device_is_libinput(wlr_input_device)) {
|
||||
input->scroll_factor = 1.0;
|
||||
return;
|
||||
}
|
||||
|
||||
struct libinput_device *libinput_dev =
|
||||
wlr_libinput_get_device_handle(wlr_input_device);
|
||||
if (!libinput_dev) {
|
||||
wlr_log(WLR_ERROR, "no libinput_dev");
|
||||
return;
|
||||
}
|
||||
|
||||
struct libinput_category *dc = get_category(wlr_input_device);
|
||||
|
||||
assert(dc);
|
||||
|
||||
if (libinput_device_config_tap_get_finger_count(libinput_dev) <= 0) {
|
||||
wlr_log(WLR_INFO, "tap unavailable");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "tap configured");
|
||||
libinput_device_config_tap_set_enabled(libinput_dev, dc->tap);
|
||||
libinput_device_config_tap_set_button_map(libinput_dev,
|
||||
dc->tap_button_map);
|
||||
}
|
||||
|
||||
if (libinput_device_config_tap_get_finger_count(libinput_dev) <= 0
|
||||
|| dc->tap_and_drag < 0) {
|
||||
wlr_log(WLR_INFO, "tap-and-drag not configured");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "tap-and-drag configured");
|
||||
libinput_device_config_tap_set_drag_enabled(
|
||||
libinput_dev, dc->tap_and_drag);
|
||||
}
|
||||
|
||||
if (libinput_device_config_tap_get_finger_count(libinput_dev) <= 0
|
||||
|| dc->drag_lock < 0) {
|
||||
wlr_log(WLR_INFO, "drag lock not configured");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "drag lock configured");
|
||||
libinput_device_config_tap_set_drag_lock_enabled(
|
||||
libinput_dev, dc->drag_lock);
|
||||
}
|
||||
|
||||
if (libinput_device_config_scroll_has_natural_scroll(libinput_dev) <= 0
|
||||
|| dc->natural_scroll < 0) {
|
||||
wlr_log(WLR_INFO, "natural scroll not configured");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "natural scroll configured");
|
||||
libinput_device_config_scroll_set_natural_scroll_enabled(
|
||||
libinput_dev, dc->natural_scroll);
|
||||
}
|
||||
|
||||
if (libinput_device_config_left_handed_is_available(libinput_dev) <= 0
|
||||
|| dc->left_handed < 0) {
|
||||
wlr_log(WLR_INFO, "left-handed mode not configured");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "left-handed mode configured");
|
||||
libinput_device_config_left_handed_set(libinput_dev,
|
||||
dc->left_handed);
|
||||
}
|
||||
|
||||
if (libinput_device_config_accel_is_available(libinput_dev) == 0) {
|
||||
wlr_log(WLR_INFO, "pointer acceleration unavailable");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "pointer acceleration configured");
|
||||
if (dc->pointer_speed >= -1) {
|
||||
libinput_device_config_accel_set_speed(libinput_dev,
|
||||
dc->pointer_speed);
|
||||
}
|
||||
if (dc->accel_profile > 0) {
|
||||
libinput_device_config_accel_set_profile(libinput_dev,
|
||||
dc->accel_profile);
|
||||
}
|
||||
}
|
||||
|
||||
if (libinput_device_config_middle_emulation_is_available(libinput_dev)
|
||||
== 0 || dc->middle_emu < 0) {
|
||||
wlr_log(WLR_INFO, "middle emulation not configured");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "middle emulation configured");
|
||||
libinput_device_config_middle_emulation_set_enabled(
|
||||
libinput_dev, dc->middle_emu);
|
||||
}
|
||||
|
||||
if (libinput_device_config_dwt_is_available(libinput_dev) == 0
|
||||
|| dc->dwt < 0) {
|
||||
wlr_log(WLR_INFO, "dwt not configured");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "dwt configured");
|
||||
libinput_device_config_dwt_set_enabled(libinput_dev, dc->dwt);
|
||||
}
|
||||
|
||||
if ((dc->click_method != LIBINPUT_CONFIG_CLICK_METHOD_NONE
|
||||
&& (libinput_device_config_click_get_methods(libinput_dev)
|
||||
& dc->click_method) == 0)
|
||||
|| dc->click_method < 0) {
|
||||
wlr_log(WLR_INFO, "click method not configured");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "click method configured");
|
||||
libinput_device_config_click_set_method(libinput_dev, dc->click_method);
|
||||
}
|
||||
|
||||
if ((dc->send_events_mode != LIBINPUT_CONFIG_SEND_EVENTS_ENABLED
|
||||
&& (libinput_device_config_send_events_get_modes(libinput_dev)
|
||||
& dc->send_events_mode) == 0)
|
||||
|| dc->send_events_mode < 0) {
|
||||
wlr_log(WLR_INFO, "send events mode not configured");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "send events mode configured");
|
||||
libinput_device_config_send_events_set_mode(libinput_dev, dc->send_events_mode);
|
||||
}
|
||||
|
||||
if (libinput_device_config_calibration_has_matrix(libinput_dev) == 0
|
||||
|| !dc->have_calibration_matrix) {
|
||||
wlr_log(WLR_INFO, "calibration matrix not configured");
|
||||
} else {
|
||||
wlr_log(WLR_INFO, "calibration matrix configured");
|
||||
libinput_device_config_calibration_set_matrix(libinput_dev, dc->calibration_matrix);
|
||||
}
|
||||
|
||||
wlr_log(WLR_INFO, "scroll factor configured");
|
||||
input->scroll_factor = dc->scroll_factor;
|
||||
}
|
||||
*/
|
||||
|
||||
static struct diyac_input *server_new_pointer(struct diyac_seat *seat, struct wlr_input_device *device)
|
||||
{
|
||||
struct diyac_input *input = calloc(1, sizeof(*input));
|
||||
input->device = device;
|
||||
/* We don't do anything special with pointers. All of our pointer handling
|
||||
* is proxied through wlr_cursor. On another compositor, you might take this
|
||||
* opportunity to do libinput configuration on the device to set
|
||||
* acceleration, etc. */
|
||||
device->data = input;
|
||||
/**
|
||||
* @TODO:
|
||||
* configure pointer via libinput
|
||||
*
|
||||
*/
|
||||
wlr_cursor_attach_input_device(seat->cursor, device);
|
||||
struct wlr_pointer *pointer = wlr_pointer_from_input_device(device);
|
||||
wlr_log(WLR_INFO, "map pointer to output %s", pointer->output_name);
|
||||
struct wlr_output *output = NULL;
|
||||
if (pointer->output_name)
|
||||
{
|
||||
output = output_by_name(seat->server, pointer->output_name);
|
||||
}
|
||||
wlr_cursor_map_input_to_output(seat->cursor, device, output);
|
||||
wlr_cursor_map_input_to_region(seat->cursor, device, NULL);
|
||||
return input;
|
||||
}
|
||||
|
||||
static void seat_add_input(struct diyac_seat* seat, struct diyac_input* input)
|
||||
static struct diyac_input *server_new_touch(struct diyac_seat *seat, struct wlr_input_device *device)
|
||||
{
|
||||
struct diyac_input *input = calloc(1, sizeof(*input));
|
||||
input->device = device;
|
||||
device->data = input;
|
||||
|
||||
/**
|
||||
* @TODO:
|
||||
* configure touch device via libinput
|
||||
*
|
||||
*/
|
||||
wlr_cursor_attach_input_device(seat->cursor, device);
|
||||
struct wlr_touch *touch = wlr_touch_from_input_device(device);
|
||||
wlr_log(WLR_INFO, "map pointer to output %s", touch->output_name);
|
||||
struct wlr_output *output = NULL;
|
||||
if (touch->output_name)
|
||||
{
|
||||
output = output_by_name(seat->server, touch->output_name);
|
||||
}
|
||||
wlr_cursor_map_input_to_output(seat->cursor, device, output);
|
||||
wlr_cursor_map_input_to_region(seat->cursor, device, NULL);
|
||||
return input;
|
||||
}
|
||||
|
||||
static void seat_add_input(struct diyac_seat *seat, struct diyac_input *input)
|
||||
{
|
||||
input->seat = seat;
|
||||
input->destroy.notify = input_handle_destroy;
|
||||
@@ -210,8 +396,10 @@ static void seat_add_input(struct diyac_seat* seat, struct diyac_input* input)
|
||||
* there are no pointer devices, so we always include that capability. */
|
||||
uint32_t caps = 0;
|
||||
|
||||
wl_list_for_each(input, &seat->inputs, link) {
|
||||
switch (input->device->type) {
|
||||
wl_list_for_each(input, &seat->inputs, link)
|
||||
{
|
||||
switch (input->device->type)
|
||||
{
|
||||
case WLR_INPUT_DEVICE_KEYBOARD:
|
||||
caps |= WL_SEAT_CAPABILITY_KEYBOARD;
|
||||
break;
|
||||
@@ -235,7 +423,7 @@ static void server_new_input(struct wl_listener *listener, void *data)
|
||||
struct diyac_seat *seat =
|
||||
wl_container_of(listener, seat, new_input);
|
||||
struct wlr_input_device *device = data;
|
||||
struct diyac_input* input = NULL;
|
||||
struct diyac_input *input = NULL;
|
||||
|
||||
switch (device->type)
|
||||
{
|
||||
@@ -245,8 +433,10 @@ static void server_new_input(struct wl_listener *listener, void *data)
|
||||
case WLR_INPUT_DEVICE_POINTER:
|
||||
input = server_new_pointer(seat, device);
|
||||
break;
|
||||
default:
|
||||
case WLR_INPUT_DEVICE_TOUCH:
|
||||
input = server_new_touch(seat, device);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
seat_add_input(seat, input);
|
||||
@@ -328,13 +518,17 @@ void diyac_init_seat(struct diyac_server *server)
|
||||
server->seat.new_input.notify = server_new_input;
|
||||
wl_signal_add(&server->backend->events.new_input, &server->seat.new_input);
|
||||
server->seat.wlr_seat = wlr_seat_create(server->wl_display, "seat0");
|
||||
|
||||
wl_list_init(&server->seat.touch_points);
|
||||
wl_list_init(&server->seat.inputs);
|
||||
|
||||
server->seat.request_cursor.notify = seat_request_cursor;
|
||||
wl_signal_add(&server->seat.wlr_seat->events.request_set_cursor,
|
||||
&server->seat.request_cursor);
|
||||
server->seat.request_set_selection.notify = seat_request_set_selection;
|
||||
wl_signal_add(&server->seat.wlr_seat->events.request_set_selection,
|
||||
&server->seat.request_set_selection);
|
||||
server->seat.request_set_selection.notify = request_set_selection_notify;
|
||||
server->seat.request_set_selection.notify = request_set_selection_notify;
|
||||
wl_signal_add(&server->seat.wlr_seat->events.request_set_selection,
|
||||
&server->seat.request_set_selection);
|
||||
|
||||
@@ -346,7 +540,7 @@ void diyac_init_seat(struct diyac_server *server)
|
||||
// virtual keyboard support
|
||||
server->seat.virtual_keyboard_manager = wlr_virtual_keyboard_manager_v1_create(server->wl_display);
|
||||
wl_signal_add(&server->seat.virtual_keyboard_manager->events.new_virtual_keyboard,
|
||||
&server->seat.virtual_keyboard_new);
|
||||
&server->seat.virtual_keyboard_new);
|
||||
server->seat.virtual_keyboard_new.notify = new_virtual_keyboard;
|
||||
}
|
||||
|
||||
@@ -418,13 +612,13 @@ void diyac_seat_focus_layer(struct diyac_seat *seat, struct wlr_layer_surface_v1
|
||||
return;
|
||||
*/
|
||||
}
|
||||
if(seat->focused_layer == layer)
|
||||
if (seat->focused_layer == layer)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(seat->focused_layer)
|
||||
wlr_log(WLR_INFO,"Layer focus changed %s -> %s", seat->focused_layer->namespace, layer->namespace);
|
||||
|
||||
if (seat->focused_layer)
|
||||
wlr_log(WLR_INFO, "Layer focus changed %s -> %s", seat->focused_layer->namespace, layer->namespace);
|
||||
|
||||
// unfocus currently focus view
|
||||
if (seat->server->active_view)
|
||||
{
|
||||
@@ -440,20 +634,23 @@ void diyac_seat_focus_layer(struct diyac_seat *seat, struct wlr_layer_surface_v1
|
||||
*/
|
||||
}
|
||||
|
||||
void diyac_seat_configure(struct diyac_server* server)
|
||||
void diyac_seat_configure(struct diyac_server *server)
|
||||
{
|
||||
struct diyac_seat* seat = &server->seat;
|
||||
struct diyac_input* input = NULL;
|
||||
struct diyac_seat *seat = &server->seat;
|
||||
struct diyac_input *input = NULL;
|
||||
|
||||
wl_list_for_each(input, &seat->inputs, link)
|
||||
{
|
||||
switch (input->device->type) {
|
||||
switch (input->device->type)
|
||||
{
|
||||
case WLR_INPUT_DEVICE_KEYBOARD:
|
||||
configure_keyboard(seat, input, false);
|
||||
break;
|
||||
case WLR_INPUT_DEVICE_POINTER:
|
||||
/*TODO: reconfigure libinput*/
|
||||
break;
|
||||
case WLR_INPUT_DEVICE_TOUCH:
|
||||
/*TODO: reconfigure libinput*/
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -461,31 +658,54 @@ void diyac_seat_configure(struct diyac_server* server)
|
||||
}
|
||||
}
|
||||
|
||||
void diyac_seat_focus_topmost(struct diyac_seat* seat, struct diyac_output* output)
|
||||
void diyac_seat_focus_topmost(struct diyac_seat *seat, struct diyac_output *output)
|
||||
{
|
||||
for(int i = ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY; i >= ZWLR_LAYER_SHELL_V1_LAYER_TOP; i--)
|
||||
for (int i = ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY; i >= ZWLR_LAYER_SHELL_V1_LAYER_TOP; i--)
|
||||
{
|
||||
struct wlr_scene_tree *scene = output->layer_tree[i];
|
||||
struct wl_list *node_list = & scene->children;
|
||||
struct wl_list *node_list = &scene->children;
|
||||
struct wlr_scene_node *node;
|
||||
wl_list_for_each_reverse(node,node_list, link)
|
||||
wl_list_for_each_reverse(node, node_list, link)
|
||||
{
|
||||
struct diyac_node_descriptor *node_descriptor = node->data;
|
||||
if (!node->enabled || !node_descriptor || node_descriptor->type != DIYAC_NODE_LAYER_SURFACE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
struct diyac_layer_surface* surface = (struct diyac_layer_surface *)node_descriptor->data;
|
||||
struct wlr_layer_surface_v1* layer_surface = surface->scene_layer_surface->layer_surface;
|
||||
if(!surface->mapped || layer_surface->current.keyboard_interactive == ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE)
|
||||
struct diyac_layer_surface *surface = (struct diyac_layer_surface *)node_descriptor->data;
|
||||
struct wlr_layer_surface_v1 *layer_surface = surface->scene_layer_surface->layer_surface;
|
||||
if (!surface->mapped || layer_surface->current.keyboard_interactive == ZWLR_LAYER_SURFACE_V1_KEYBOARD_INTERACTIVITY_NONE)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
wlr_log(WLR_INFO," Update focus on layer: %s", layer_surface->namespace);
|
||||
wlr_log(WLR_INFO, " Update focus on layer: %s", layer_surface->namespace);
|
||||
diyac_seat_focus_layer(seat, layer_surface);
|
||||
return;
|
||||
}
|
||||
}
|
||||
seat->focused_layer = NULL;
|
||||
diyac_focus_topmost_view(seat->server, true);
|
||||
}
|
||||
|
||||
void diyac_seat_pointer_end_grab(struct diyac_seat *seat, struct wlr_surface *surface)
|
||||
{
|
||||
if (!surface || !wlr_seat_pointer_has_grab(seat->wlr_seat))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
struct wlr_xdg_surface *xdg_surface =
|
||||
wlr_xdg_surface_try_from_wlr_surface(surface);
|
||||
if (!xdg_surface || xdg_surface->role != WLR_XDG_SURFACE_ROLE_POPUP)
|
||||
{
|
||||
/*
|
||||
* If we have an active popup grab (an open popup) and we are
|
||||
* not on the popup itself, end that grab to close the popup.
|
||||
* Contrary to pointer button notifications, a tablet/touch
|
||||
* button notification sometimes doesn't end grabs automatically
|
||||
* on button notifications in another client (observed in GTK4),
|
||||
* so end the grab manually.
|
||||
*/
|
||||
wlr_seat_pointer_end_grab(seat->wlr_seat);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user