Bring windows to front when touched

This commit is contained in:
Simon Long 2024-03-05 09:48:55 +00:00
parent 861c0de99f
commit fd0b3199b3

View file

@ -7,6 +7,9 @@
#include "idle.h"
#include "input/touch.h"
#include "labwc.h"
#include "config/mousebind.h"
#include "action.h"
#include "view.h"
/* Holds layout -> surface offsets to report motion events in relative coords */
struct touch_point {
@ -109,6 +112,16 @@ touch_down(struct wl_listener *listener, void *data)
double sx = lx - x_offset;
double sy = ly - y_offset;
struct view *view = view_from_wlr_surface(touch_point->surface);
struct mousebind *mousebind;
wl_list_for_each(mousebind, &rc.mousebinds,link) {
if (mousebind->mouse_event == MOUSE_ACTION_PRESS
&& mousebind->button == BTN_LEFT
&& mousebind->context == LAB_SSD_CLIENT) {
actions_run(view, seat->server, &mousebind->actions, 0);
}
}
wlr_seat_touch_notify_down(seat->seat, touch_point->surface,
event->time_msec, event->touch_id, sx, sy);
} else {