[clutter] wayland: Save the output mode so that it can be used to fullscreen windows
- From: Rob Bradford <rbradford src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] wayland: Save the output mode so that it can be used to fullscreen windows
- Date: Thu, 26 Jan 2012 14:45:34 +0000 (UTC)
commit 737c5e104512cf7319588b1921f26783e97c5e36
Author: Rob Bradford <rob linux intel com>
Date: Fri Jan 20 18:22:50 2012 +0000
wayland: Save the output mode so that it can be used to fullscreen windows
clutter/wayland/clutter-backend-wayland.c | 52 +++++++++++++++++++++++++++--
clutter/wayland/clutter-backend-wayland.h | 3 ++
2 files changed, 52 insertions(+), 3 deletions(-)
---
diff --git a/clutter/wayland/clutter-backend-wayland.c b/clutter/wayland/clutter-backend-wayland.c
index 79e8b76..f72937e 100644
--- a/clutter/wayland/clutter-backend-wayland.c
+++ b/clutter/wayland/clutter-backend-wayland.c
@@ -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
diff --git a/clutter/wayland/clutter-backend-wayland.h b/clutter/wayland/clutter-backend-wayland.h
index fe8b2f4..9ee51d9 100644
--- a/clutter/wayland/clutter-backend-wayland.h
+++ b/clutter/wayland/clutter-backend-wayland.h
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]