wlserver: Add WLSERVER_TOUCH_CLICK_DISABLED

This commit is contained in:
Joshua Ashton 2022-04-29 00:59:22 +00:00
parent 4a153094b5
commit 2855219311
2 changed files with 13 additions and 4 deletions

View file

@ -262,13 +262,13 @@ static inline uint32_t steamcompmgr_button_to_wlserver_button( int button )
switch ( button ) switch ( button )
{ {
default: default:
case 0: case WLSERVER_TOUCH_CLICK_HOVER:
return 0; return 0;
case 1: case WLSERVER_TOUCH_CLICK_LEFT:
return BTN_LEFT; return BTN_LEFT;
case 2: case WLSERVER_TOUCH_CLICK_RIGHT:
return BTN_RIGHT; return BTN_RIGHT;
case 3: case WLSERVER_TOUCH_CLICK_MIDDLE:
return BTN_MIDDLE; return BTN_MIDDLE;
} }
} }
@ -307,6 +307,10 @@ static void wlserver_handle_touch_down(struct wl_listener *listener, void *data)
wlserver.touch_down[ event->touch_id ] = true; wlserver.touch_down[ event->touch_id ] = true;
} }
} }
else if ( g_nTouchClickMode == WLSERVER_TOUCH_CLICK_DISABLED )
{
return;
}
else else
{ {
g_bPendingTouchMovement = true; g_bPendingTouchMovement = true;
@ -394,6 +398,10 @@ static void wlserver_handle_touch_motion(struct wl_listener *listener, void *dat
{ {
wlr_seat_touch_notify_motion( wlserver.wlr.seat, event->time_msec, event->touch_id, wlserver.mouse_surface_cursorx, wlserver.mouse_surface_cursory ); wlr_seat_touch_notify_motion( wlserver.wlr.seat, event->time_msec, event->touch_id, wlserver.mouse_surface_cursorx, wlserver.mouse_surface_cursory );
} }
else if ( g_nTouchClickMode == WLSERVER_TOUCH_CLICK_DISABLED )
{
return;
}
else else
{ {
g_bPendingTouchMovement = true; g_bPendingTouchMovement = true;

View file

@ -126,6 +126,7 @@ enum wlserver_touch_click_mode {
WLSERVER_TOUCH_CLICK_RIGHT = 2, WLSERVER_TOUCH_CLICK_RIGHT = 2,
WLSERVER_TOUCH_CLICK_MIDDLE = 3, WLSERVER_TOUCH_CLICK_MIDDLE = 3,
WLSERVER_TOUCH_CLICK_PASSTHROUGH = 4, WLSERVER_TOUCH_CLICK_PASSTHROUGH = 4,
WLSERVER_TOUCH_CLICK_DISABLED = 5,
}; };
extern enum wlserver_touch_click_mode g_nDefaultTouchClickMode; extern enum wlserver_touch_click_mode g_nDefaultTouchClickMode;