1
0
Fork 0

wayland: Save the output mode so that it can be used to fullscreen windows

This commit is contained in:
Rob Bradford 2012-01-20 18:22:50 +00:00
parent 3780e3e4f0
commit 737c5e1045
2 changed files with 52 additions and 3 deletions

View file

@ -79,6 +79,42 @@ clutter_backend_wayland_dispose (GObject *gobject)
}
static void
output_handle_mode (void *data,
struct wl_output *wl_output,
uint32_t flags,
int width,
int height,
int refresh)
{
ClutterBackendWayland *backend_wayland = data;
if (flags & WL_OUTPUT_MODE_CURRENT)
{
backend_wayland->output_width = width;
backend_wayland->output_height = height;
}
}
static void
output_handle_geometry (void *data,
struct wl_output *wl_output,
int x,
int y,
int physical_width,
int physical_height,
int subpixel,
const char *make,
const char *model)
{
}
static const struct wl_output_listener wayland_output_listener = {
output_handle_geometry,
output_handle_mode,
};
static void
display_handle_global (struct wl_display *display,
@ -101,11 +137,21 @@ display_handle_global (struct wl_display *display,
{
backend_wayland->wayland_shell =
wl_display_bind (display, id, &wl_shell_interface);
}
else if (strcmp (interface, "wl_shm") == 0)
backend_wayland->wayland_shm =
wl_display_bind (display, id, &wl_shm_interface);
{
backend_wayland->wayland_shm =
wl_display_bind (display, id, &wl_shm_interface);
}
else if (strcmp (interface, "wl_output") == 0)
{
/* FIXME: Support multiple outputs */
backend_wayland->wayland_output =
wl_display_bind (display, id, &wl_output_interface);
wl_output_add_listener (backend_wayland->wayland_output,
&wayland_output_listener,
backend_wayland);
}
}
static gboolean

View file

@ -57,7 +57,10 @@ struct _ClutterBackendWayland
struct wl_shell *wayland_shell;
struct wl_shm *wayland_shm;
struct wl_buffer *cursor_buffer;
struct wl_output *wayland_output;
gint cursor_x, cursor_y;
gint output_width, output_height;
GSource *wayland_source;