shell: Do not set none role for applications w/o appid
[src/agl-compositor.git] / src / desktop.c
index 3b83d4c..0e1a989 100644 (file)
 
 #include "agl-shell-desktop-server-protocol.h"
 
-#if 0
-static struct weston_output *
-get_default_output(struct weston_compositor *compositor)
-{
-       if (wl_list_empty(&compositor->output_list))
-               return NULL;
-
-       return wl_container_of(compositor->output_list.next,
-                              struct weston_output, link);
-}
-#endif
-
 static void
 desktop_advertise_app(struct wl_listener *listener, void *data)
 {
@@ -356,6 +344,19 @@ desktop_committed(struct weston_desktop_surface *dsurface,
            !wl_list_empty(&surface->ivi->desktop_clients))
                wl_signal_emit(&surface->signal_advertise_app, surface);
 
+       /* this repaint schedule is needed to allow resizing to work with the
+        * help of the hidden layer:
+        *
+        * 1. add the view in the hidden layer and send out correct dimensions
+        * 2. clients changes its dimensions
+        * 3. client commits with the new dimensions
+        *
+        * For desktop and fullscreen, desktop_surface_added() sends the
+        * dimensions from the beginning so applications no need to resize, but
+        * if that weren't the case we still need this in.
+        */
+       weston_compositor_schedule_repaint(surface->ivi->compositor);
+
        switch (surface->role) {
        case IVI_SURFACE_ROLE_DESKTOP:
        case IVI_SURFACE_ROLE_REMOTE:
@@ -461,8 +462,10 @@ ivi_shell_destroy(struct wl_listener *listener, void *data)
        struct ivi_compositor *ivi = container_of(listener,
                                struct ivi_compositor, destroy_listener);
 
-       weston_desktop_destroy(ivi->desktop);
+       ivi_shell_finalize(ivi);
        ivi_compositor_destroy_pending_surfaces(ivi);
+
+       weston_desktop_destroy(ivi->desktop);
        wl_list_remove(&listener->link);
 }