compositor: Drop core ping_handler callout
This was always a little iffy. At least it could have been a signal,
but we now have focus signal, so lets just use that. We lose
the ability to detect unresponsive clients at key event time, but we
could add that back by adding a key_signal.
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 8c8e4eb..a47bbe7 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1876,6 +1876,10 @@
if (shsurf->ping_timer)
return;
+ if (shsurf->unresponsive) {
+ ping_timeout_handler(shsurf);
+ return;
+ }
shsurf->ping_timer = malloc(sizeof *shsurf->ping_timer);
if (!shsurf->ping_timer)
@@ -1975,21 +1979,14 @@
struct weston_pointer *pointer = data;
struct weston_view *view = pointer->focus;
struct weston_compositor *compositor;
- struct shell_surface *shsurf;
uint32_t serial;
if (!view)
return;
compositor = view->surface->compositor;
- shsurf = get_shell_surface(view->surface);
-
- if (shsurf && shsurf->unresponsive) {
- set_busy_cursor(shsurf, pointer);
- } else {
- serial = wl_display_next_serial(compositor->wl_display);
- ping_handler(view->surface, serial);
- }
+ serial = wl_display_next_serial(compositor->wl_display);
+ ping_handler(view->surface, serial);
}
static void
@@ -5909,7 +5906,6 @@
shell->wake_listener.notify = wake_handler;
wl_signal_add(&ec->wake_signal, &shell->wake_listener);
- ec->ping_handler = ping_handler;
ec->shell_interface.shell = shell;
ec->shell_interface.create_shell_surface = create_shell_surface;
ec->shell_interface.get_primary_view = get_primary_view;
diff --git a/src/compositor.c b/src/compositor.c
index 9de3a90..7c29d51 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -3588,8 +3588,6 @@
if (weston_compositor_xkb_init(ec, &xkb_names) < 0)
return -1;
- ec->ping_handler = NULL;
-
screenshooter_create(ec);
text_backend_init(ec);
diff --git a/src/compositor.h b/src/compositor.h
index 63e4e2c..8778aff 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -622,8 +622,6 @@
void (*restore)(struct weston_compositor *ec);
int (*authenticate)(struct weston_compositor *c, uint32_t id);
- void (*ping_handler)(struct weston_surface *surface, uint32_t serial);
-
struct weston_launcher *launcher;
uint32_t output_id_pool;
diff --git a/src/input.c b/src/input.c
index e20c870..b5efe73 100644
--- a/src/input.c
+++ b/src/input.c
@@ -1000,13 +1000,8 @@
{
struct weston_compositor *compositor = seat->compositor;
struct weston_pointer *pointer = seat->pointer;
- struct weston_surface *focus =
- (struct weston_surface *) pointer->focus;
- uint32_t serial = wl_display_next_serial(compositor->wl_display);
if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
- if (compositor->ping_handler && focus)
- compositor->ping_handler(focus, serial);
weston_compositor_idle_inhibit(compositor);
if (pointer->button_count == 0) {
pointer->grab_button = button;
@@ -1036,15 +1031,9 @@
{
struct weston_compositor *compositor = seat->compositor;
struct weston_pointer *pointer = seat->pointer;
- struct weston_surface *focus =
- (struct weston_surface *) pointer->focus;
- uint32_t serial = wl_display_next_serial(compositor->wl_display);
struct wl_resource *resource;
struct wl_list *resource_list;
- if (compositor->ping_handler && focus)
- compositor->ping_handler(focus, serial);
-
weston_compositor_wake(compositor);
if (!value)
@@ -1260,15 +1249,10 @@
{
struct weston_compositor *compositor = seat->compositor;
struct weston_keyboard *keyboard = seat->keyboard;
- struct weston_surface *focus = keyboard->focus;
struct weston_keyboard_grab *grab = keyboard->grab;
- uint32_t serial = wl_display_next_serial(compositor->wl_display);
uint32_t *k, *end;
if (state == WL_KEYBOARD_KEY_STATE_PRESSED) {
- if (compositor->ping_handler && focus)
- compositor->ping_handler(focus, serial);
-
weston_compositor_idle_inhibit(compositor);
keyboard->grab_key = key;
keyboard->grab_time = time;