Cloudef / wlc

High-level Wayland compositor library
MIT License
331 stars 58 forks source link

Querying `wlc_pointer_get_position` returns 0, 0 #250

Closed Enerccio closed 7 years ago

Enerccio commented 7 years ago

Tested it during wlc_set_pointer_scroll_cb callback.

Test case:

#include <wlc/wlc.h>
#include <stdio.h>
#include <stdlib.h>

bool mouse_scroll(wlc_handle view, uint32_t time, const struct wlc_modifiers* mods,
        uint8_t axis_bits, double amount[2]) {
    struct wlc_point point;
    wlc_pointer_get_position(&point);

    printf("mouse pos %i, %i\n", point.x, point.y); 
    return false;
}

int main(int argc, char** argv) {
    wlc_set_pointer_scroll_cb(mouse_scroll);

    if (!wlc_init())
        return 1;

    wlc_run();
    return 0;
}