]> git.mdlowis.com Git - proto/labwc.git/commitdiff
view: handle initially minimized views (minimal fix)
authorJohn Lindgren <john@jlindgren.net>
Wed, 23 Apr 2025 16:03:20 +0000 (12:03 -0400)
committerJohan Malm <johanmalm@users.noreply.github.com>
Wed, 23 Apr 2025 19:18:22 +0000 (20:18 +0100)
The view->impl functions do not directly support mapping a view while
minimized. Instead, mark it as not minimized, map it, and then minimize
it again.

Fixes: #2627
src/view.c

index e17a883c2fca55f6ffbdf666cfabfe50f6ed559b..89743ecdb5b8efd922bd19303a0fdd9b291d0ffe 100644 (file)
@@ -2436,7 +2436,18 @@ static void
 handle_map(struct wl_listener *listener, void *data)
 {
        struct view *view = wl_container_of(listener, view, mappable.map);
-       view->impl->map(view);
+       if (view->minimized) {
+               /*
+                * The view->impl functions do not directly support
+                * mapping a view while minimized. Instead, mark it as
+                * not minimized, map it, and then minimize it again.
+                */
+               view->minimized = false;
+               view->impl->map(view);
+               view_minimize(view, true);
+       } else {
+               view->impl->map(view);
+       }
 }
 
 static void