mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-29 16:05:59 +01:00
types/wlr_pointer_gestures_v1: null-check both focused_surface and focused_client
(fixes #3385)
This commit is contained in:
parent
4ba8458255
commit
eedb9df531
1 changed files with 24 additions and 8 deletions
|
@ -52,7 +52,9 @@ void wlr_pointer_gestures_v1_send_swipe_begin(
|
||||||
uint32_t time_msec,
|
uint32_t time_msec,
|
||||||
uint32_t fingers) {
|
uint32_t fingers) {
|
||||||
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
||||||
if (focus == NULL) {
|
struct wlr_seat_client *focus_seat_client =
|
||||||
|
seat->pointer_state.focused_client;
|
||||||
|
if (focus == NULL || focus_seat_client == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,7 +81,9 @@ void wlr_pointer_gestures_v1_send_swipe_update(
|
||||||
double dx,
|
double dx,
|
||||||
double dy) {
|
double dy) {
|
||||||
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
||||||
if (focus == NULL) {
|
struct wlr_seat_client *focus_seat_client =
|
||||||
|
seat->pointer_state.focused_client;
|
||||||
|
if (focus == NULL || focus_seat_client == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,7 +107,9 @@ void wlr_pointer_gestures_v1_send_swipe_end(
|
||||||
uint32_t time_msec,
|
uint32_t time_msec,
|
||||||
bool cancelled) {
|
bool cancelled) {
|
||||||
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
||||||
if (focus == NULL) {
|
struct wlr_seat_client *focus_seat_client =
|
||||||
|
seat->pointer_state.focused_client;
|
||||||
|
if (focus == NULL || focus_seat_client == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +170,9 @@ void wlr_pointer_gestures_v1_send_pinch_begin(
|
||||||
uint32_t time_msec,
|
uint32_t time_msec,
|
||||||
uint32_t fingers) {
|
uint32_t fingers) {
|
||||||
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
||||||
if (focus == NULL) {
|
struct wlr_seat_client *focus_seat_client =
|
||||||
|
seat->pointer_state.focused_client;
|
||||||
|
if (focus == NULL || focus_seat_client == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +201,9 @@ void wlr_pointer_gestures_v1_send_pinch_update(
|
||||||
double scale,
|
double scale,
|
||||||
double rotation) {
|
double rotation) {
|
||||||
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
||||||
if (focus == NULL) {
|
struct wlr_seat_client *focus_seat_client =
|
||||||
|
seat->pointer_state.focused_client;
|
||||||
|
if (focus == NULL || focus_seat_client == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,7 +229,9 @@ void wlr_pointer_gestures_v1_send_pinch_end(
|
||||||
uint32_t time_msec,
|
uint32_t time_msec,
|
||||||
bool cancelled) {
|
bool cancelled) {
|
||||||
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
||||||
if (focus == NULL) {
|
struct wlr_seat_client *focus_seat_client =
|
||||||
|
seat->pointer_state.focused_client;
|
||||||
|
if (focus == NULL || focus_seat_client == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,7 +297,9 @@ void wlr_pointer_gestures_v1_send_hold_begin(
|
||||||
uint32_t time_msec,
|
uint32_t time_msec,
|
||||||
uint32_t fingers) {
|
uint32_t fingers) {
|
||||||
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
||||||
if (focus == NULL) {
|
struct wlr_seat_client *focus_seat_client =
|
||||||
|
seat->pointer_state.focused_client;
|
||||||
|
if (focus == NULL || focus_seat_client == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,7 +325,9 @@ void wlr_pointer_gestures_v1_send_hold_end(
|
||||||
uint32_t time_msec,
|
uint32_t time_msec,
|
||||||
bool cancelled) {
|
bool cancelled) {
|
||||||
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
struct wlr_surface *focus = seat->pointer_state.focused_surface;
|
||||||
if (focus == NULL) {
|
struct wlr_seat_client *focus_seat_client =
|
||||||
|
seat->pointer_state.focused_client;
|
||||||
|
if (focus == NULL || focus_seat_client == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue