summaryrefslogtreecommitdiff
path: root/gdk/wayland/gdkscreen-wayland.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2016-03-31 20:31:00 -0400
committerMatthias Clasen <mclasen@redhat.com>2016-03-31 20:31:00 -0400
commit4c698bc82418f43076320819cdbb5af9ffd00e50 (patch)
treecd9f51d1b8107b565127af3717c255febf925d62 /gdk/wayland/gdkscreen-wayland.c
parent4c10800bcc11d81a503255d6c6fa90405badd3ce (diff)
downloadgtk+-4c698bc82418f43076320819cdbb5af9ffd00e50.tar.gz
wayland: Print out more debug info
Print out the subpixel layout and frame rates that the compositor sends us.
Diffstat (limited to 'gdk/wayland/gdkscreen-wayland.c')
-rw-r--r--gdk/wayland/gdkscreen-wayland.c54
1 files changed, 52 insertions, 2 deletions
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index f1db311d53..f7569cb1f5 100644
--- a/gdk/wayland/gdkscreen-wayland.c
+++ b/gdk/wayland/gdkscreen-wayland.c
@@ -1075,6 +1075,56 @@ update_screen_size (GdkWaylandScreen *screen_wayland)
g_signal_emit_by_name (screen_wayland, "size-changed");
}
+#ifdef G_ENABLE_DEBUG
+
+static const char *
+subpixel_to_string (int layout)
+{
+ int i;
+ struct { int layout; const char *name; } layouts[] = {
+ { WL_OUTPUT_SUBPIXEL_UNKNOWN, "unknown" },
+ { WL_OUTPUT_SUBPIXEL_NONE, "none" },
+ { WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB, "rgb" },
+ { WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR, "bgr" },
+ { WL_OUTPUT_SUBPIXEL_VERTICAL_RGB, "vrgb" },
+ { WL_OUTPUT_SUBPIXEL_VERTICAL_BGR, "vbgr" },
+ { 0xffffffff, NULL }
+ };
+
+ for (i = 0; layouts[i].name; i++)
+ {
+ if (layouts[i].layout == layout)
+ return layouts[i].name;
+ }
+ return NULL;
+}
+
+static const char *
+transform_to_string (int transform)
+{
+ int i;
+ struct { int transform; const char *name; } transforms[] = {
+ { WL_OUTPUT_TRANSFORM_NORMAL, "normal" },
+ { WL_OUTPUT_TRANSFORM_90, "90" },
+ { WL_OUTPUT_TRANSFORM_180, "180" },
+ { WL_OUTPUT_TRANSFORM_270, "270" },
+ { WL_OUTPUT_TRANSFORM_FLIPPED, "flipped" },
+ { WL_OUTPUT_TRANSFORM_FLIPPED_90, "flipped 90" },
+ { WL_OUTPUT_TRANSFORM_FLIPPED_180, "flipped 180" },
+ { WL_OUTPUT_TRANSFORM_FLIPPED_270, "flipped 270" },
+ { 0xffffffff, NULL }
+ };
+
+ for (i = 0; transforms[i].name; i++)
+ {
+ if (transforms[i].transform == transform)
+ return transforms[i].name;
+ }
+ return NULL;
+}
+
+#endif
+
static void
output_handle_geometry (void *data,
struct wl_output *wl_output,
@@ -1090,8 +1140,8 @@ output_handle_geometry (void *data,
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
GDK_NOTE (MISC,
- g_message ("handle geometry output %d, position %d %d, phys. size %d %d, manufacturer %s, model %s",
- monitor->id, x, y, physical_width, physical_height, make, model));
+ g_message ("handle geometry output %d, position %d %d, phys. size %d %d, subpixel layout %s, manufacturer %s, model %s, transform %s",
+ monitor->id, x, y, physical_width, physical_height, subpixel_to_string (subpixel), make, model, transform_to_string (transform)));
monitor->geometry.x = x;
monitor->geometry.y = y;