wlt: theme: prevent move/resize requests when maximized/fullscreen
authorDavid Herrmann <dh.herrmann@gmail.com>
Wed, 6 Mar 2013 15:30:31 +0000 (16:30 +0100)
committerDavid Herrmann <dh.herrmann@gmail.com>
Wed, 6 Mar 2013 15:30:31 +0000 (16:30 +0100)
We should let the user move or resize the window while it is fullscreen or
maximized. This depends on the compositor to stop pending move/resize
requests when maximizing or setting a window fullscreen.

We can implement some "snap away from edges" behavior that allows to move
or resize while maximized. This will "unmaximize" the window if you move
it more than a given threshold. However, that's not needed now so lets do
that later when the wl_shell system is fully figured out.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
src/wlt_theme.c

index c76693c..63e8033 100644 (file)
@@ -493,6 +493,11 @@ static void widget_pointer_button(struct wlt_widget *widget,
                wlt_window_schedule_redraw(theme->wnd);
        }
 
+       /* prevent resize/move during fullscreen/maximized */
+       if (wlt_window_is_maximized(theme->wnd) ||
+           wlt_window_is_fullscreen(theme->wnd))
+               return;
+
        switch (theme->pointer_loc) {
        case LOC_RESIZE_LEFT:
                wlt_window_resize(theme->wnd, WL_SHELL_SURFACE_RESIZE_LEFT);