static void surface_leave(void *data, struct wl_surface *wl_surface, struct wl_output *output) { struct surface *surface = data; surface->output = NULL; fprintf(stderr, "test-client: got surface leave output %p\n", wl_output_get_user_data(output)); }
static void surface_enter(void *data, struct wl_surface *wl_surface, struct wl_output *output) { struct surface *surface = data; surface->output = wl_output_get_user_data(output); fprintf(stderr, "test-client: got surface enter output %p\n", surface->output); }
/** Safe cast from wl_output * * \param wo The wl_output to cast from. * \return The corresponding struct output, or NULL. * * This is safe to call with NULL. The returned pointer is non-NULL only * if the wl_output really has a struct output associated. */ struct output * output_from_wl_output(struct wl_output *wo) { const void *impl; if (!wo) return NULL; impl = wl_proxy_get_listener((struct wl_proxy *)wo); if (impl != &output_listener) return NULL; return wl_output_get_user_data(wo); }
static void handleEnter(void *data, struct wl_surface *surface, struct wl_output *output) { _GLFWwindow* window = data; _GLFWmonitor* monitor = wl_output_get_user_data(output); if (window->wl.monitorsCount + 1 > window->wl.monitorsSize) { ++window->wl.monitorsSize; window->wl.monitors = realloc(window->wl.monitors, window->wl.monitorsSize * sizeof(_GLFWmonitor*)); } window->wl.monitors[window->wl.monitorsCount++] = monitor; checkScaleChange(window); }
static void handleLeave(void *data, struct wl_surface *surface, struct wl_output *output) { _GLFWwindow* window = data; _GLFWmonitor* monitor = wl_output_get_user_data(output); GLFWbool found; int i; for (i = 0, found = GLFW_FALSE; i < window->wl.monitorsCount - 1; ++i) { if (monitor == window->wl.monitors[i]) found = GLFW_TRUE; if (found) window->wl.monitors[i] = window->wl.monitors[i + 1]; } window->wl.monitors[--window->wl.monitorsCount] = NULL; checkScaleChange(window); }
int x, int y, int physical_width, int physical_height, int subpixel, const char* make, const char* model, int transform) { printf("Output geometry: {x='%d', y='%d', " "ph_width='%d', ph_height='%d', subpixel='%d', " "make='%s', model='%s', transform='%d'}\n", x, y, physical_width, physical_height, subpixel, make, model, transform); NoiaCtlOutput* ctl_output = wl_output_get_user_data(output); ctl_output->x = x; ctl_output->y = y; ctl_output->pw = physical_width; ctl_output->ph = physical_height; } //------------------------------------------------------------------------------ void noia_controller_output_mode(void* data NOIA_UNUSED, struct wl_output* output, uint32_t flags, int width, int height, int refresh) {