clients: Add support for the minimize button
authorJasper St. Pierre <jstpierre@mecheye.net>
Wed, 19 Feb 2014 00:18:42 +0000 (19:18 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 19 Feb 2014 00:20:18 +0000 (19:20 -0500)
clients/window.c
clients/window.h

index 3ea5027..5c324d3 100644 (file)
@@ -2354,8 +2354,10 @@ frame_handle_status(struct window_frame *frame, struct input *input,
        if (status & FRAME_STATUS_REPAINT)
                widget_schedule_redraw(frame->widget);
 
-       if (status & FRAME_STATUS_MINIMIZE)
-               fprintf(stderr,"Minimize stub\n");
+       if (status & FRAME_STATUS_MINIMIZE) {
+               window_set_minimized(window);
+               frame_status_clear(frame->frame, FRAME_STATUS_MINIMIZE);
+       }
 
        if (status & FRAME_STATUS_MENU) {
                window_show_frame_menu(window, input, time);
@@ -4205,6 +4207,15 @@ window_set_maximized(struct window *window, int maximized)
 }
 
 void
+window_set_minimized(struct window *window)
+{
+       if (!window->xdg_surface)
+               return;
+
+       xdg_surface_set_minimized(window->xdg_surface);
+}
+
+void
 window_set_user_data(struct window *window, void *data)
 {
        window->user_data = data;
index 7ec3537..38d574f 100644 (file)
@@ -377,6 +377,9 @@ void
 window_set_maximized(struct window *window, int maximized);
 
 void
+window_set_minimized(struct window *window);
+
+void
 window_set_user_data(struct window *window, void *data);
 
 void *