summaryrefslogtreecommitdiff
path: root/src/platform
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform')
-rw-r--r--src/platform/wayland/pointer.c3
-rw-r--r--src/platform/wayland/shell.c8
2 files changed, 10 insertions, 1 deletions
diff --git a/src/platform/wayland/pointer.c b/src/platform/wayland/pointer.c
index 9f8ca49..571bb12 100644
--- a/src/platform/wayland/pointer.c
+++ b/src/platform/wayland/pointer.c
@@ -59,6 +59,9 @@ uint32_t seat_held_press_serial(const struct seat *s)
{
if (!s) return 0;
bool held = s->pointer_buttons != 0 || (s->tool && s->tool->in_contact);
+ /* A touch contact is a press too; touch_down records its serial. */
+ for (int i = 0; !held && i < SEAT_TOUCH_POINTS; i++)
+ held = s->touch_points[i].active;
return held ? s->press_serial : 0;
}
diff --git a/src/platform/wayland/shell.c b/src/platform/wayland/shell.c
index 8e6b67e..12c73e0 100644
--- a/src/platform/wayland/shell.c
+++ b/src/platform/wayland/shell.c
@@ -1,5 +1,7 @@
#include "internal.h"
+#include <errno.h>
+
static void wm_base_ping(void *data, struct xdg_wm_base *wm_base, uint32_t serial);
static const struct xdg_wm_base_listener wm_base_listener;
@@ -421,7 +423,11 @@ int surface_init_shell(struct wayland_surface *w, const char *title)
bool wayland_surface_bell(struct wayland_surface *w)
{
- if (!w || w->closed || !w->conn || !w->conn->system_bell || !w->surface) return false;
+ if (!w || w->closed || !w->conn || !w->surface) return false;
+ if (!w->conn->system_bell) {
+ errno = ENOTSUP; /* The compositor lacks xdg-system-bell. */
+ return false;
+ }
xdg_system_bell_v1_ring(w->conn->system_bell, w->surface);
return true;
}