From: Manuel Bachmann <[email protected]>

2 things were wrong with the minimization code :
- if the minimized surface was fullscreen, the shell would keep
  its fullscreen mode on and only display a black background ;
- keyboard focus was unset, but pointer focus was not.

On the other hand, make sure a fullscreen surface gets centered
again when refocused with Mod+Tab.

Author: Manuel Bachmann <[email protected]>
Author: Nicolas Guyomard <[email protected]>
Signed-off-by: Manuel Bachmann <[email protected]>
---
 desktop-shell/shell.c |   16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 5900c4d..830c25d 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -2657,13 +2657,20 @@ set_minimized(struct weston_surface *surface)
        weston_layer_entry_remove(&view->layer_link);
        weston_layer_entry_insert(&shsurf->shell->minimized_layer.view_list, 
&view->layer_link);
 
+       if (shsurf->state.fullscreen)
+               unset_fullscreen(shsurf);
+
        drop_focus_state(shsurf->shell, current_ws, view->surface);
        wl_list_for_each(seat, &shsurf->shell->compositor->seat_list, link) {
                if (!seat->keyboard)
                        continue;
                focus = weston_surface_get_main_surface(seat->keyboard->focus);
-               if (focus == view->surface)
+               if (focus == view->surface) {
                        weston_keyboard_set_focus(seat->keyboard, NULL);
+                       weston_pointer_set_focus(seat->pointer, NULL,
+                                                wl_fixed_from_int(0),
+                                                wl_fixed_from_int(0));
+               }
        }
 
        shell_surface_update_child_surface_layers(shsurf);
@@ -5937,8 +5944,11 @@ switcher_next(struct switcher *switcher)
                view->alpha = 1.0;
 
        shsurf = get_shell_surface(switcher->current);
-       if (shsurf && shsurf->state.fullscreen)
-               shsurf->fullscreen.black_view->alpha = 1.0;
+       if (shsurf && shsurf->state.fullscreen) {
+               center_on_output(shsurf->view, shsurf->fullscreen_output);
+               if (shsurf->fullscreen.black_view)
+                       shsurf->fullscreen.black_view->alpha = 1.0;
+       }
 }
 
 static void
-- 
1.7.10.4

_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to