wayland: Add basic multiple output support

Store the wl_output pointer within the the GdkWaylandMonitor structure.
This commit is contained in:
Rob Bradford 2013-02-14 13:00:19 +00:00
parent e16ade9836
commit fab808f92c
3 changed files with 5 additions and 3 deletions

View File

@ -95,6 +95,7 @@ gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id
GdkWaylandDisplay *display_wayland = data;
GdkDisplay *gdk_display = GDK_DISPLAY_OBJECT (data);
struct wl_seat *seat;
struct wl_output *output;
if (strcmp(interface, "wl_compositor") == 0) {
display_wayland->compositor =
@ -109,9 +110,9 @@ gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id
display_wayland->shell =
wl_registry_bind(display_wayland->wl_registry, id, &wl_shell_interface, 1);
} else if (strcmp(interface, "wl_output") == 0) {
display_wayland->output =
output =
wl_registry_bind(display_wayland->wl_registry, id, &wl_output_interface, 1);
_gdk_wayland_screen_add_output(display_wayland->screen, display_wayland->output);
_gdk_wayland_screen_add_output(display_wayland->screen, output);
} else if (strcmp(interface, "wl_seat") == 0) {
seat = wl_registry_bind(display_wayland->wl_registry, id, &wl_seat_interface, 1);
_gdk_wayland_device_manager_add_device (gdk_display->device_manager,

View File

@ -61,7 +61,6 @@ struct _GdkWaylandDisplay
struct wl_compositor *compositor;
struct wl_shm *shm;
struct wl_shell *shell;
struct wl_output *output;
struct wl_input_device *input_device;
struct wl_data_device_manager *data_device_manager;

View File

@ -67,6 +67,7 @@ struct _GdkWaylandScreenClass
struct _GdkWaylandMonitor
{
struct wl_output *output;
GdkRectangle geometry;
int width_mm;
int height_mm;
@ -589,6 +590,7 @@ _gdk_wayland_screen_add_output (GdkScreen *screen,
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
GdkWaylandMonitor *monitor = g_new0(GdkWaylandMonitor, 1);
monitor->output = output;
g_ptr_array_add(screen_wayland->monitors, monitor);
wl_output_add_listener(output, &output_listener, monitor);