aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-10-09 15:45:46 +0200
committeremersion <contact@emersion.fr>2017-10-09 15:45:46 +0200
commit8f7962ed44a1f2b9cc9792cfa506ed76ec31dcc0 (patch)
treef85937c0820253198a681f47cda7650f1c98eac6
parentb76e64e7bf5c24488cf6a37174d1858e2256578a (diff)
Do not commit surface on set_cursor, breaks GTK+ apps
-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);
}