I'm trying to figure out how to use GdkDeviceManager, so I wrote the following program that is supposed to print all physical input devices:
#include <stdio.h>
#include <gdk/gdk.h>
int main(int argc, char **argv) {
GList *devices, *it;
GdkDeviceManager mgr;
devices = gdk_device_manager_list_devices(&mgr, GDK_DEVICE_TYPE_SLAVE);
for (it = devices; it != NULL; it = it->next) {
GdkDevice *dev = it->data;
printf("Current device: %s\n", gdk_device_get_name(dev));
}
g_list_free(devices);
return 0;
}
However when I try to compile it via
gcc mousetest.c $(pkg-config --libs --cflags gtk+-3.0 gdk-3.0) -Wall
I get
mousetest.c: In function ‘main’:
mousetest.c:6:22: error: storage size of ‘mgr’ isn’t known
GdkDeviceManager mgr;
^
mousetest.c:6:22: warning: unused variable ‘mgr’ [-Wunused-variable]