windowmaker-wl/src/backend/wayland/wl_layout_sync.c

31 lines
899 B
C

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <wayland-server-core.h>
#include "../../screen.h"
#include "wl_types.h"
extern void wl_screen_refresh_heads(WScreen *scr);
extern void wl_framebuf_refresh_all_positions(void);
void
wl_handle_output_layout_change(struct wl_listener *listener, void *data)
{
(void)listener;
(void)data;
if (wl_state.scr)
wl_screen_refresh_heads(wl_state.scr);
wwarning("layout-change: pointer=(%d,%d)", wl_state.pointer_x, wl_state.pointer_y);
if (wl_state.scr && wl_state.scr->heads) {
for (int i = 0; i < wl_state.scr->head_count; i++) {
wwarning("layout-change: head[%d]=(%d,%d %dx%d)", i,
wl_state.scr->heads[i].x, wl_state.scr->heads[i].y,
wl_state.scr->heads[i].width, wl_state.scr->heads[i].height);
}
}
wl_framebuf_refresh_all_positions();
}