[PATCH weston] Install stubs for minimize request and maximize events.

Scott Moreau oreaus at gmail.com
Tue Oct 16 23:01:06 PDT 2012


---
 clients/simple-egl.c     | 14 +++++++++++++-
 clients/simple-shm.c     | 14 +++++++++++++-
 clients/simple-touch.c   | 14 +++++++++++++-
 clients/window.c         | 20 +++++++++++++++++++-
 src/compositor-wayland.c | 14 +++++++++++++-
 src/shell.c              |  8 ++++++++
 6 files changed, 79 insertions(+), 5 deletions(-)

diff --git a/clients/simple-egl.c b/clients/simple-egl.c
index 8823362..43b4719 100644
--- a/clients/simple-egl.c
+++ b/clients/simple-egl.c
@@ -245,10 +245,22 @@ handle_popup_done(void *data, struct wl_shell_surface *shell_surface)
 {
 }
 
+static void
+handle_maximize(void *data, struct wl_shell_surface *shell_surface)
+{
+}
+
+static void
+handle_unmaximize(void *data, struct wl_shell_surface *shell_surface)
+{
+}
+
 static const struct wl_shell_surface_listener shell_surface_listener = {
 	handle_ping,
 	handle_configure,
-	handle_popup_done
+	handle_popup_done,
+	handle_maximize,
+	handle_unmaximize
 };
 
 static void
diff --git a/clients/simple-shm.c b/clients/simple-shm.c
index d03bed6..0088ddc 100644
--- a/clients/simple-shm.c
+++ b/clients/simple-shm.c
@@ -107,10 +107,22 @@ handle_popup_done(void *data, struct wl_shell_surface *shell_surface)
 {
 }
 
+static void
+handle_maximize(void *data, struct wl_shell_surface *shell_surface)
+{
+}
+
+static void
+handle_unmaximize(void *data, struct wl_shell_surface *shell_surface)
+{
+}
+
 static const struct wl_shell_surface_listener shell_surface_listener = {
 	handle_ping,
 	handle_configure,
-	handle_popup_done
+	handle_popup_done,
+	handle_maximize,
+	handle_unmaximize
 };
 
 static struct window *
diff --git a/clients/simple-touch.c b/clients/simple-touch.c
index 0eeb8f9..37bc3dc 100644
--- a/clients/simple-touch.c
+++ b/clients/simple-touch.c
@@ -231,10 +231,22 @@ handle_popup_done(void *data, struct wl_shell_surface *shell_surface)
 {
 }
 
+static void
+handle_maximize(void *data, struct wl_shell_surface *shell_surface)
+{
+}
+
+static void
+handle_unmaximize(void *data, struct wl_shell_surface *shell_surface)
+{
+}
+
 static const struct wl_shell_surface_listener shell_surface_listener = {
 	handle_ping,
 	handle_configure,
-	handle_popup_done
+	handle_popup_done,
+	handle_maximize,
+	handle_unmaximize
 };
 
 static void
diff --git a/clients/window.c b/clients/window.c
index c029691..f6bcc7a 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -2925,10 +2925,28 @@ handle_popup_done(void *data, struct wl_shell_surface *shell_surface)
 	menu_destroy(menu);
 }
 
+static void
+handle_maximize(void *data, struct wl_shell_surface *shell_surface)
+{
+	struct window *window = data;
+
+	window_set_maximized(window, window->type != TYPE_MAXIMIZED);
+}
+
+static void
+handle_unmaximize(void *data, struct wl_shell_surface *shell_surface)
+{
+	struct window *window = data;
+
+	window_set_maximized(window, window->type != TYPE_MAXIMIZED);
+}
+
 static const struct wl_shell_surface_listener shell_surface_listener = {
 	handle_ping,
 	handle_configure,
-	handle_popup_done
+	handle_popup_done,
+	handle_maximize,
+	handle_unmaximize
 };
 
 void
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index 56759fc..a58c21c 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -431,10 +431,22 @@ shell_surface_popup_done(void *data, struct wl_shell_surface *shell_surface)
 {
 }
 
+static void
+shell_surface_maximize(void *data, struct wl_shell_surface *shell_surface)
+{
+}
+
+static void
+shell_surface_unmaximize(void *data, struct wl_shell_surface *shell_surface)
+{
+}
+
 static const struct wl_shell_surface_listener shell_surface_listener = {
 	shell_surface_ping,
 	shell_surface_configure,
-	shell_surface_popup_done
+	shell_surface_popup_done,
+	shell_surface_maximize,
+	shell_surface_unmaximize
 };
 
 /* Events received from the wayland-server this compositor is client of: */
diff --git a/src/shell.c b/src/shell.c
index cef4011..a89d411 100644
--- a/src/shell.c
+++ b/src/shell.c
@@ -1613,6 +1613,13 @@ shell_surface_set_maximized(struct wl_client *client,
 }
 
 static void
+shell_surface_set_minimized(struct wl_client *client,
+			    struct wl_resource *resource)
+{
+	/* TODO: Minimize surface */
+}
+
+static void
 black_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy);
 
 static struct weston_surface *
@@ -1907,6 +1914,7 @@ static const struct wl_shell_surface_interface shell_surface_implementation = {
 	shell_surface_set_fullscreen,
 	shell_surface_set_popup,
 	shell_surface_set_maximized,
+	shell_surface_set_minimized,
 	shell_surface_set_title,
 	shell_surface_set_class
 };
-- 
1.7.11.7



More information about the wayland-devel mailing list