wayland: Save the output mode so that it can be used to fullscreen windows
This commit is contained in:
parent
3780e3e4f0
commit
737c5e1045
@ -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
|
static void
|
||||||
display_handle_global (struct wl_display *display,
|
display_handle_global (struct wl_display *display,
|
||||||
@ -101,11 +137,21 @@ display_handle_global (struct wl_display *display,
|
|||||||
{
|
{
|
||||||
backend_wayland->wayland_shell =
|
backend_wayland->wayland_shell =
|
||||||
wl_display_bind (display, id, &wl_shell_interface);
|
wl_display_bind (display, id, &wl_shell_interface);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (strcmp (interface, "wl_shm") == 0)
|
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
|
static gboolean
|
||||||
|
@ -57,7 +57,10 @@ struct _ClutterBackendWayland
|
|||||||
struct wl_shell *wayland_shell;
|
struct wl_shell *wayland_shell;
|
||||||
struct wl_shm *wayland_shm;
|
struct wl_shm *wayland_shm;
|
||||||
struct wl_buffer *cursor_buffer;
|
struct wl_buffer *cursor_buffer;
|
||||||
|
struct wl_output *wayland_output;
|
||||||
|
|
||||||
gint cursor_x, cursor_y;
|
gint cursor_x, cursor_y;
|
||||||
|
gint output_width, output_height;
|
||||||
|
|
||||||
GSource *wayland_source;
|
GSource *wayland_source;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user