[PATCH 2/2] Move old functionality of wl_shell into desktop_shell

Casey Dahlin cdahlin at redhat.com
Tue Oct 25 15:58:57 PDT 2011


wl_shell is gone since many compositors didn't use it, so we need to have
desktop_shell pick up the slack.

Signed-off-by: Casey Dahlin <cdahlin at redhat.com>
---
 clients/Makefile.am        |    5 +-
 clients/simple-egl.c       |   10 ++--
 clients/simple-shm.c       |   10 ++--
 clients/terminal.c         |    6 +-
 clients/window.c           |   41 +++++++++------
 clients/window.h           |    5 ++-
 compositor/shell.c         |  122 ++++++++++++++++++++++----------------------
 protocol/desktop-shell.xml |   59 +++++++++++++++++++++
 8 files changed, 166 insertions(+), 92 deletions(-)

diff --git a/clients/Makefile.am b/clients/Makefile.am
index 8c30882..4a9f108 100644
--- a/clients/Makefile.am
+++ b/clients/Makefile.am
@@ -4,10 +4,10 @@ noinst_PROGRAMS = $(clients_programs) 		\
 
 if BUILD_SIMPLE_CLIENTS
 simple_clients_programs = simple-egl simple-shm
-simple_egl_SOURCES = simple-egl.c
+simple_egl_SOURCES = simple-egl.c desktop-shell-protocol.c
 simple_egl_LDADD = $(SIMPLE_CLIENT_LIBS) -lm
 
-simple_shm_SOURCES = simple-shm.c
+simple_shm_SOURCES = simple-shm.c desktop-shell-protocol.c
 simple_shm_LDADD = $(SIMPLE_CLIENT_LIBS)
 endif
 
@@ -33,6 +33,7 @@ AM_CPPFLAGS =					\
 
 libtoytoolkit_a_SOURCES =			\
 	window.c				\
+	desktop-shell-protocol.c		\
 	window.h				\
 	cairo-util.c				\
 	cairo-util.h
diff --git a/clients/simple-egl.c b/clients/simple-egl.c
index 95604de..06043bb 100644
--- a/clients/simple-egl.c
+++ b/clients/simple-egl.c
@@ -33,10 +33,12 @@
 #include <GLES2/gl2.h>
 #include <EGL/egl.h>
 
+#include "desktop-shell-client-protocol.h"
+
 struct display {
 	struct wl_display *display;
 	struct wl_compositor *compositor;
-	struct wl_shell *shell;
+	struct desktop_shell *shell;
 	struct {
 		EGLDisplay dpy;
 		EGLContext ctx;
@@ -208,7 +210,7 @@ create_surface(struct window *window)
 				       window->native,
 				       surface_attribs);
 
-	wl_shell_set_toplevel(display->shell, window->surface);
+	desktop_shell_set_toplevel(display->shell, window->surface);
 
 	ret = eglMakeCurrent(window->display->egl.dpy, window->egl_surface,
 			     window->egl_surface, window->display->egl.ctx);
@@ -289,8 +291,8 @@ display_handle_global(struct wl_display *display, uint32_t id,
 	if (strcmp(interface, "wl_compositor") == 0) {
 		d->compositor =
 			wl_display_bind(display, id, &wl_compositor_interface);
-	} else if (strcmp(interface, "wl_shell") == 0) {
-		d->shell = wl_display_bind(display, id, &wl_shell_interface);
+	} else if (strcmp(interface, "desktop_shell") == 0) {
+		d->shell = wl_display_bind(display, id, &desktop_shell_interface);
 	}
 }
 
diff --git a/clients/simple-shm.c b/clients/simple-shm.c
index a93c203..404839a 100644
--- a/clients/simple-shm.c
+++ b/clients/simple-shm.c
@@ -32,10 +32,12 @@
 #include <wayland-client.h>
 #include <wayland-egl.h>
 
+#include "desktop-shell-client-protocol.h"
+
 struct display {
 	struct wl_display *display;
 	struct wl_compositor *compositor;
-	struct wl_shell *shell;
+	struct desktop_shell *shell;
 	struct wl_shm *shm;
 	uint32_t mask;
 };
@@ -104,7 +106,7 @@ create_window(struct display *display, int width, int height)
 					   WL_SHM_FORMAT_XRGB32,
 					   &window->data);
 
-	wl_shell_set_toplevel(display->shell, window->surface);
+	desktop_shell_set_toplevel(display->shell, window->surface);
 
 	return window;
 }
@@ -149,8 +151,8 @@ display_handle_global(struct wl_display *display, uint32_t id,
 	if (strcmp(interface, "wl_compositor") == 0) {
 		d->compositor =
 			wl_display_bind(display, id, &wl_compositor_interface);
-	} else if (strcmp(interface, "wl_shell") == 0) {
-		d->shell = wl_display_bind(display, id, &wl_shell_interface);
+	} else if (strcmp(interface, "desktop_shell") == 0) {
+		d->shell = wl_display_bind(display, id, &desktop_shell_interface);
 	} else if (strcmp(interface, "wl_shm") == 0) {
 		d->shm = wl_display_bind(display, id, &wl_shm_interface);
 	}
diff --git a/clients/terminal.c b/clients/terminal.c
index 092e069..d1fa87f 100644
--- a/clients/terminal.c
+++ b/clients/terminal.c
@@ -2053,12 +2053,12 @@ static int
 handle_bound_key(struct terminal *terminal,
 		 struct input *input, uint32_t sym, uint32_t time)
 {
-	struct wl_shell *shell;
+	struct wl_transfer_src *src;
 
 	switch (sym) {
 	case XK_C:
-		shell = display_get_shell(terminal->display);
-		terminal->selection = wl_shell_create_selection(shell);
+		src = display_get_transfer_src(terminal->display);
+		terminal->selection = wl_transfer_src_create_selection(src);
 		wl_selection_add_listener(terminal->selection,
 					  &selection_listener, terminal);
 		wl_selection_offer(terminal->selection, "text/plain");
diff --git a/clients/window.c b/clients/window.c
index d75a0ac..7b831d7 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -53,13 +53,15 @@
 #include "wayland-util.h"
 #include "wayland-client.h"
 #include "cairo-util.h"
+#include "desktop-shell-client-protocol.h"
 
 #include "window.h"
 
 struct display {
 	struct wl_display *display;
 	struct wl_compositor *compositor;
-	struct wl_shell *shell;
+	struct desktop_shell *shell;
+	struct wl_transfer_src *transfer_src;
 	struct wl_shm *shm;
 	struct wl_output *output;
 	struct rectangle screen_allocation;
@@ -317,7 +319,6 @@ display_create_egl_image_surface(struct display *display,
 	struct egl_image_surface_data *data;
 	EGLDisplay dpy = display->dpy;
 	cairo_surface_t *surface;
-	EGLConfig config;
 	cairo_content_t content;
 
 	data = malloc(sizeof *data);
@@ -335,11 +336,9 @@ display_create_egl_image_surface(struct display *display,
 
 	if (flags & SURFACE_OPAQUE) {
 		data->device = display->rgb_device;
-		config = display->rgb_config;
 		content = CAIRO_CONTENT_COLOR;
 	} else {
 		data->device = display->argb_device;
-		config = display->premultiplied_argb_config;
 		content = CAIRO_CONTENT_COLOR_ALPHA;
 	}
 
@@ -744,13 +743,13 @@ window_set_type(struct window *window)
 
 	switch (window->type) {
 	case TYPE_FULLSCREEN:
-		wl_shell_set_fullscreen(display->shell, window->surface);
+		desktop_shell_set_fullscreen(display->shell, window->surface);
 		break;
 	case TYPE_TOPLEVEL:
-		wl_shell_set_toplevel(display->shell, window->surface);
+		desktop_shell_set_toplevel(display->shell, window->surface);
 		break;
 	case TYPE_TRANSIENT:
-		wl_shell_set_transient(display->shell, window->surface,
+		desktop_shell_set_transient(display->shell, window->surface,
 				       window->parent->surface,
 				       window->x, window->y, 0);
 		break;
@@ -1247,7 +1246,7 @@ window_handle_button(void *data,
 	    button == BTN_LEFT && state == 1) {
 		switch (location) {
 		case WINDOW_TITLEBAR:
-			wl_shell_move(window->display->shell,
+			desktop_shell_move(window->display->shell,
 				      window->surface, input_device, time);
 			break;
 		case WINDOW_RESIZING_TOP:
@@ -1258,7 +1257,7 @@ window_handle_button(void *data,
 		case WINDOW_RESIZING_TOP_RIGHT:
 		case WINDOW_RESIZING_BOTTOM_LEFT:
 		case WINDOW_RESIZING_BOTTOM_RIGHT:
-			wl_shell_resize(window->display->shell,
+			desktop_shell_resize(window->display->shell,
 					window->surface, input_device, time,
 					location);
 			break;
@@ -1433,14 +1432,14 @@ window_create_drag(struct window *window)
 	cairo_device_flush (window->display->rgb_device);
 	cairo_device_flush (window->display->argb_device);
 
-	return wl_shell_create_drag(window->display->shell);
+	return wl_transfer_src_create_drag(window->display->transfer_src);
 }
 
 void
 window_move(struct window *window, struct input *input, uint32_t time)
 {
 	if (window->display->shell)
-		wl_shell_move(window->display->shell,
+		desktop_shell_move(window->display->shell,
 			      window->surface, input->input_device, time);
 }
 
@@ -1452,7 +1451,7 @@ window_activate_drag(struct wl_drag *drag, struct window *window,
 }
 
 static void
-handle_configure(void *data, struct wl_shell *shell,
+handle_configure(void *data, struct desktop_shell *shell,
 		 uint32_t time, uint32_t edges,
 		 struct wl_surface *surface, int32_t width, int32_t height)
 {
@@ -1483,7 +1482,7 @@ handle_configure(void *data, struct wl_shell *shell,
 	}
 }
 
-static const struct wl_shell_listener shell_listener = {
+static const struct desktop_shell_listener shell_listener = {
 	handle_configure,
 };
 
@@ -1949,9 +1948,11 @@ display_handle_global(struct wl_display *display, uint32_t id,
 		wl_output_add_listener(d->output, &output_listener, d);
 	} else if (strcmp(interface, "wl_input_device") == 0) {
 		display_add_input(d, id);
-	} else if (strcmp(interface, "wl_shell") == 0) {
-		d->shell = wl_display_bind(display, id, &wl_shell_interface);
-		wl_shell_add_listener(d->shell, &shell_listener, d);
+	} else if (strcmp(interface, "desktop_shell") == 0) {
+		d->shell = wl_display_bind(display, id, &desktop_shell_interface);
+		desktop_shell_add_listener(d->shell, &shell_listener, d);
+	} else if (strcmp(interface, "wl_transfer_src") == 0) {
+		d->transfer_src = wl_display_bind(display, id, &wl_transfer_src_interface);
 	} else if (strcmp(interface, "wl_shm") == 0) {
 		d->shm = wl_display_bind(display, id, &wl_shm_interface);
 	} else if (strcmp(interface, "wl_selection_offer") == 0) {
@@ -2219,7 +2220,13 @@ display_get_argb_egl_config(struct display *d)
 	return d->premultiplied_argb_config;
 }
 
-struct wl_shell *
+struct wl_transfer_src *
+display_get_transfer_src(struct display *display)
+{
+	return display->transfer_src;
+}
+
+struct desktop_shell *
 display_get_shell(struct display *display)
 {
 	return display->shell;
diff --git a/clients/window.h b/clients/window.h
index 290c6b9..f890c1a 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -54,9 +54,12 @@ display_get_display(struct display *display);
 struct wl_compositor *
 display_get_compositor(struct display *display);
 
-struct wl_shell *
+struct desktop_shell *
 display_get_shell(struct display *display);
 
+struct wl_transfer_src *
+display_get_transfer_src(struct display *display);
+
 #ifdef EGL_NO_DISPLAY
 EGLDisplay
 display_get_egl_display(struct display *d);
diff --git a/compositor/shell.c b/compositor/shell.c
index 50c80e9..aa92d3e 100644
--- a/compositor/shell.c
+++ b/compositor/shell.c
@@ -30,7 +30,7 @@
 #include "compositor.h"
 #include "desktop-shell-server-protocol.h"
 
-struct wl_shell {
+struct desktop_shell {
 	struct wlsc_compositor *compositor;
 	struct wlsc_shell shell;
 	struct wlsc_surface *panel;
@@ -129,24 +129,24 @@ resize_grab_motion(struct wl_grab *grab,
 	struct wl_surface *surface = &resize->surface->surface;
 	int32_t width, height;
 
-	if (resize->edges & WL_SHELL_RESIZE_LEFT) {
+	if (resize->edges & DESKTOP_SHELL_RESIZE_LEFT) {
 		width = device->grab_x - x + resize->width;
-	} else if (resize->edges & WL_SHELL_RESIZE_RIGHT) {
+	} else if (resize->edges & DESKTOP_SHELL_RESIZE_RIGHT) {
 		width = x - device->grab_x + resize->width;
 	} else {
 		width = resize->width;
 	}
 
-	if (resize->edges & WL_SHELL_RESIZE_TOP) {
+	if (resize->edges & DESKTOP_SHELL_RESIZE_TOP) {
 		height = device->grab_y - y + resize->height;
-	} else if (resize->edges & WL_SHELL_RESIZE_BOTTOM) {
+	} else if (resize->edges & DESKTOP_SHELL_RESIZE_BOTTOM) {
 		height = y - device->grab_y + resize->height;
 	} else {
 		height = resize->height;
 	}
 
 	wl_resource_post_event(resize->resource,
-			       WL_SHELL_CONFIGURE, time, resize->edges,
+			       DESKTOP_SHELL_CONFIGURE, time, resize->edges,
 			       surface, width, height);
 }
 
@@ -197,28 +197,28 @@ wlsc_surface_resize(struct wlsc_surface *es,
 		return 0;
 
 	switch (edges) {
-	case WL_SHELL_RESIZE_TOP:
+	case DESKTOP_SHELL_RESIZE_TOP:
 		pointer = WLSC_POINTER_TOP;
 		break;
-	case WL_SHELL_RESIZE_BOTTOM:
+	case DESKTOP_SHELL_RESIZE_BOTTOM:
 		pointer = WLSC_POINTER_BOTTOM;
 		break;
-	case WL_SHELL_RESIZE_LEFT:
+	case DESKTOP_SHELL_RESIZE_LEFT:
 		pointer = WLSC_POINTER_LEFT;
 		break;
-	case WL_SHELL_RESIZE_TOP_LEFT:
+	case DESKTOP_SHELL_RESIZE_TOP_LEFT:
 		pointer = WLSC_POINTER_TOP_LEFT;
 		break;
-	case WL_SHELL_RESIZE_BOTTOM_LEFT:
+	case DESKTOP_SHELL_RESIZE_BOTTOM_LEFT:
 		pointer = WLSC_POINTER_BOTTOM_LEFT;
 		break;
-	case WL_SHELL_RESIZE_RIGHT:
+	case DESKTOP_SHELL_RESIZE_RIGHT:
 		pointer = WLSC_POINTER_RIGHT;
 		break;
-	case WL_SHELL_RESIZE_TOP_RIGHT:
+	case DESKTOP_SHELL_RESIZE_TOP_RIGHT:
 		pointer = WLSC_POINTER_TOP_RIGHT;
 		break;
-	case WL_SHELL_RESIZE_BOTTOM_RIGHT:
+	case DESKTOP_SHELL_RESIZE_BOTTOM_RIGHT:
 		pointer = WLSC_POINTER_BOTTOM_RIGHT;
 		break;
 	}
@@ -739,33 +739,23 @@ shell_create_selection(struct wl_client *client,
 	wl_client_add_resource(client, &selection->resource);
 }
 
-static const struct wl_shell_interface shell_interface = {
-	shell_move,
-	shell_resize,
-	shell_create_drag,
-	shell_create_selection,
-	shell_set_toplevel,
-	shell_set_transient,
-	shell_set_fullscreen
-};
-
 static void
 handle_background_surface_destroy(struct wl_listener *listener,
 				  struct wl_resource *resource, uint32_t time)
 {
-	struct wl_shell *shell =
-		container_of(listener, struct wl_shell, background_listener);
+	struct desktop_shell *shell =
+		container_of(listener, struct desktop_shell, background_listener);
 
 	fprintf(stderr, "background surface gone\n");
 	shell->background = NULL;
 }
 
 static void
-desktop_shell_set_background(struct wl_client *client,
-			     struct wl_resource *resource,
-			     struct wl_resource *surface_resource)
+shell_set_background(struct wl_client *client, 
+		     struct wl_resource *resource,
+		     struct wl_resource *surface_resource)
 {
-	struct wl_shell *shell = resource->data;
+	struct desktop_shell *shell = resource->data;
 	struct wlsc_surface *surface = surface_resource->data;
 	struct wlsc_output *output =
 		container_of(shell->compositor->output_list.next,
@@ -787,19 +777,19 @@ static void
 handle_panel_surface_destroy(struct wl_listener *listener,
 			     struct wl_resource *resource, uint32_t time)
 {
-	struct wl_shell *shell =
-		container_of(listener, struct wl_shell, panel_listener);
+	struct desktop_shell *shell =
+		container_of(listener, struct desktop_shell, panel_listener);
 
 	fprintf(stderr, "panel surface gone\n");
 	shell->panel = NULL;
 }
 
 static void
-desktop_shell_set_panel(struct wl_client *client,
-			struct wl_resource *resource,
-			struct wl_resource *surface_resource)
+shell_set_panel(struct wl_client *client,
+		struct wl_resource *resource,
+		struct wl_resource *surface_resource)
 {
-	struct wl_shell *shell = resource->data;
+	struct desktop_shell *shell = resource->data;
 	struct wlsc_output *output =
 		container_of(shell->compositor->output_list.next,
 			     struct wlsc_output, link);
@@ -818,15 +808,25 @@ desktop_shell_set_panel(struct wl_client *client,
 }
 
 static const struct desktop_shell_interface desktop_shell_implementation = {
-	desktop_shell_set_background,
-	desktop_shell_set_panel
+	shell_move,
+	shell_resize,
+	shell_set_background,
+	shell_set_panel,
+	shell_set_toplevel,
+	shell_set_transient,
+	shell_set_fullscreen
+};
+
+static const struct wl_transfer_src_interface transfer_src_implementation = {
+	shell_create_drag,
+	shell_create_selection
 };
 
 static void
 move_binding(struct wl_input_device *device, uint32_t time,
 	     uint32_t key, uint32_t button, uint32_t state, void *data)
 {
-	struct wl_shell *shell = data;
+	struct desktop_shell *shell = data;
 	struct wlsc_surface *surface =
 		(struct wlsc_surface *) device->pointer_focus;
 
@@ -845,7 +845,7 @@ static void
 resize_binding(struct wl_input_device *device, uint32_t time,
 	       uint32_t key, uint32_t button, uint32_t state, void *data)
 {
-	struct wl_shell *shell = data;
+	struct desktop_shell *shell = data;
 	struct wlsc_surface *surface =
 		(struct wlsc_surface *) device->pointer_focus;
 	struct wl_resource *resource;
@@ -863,22 +863,22 @@ resize_binding(struct wl_input_device *device, uint32_t time,
 	y = device->grab_y - surface->y;
 
 	if (x < surface->width / 3)
-		edges |= WL_SHELL_RESIZE_LEFT;
+		edges |= DESKTOP_SHELL_RESIZE_LEFT;
 	else if (x < 2 * surface->width / 3)
 		edges |= 0;
 	else
-		edges |= WL_SHELL_RESIZE_RIGHT;
+		edges |= DESKTOP_SHELL_RESIZE_RIGHT;
 
 	if (y < surface->height / 3)
-		edges |= WL_SHELL_RESIZE_TOP;
+		edges |= DESKTOP_SHELL_RESIZE_TOP;
 	else if (y < 2 * surface->height / 3)
 		edges |= 0;
 	else
-		edges |= WL_SHELL_RESIZE_BOTTOM;
+		edges |= DESKTOP_SHELL_RESIZE_BOTTOM;
 
 	resource = /* Find shell resource for surface client */ 0;
 
-	/* ... or use wl_shell_surface */
+	/* ... or use desktop_shell_surface */
 
 	wlsc_surface_resize(surface, (struct wlsc_input_device *) device,
 			    time, edges, resource);
@@ -888,7 +888,7 @@ static void
 activate(struct wlsc_shell *base, struct wlsc_surface *es,
 	 struct wlsc_input_device *device, uint32_t time)
 {
-	struct wl_shell *shell = container_of(base, struct wl_shell, shell);
+	struct desktop_shell *shell = container_of(base, struct desktop_shell, shell);
 	struct wlsc_compositor *compositor = shell->compositor;
 
 	wlsc_surface_activate(es, device, time);
@@ -913,7 +913,7 @@ lock(struct wlsc_shell *shell)
 static void
 attach(struct wlsc_shell *base, struct wlsc_surface *es)
 {
-	struct wl_shell *shell = container_of(base, struct wl_shell, shell);
+	struct desktop_shell *shell = container_of(base, struct desktop_shell, shell);
 	struct wlsc_compositor *compositor = shell->compositor;
 
 	if (es == shell->background) {
@@ -926,22 +926,23 @@ attach(struct wlsc_shell *base, struct wlsc_surface *es)
 }
 
 static void
-bind_shell(struct wl_client *client, void *data, uint32_t version, uint32_t id)
+bind_shell(struct wl_client *client,
+	   void *data, uint32_t version, uint32_t id)
 {
-	struct wl_shell *shell = data;
+	struct desktop_shell *shell = data;
 
-	wl_client_add_object(client, &wl_shell_interface,
-			     &shell_interface, id, shell);
+	wl_client_add_object(client, &desktop_shell_interface,
+			     &desktop_shell_implementation, id, shell);
 }
 
 static void
-bind_desktop_shell(struct wl_client *client,
-		   void *data, uint32_t version, uint32_t id)
+bind_transfer_src(struct wl_client *client,
+		  void *data, uint32_t version, uint32_t id)
 {
-	struct wl_shell *shell = data;
+	struct desktop_shell *shell = data;
 
-	wl_client_add_object(client, &desktop_shell_interface,
-			     &desktop_shell_implementation, id, shell);
+	wl_client_add_object(client, &wl_transfer_src_interface,
+			     &transfer_src_implementation, id, shell);
 }
 
 int
@@ -950,7 +951,7 @@ shell_init(struct wlsc_compositor *ec);
 WL_EXPORT int
 shell_init(struct wlsc_compositor *ec)
 {
-	struct wl_shell *shell;
+	struct desktop_shell *shell;
 
 	shell = malloc(sizeof *shell);
 	if (shell == NULL)
@@ -963,13 +964,12 @@ shell_init(struct wlsc_compositor *ec)
 	shell->shell.attach = attach;
 	shell->shell.set_selection_focus = wlsc_selection_set_focus;
 
-	if (wl_display_add_global(ec->wl_display, &wl_shell_interface,
+	if (wl_display_add_global(ec->wl_display, &desktop_shell_interface,
 				  shell, bind_shell) == NULL)
 		return -1;
 
-	if (wl_display_add_global(ec->wl_display,
-				  &desktop_shell_interface,
-				  shell, bind_desktop_shell) == NULL)
+	if (wl_display_add_global(ec->wl_display, &wl_transfer_src_interface,
+				  shell, bind_transfer_src) == NULL)
 		return -1;
 
 	wlsc_compositor_add_binding(ec, 0, BTN_LEFT, MODIFIER_SUPER,
diff --git a/protocol/desktop-shell.xml b/protocol/desktop-shell.xml
index 438773d..7556ea0 100644
--- a/protocol/desktop-shell.xml
+++ b/protocol/desktop-shell.xml
@@ -1,6 +1,32 @@
 <protocol name="desktop">
 
   <interface name="desktop_shell" version="1">
+    <request name="move">
+      <arg name="surface" type="object" interface="wl_surface"/>
+      <arg name="input_device" type="object" interface="wl_input_device"/>
+      <arg name="time" type="uint"/>
+    </request>
+
+    <enum name="resize">
+      <entry name="none" value="0"/>
+      <entry name="top" value="1"/>
+      <entry name="bottom" value="2"/>
+      <entry name="left" value="4"/>
+      <entry name="top_left" value="5"/>
+      <entry name="bottom_left" value="6"/>
+      <entry name="right" value="8"/>
+      <entry name="top_right" value="9"/>
+      <entry name="bottom_right" value="10"/>
+    </enum>
+
+    <request name="resize">
+      <arg name="surface" type="object" interface="wl_surface"/>
+      <arg name="input_device" type="object" interface="wl_input_device"/>
+      <arg name="time" type="uint"/>
+      <!-- edges is an enum, need to get the values in here -->
+      <arg name="edges" type="uint"/>
+    </request>
+
     <request name="set_background">
       <arg name="surface" type="object" interface="wl_surface"/>
     </request>
@@ -9,6 +35,39 @@
       <arg name="surface" type="object" interface="wl_surface"/>
     </request>
 
+    <!-- Make the surface visible as a toplevel window. -->
+    <request name="set_toplevel">
+      <arg name="surface" type="object" interface="wl_surface"/>
+    </request>
+
+    <!-- Map the surface relative to an existing surface. The x and y
+         arguments specify the locations of the upper left corner of
+         the surface relative to the upper left corner of the parent
+         surface.  The flags argument controls overflow/clipping
+         behaviour when the surface would intersect a screen edge,
+         panel or such.  And possibly whether the offset only
+         determines the initial position or if the surface is locked
+         to that relative position during moves. -->
+    <request name="set_transient">
+      <arg name="surface" type="object" interface="wl_surface"/>
+      <arg name="parent" type="object" interface="wl_surface"/>
+      <arg name="x" type="int"/>
+      <arg name="y" type="int"/>
+      <arg name="flags" type="uint"/>
+    </request>
+
+    <!-- Map the surface as a fullscreen surface.  There are a number
+         of options here: on which output? if the surface size doesn't
+         match the output size, do we scale, change resolution, or add
+         black borders? is that something the client controls?  what
+         about transient surfaces, do they float on top of the
+         fullscreen? what if there's already a fullscreen surface on
+         the output, maybe you can only go fullscreen if you're
+         active?  -->
+    <request name="set_fullscreen">
+      <arg name="surface" type="object" interface="wl_surface"/>
+    </request>
+
     <!-- We'll fold most of wl_shell into this interface and then
          they'll share the configure event.  -->
     <event name="configure">
-- 
1.7.6



More information about the wayland-devel mailing list