mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
Bring windows to front when touched
This commit is contained in:
parent
861c0de99f
commit
fd0b3199b3
1 changed files with 13 additions and 0 deletions
|
|
@ -7,6 +7,9 @@
|
||||||
#include "idle.h"
|
#include "idle.h"
|
||||||
#include "input/touch.h"
|
#include "input/touch.h"
|
||||||
#include "labwc.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 */
|
/* Holds layout -> surface offsets to report motion events in relative coords */
|
||||||
struct touch_point {
|
struct touch_point {
|
||||||
|
|
@ -109,6 +112,16 @@ touch_down(struct wl_listener *listener, void *data)
|
||||||
double sx = lx - x_offset;
|
double sx = lx - x_offset;
|
||||||
double sy = ly - y_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,
|
wlr_seat_touch_notify_down(seat->seat, touch_point->surface,
|
||||||
event->time_msec, event->touch_id, sx, sy);
|
event->time_msec, event->touch_id, sx, sy);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue