diff options
author | emersion <contact@emersion.fr> | 2017-10-29 10:39:47 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2017-10-31 12:30:06 +0100 |
commit | c45f2eef0e0fb805d88b54b65db23bb8a49ebea6 (patch) | |
tree | bdc1f0c80276146d4e43e0174b4a22e47376a99c /examples | |
parent | 1b6c7293608717943a296675b1ab228fed72277c (diff) |
Fix rootston
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pointer.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/examples/pointer.c b/examples/pointer.c index 66598ad4..b2fef4e8 100644 --- a/examples/pointer.c +++ b/examples/pointer.c @@ -93,8 +93,6 @@ static void handle_output_frame(struct output_state *output, static void handle_output_add(struct output_state *ostate) { struct sample_state *sample = ostate->compositor->data; - struct wlr_output *wlr_output = ostate->output; - struct wlr_xcursor_image *image = sample->xcursor->images[0]; struct output_config *o_config = example_config_get_output(sample->config, ostate->output); @@ -112,12 +110,9 @@ static void handle_output_add(struct output_state *ostate) { // TODO the cursor must be set depending on which surface it is displayed // over which should happen in the compositor. - if (!wlr_output_set_cursor(wlr_output, image->buffer, - image->width, image->width, image->height, - image->hotspot_x, image->hotspot_y)) { - wlr_log(L_DEBUG, "Failed to set hardware cursor"); - return; - } + struct wlr_xcursor_image *image = sample->xcursor->images[0]; + wlr_cursor_set_image(sample->cursor, image->buffer, image->width, + image->width, image->height, image->hotspot_x, image->hotspot_y); wlr_cursor_warp(sample->cursor, NULL, sample->cursor->x, sample->cursor->y); } @@ -162,13 +157,8 @@ static void handle_cursor_motion_absolute(struct wl_listener *listener, sample->cur_y = event->y_mm; struct wlr_xcursor_image *image = sample->xcursor->images[0]; - - struct output_state *output; - wl_list_for_each(output, &sample->compositor->outputs, link) { - wlr_output_move_cursor(output->output, - sample->cur_x - image->hotspot_x, - sample->cur_y - image->hotspot_y); - } + wlr_cursor_warp_absolute(sample->cursor, event->device, + sample->cur_x - image->hotspot_x, sample->cur_y - image->hotspot_y); } static void handle_cursor_button(struct wl_listener *listener, void *data) { |