aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/wlr_output.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/types/wlr_output.c b/types/wlr_output.c
index 011451be..cc4022eb 100644
--- a/types/wlr_output.c
+++ b/types/wlr_output.c
@@ -171,8 +171,12 @@ bool wlr_output_set_cursor(struct wlr_output *output,
return set_cursor(output, buf, stride, width, height, hotspot_x, hotspot_y);
}
-static void commit_cursor_surface(struct wlr_output *output,
- struct wlr_surface *surface) {
+static void handle_cursor_surface_commit(struct wl_listener *listener,
+ void *data) {
+ struct wlr_output *output = wl_container_of(listener, output,
+ cursor.surface_commit);
+ struct wlr_surface *surface = data;
+
struct wl_shm_buffer *buffer = wl_shm_buffer_get(surface->current->buffer);
if (buffer == NULL) {
return;
@@ -194,15 +198,6 @@ static void commit_cursor_surface(struct wlr_output *output,
wl_shm_buffer_end_access(buffer);
}
-static void handle_cursor_surface_commit(struct wl_listener *listener,
- void *data) {
- struct wlr_output *output = wl_container_of(listener, output,
- cursor.surface_commit);
- struct wlr_surface *surface = data;
-
- commit_cursor_surface(output, surface);
-}
-
static void handle_cursor_surface_destroy(struct wl_listener *listener,
void *data) {
struct wlr_output *output = wl_container_of(listener, output,
@@ -223,7 +218,6 @@ void wlr_output_set_cursor_surface(struct wlr_output *output,
output->cursor.hotspot_y = hotspot_y;
if (surface && output->cursor.surface == surface) {
- commit_cursor_surface(output, surface);
return;
}
@@ -238,7 +232,6 @@ void wlr_output_set_cursor_surface(struct wlr_output *output,
if (surface != NULL) {
wl_signal_add(&surface->events.commit, &output->cursor.surface_commit);
wl_signal_add(&surface->events.destroy, &output->cursor.surface_destroy);
- commit_cursor_surface(output, surface);
} else {
set_cursor(output, NULL, 0, 0, 0, hotspot_x, hotspot_y);
}