diff --git a/WINGs/WINGs/WINGsP.h.in b/WINGs/WINGs/WINGsP.h.in index d30247b..ede002a 100644 --- a/WINGs/WINGs/WINGsP.h.in +++ b/WINGs/WINGs/WINGsP.h.in @@ -474,6 +474,7 @@ typedef struct W_EventBackend { void (*flush)(void *ectx, Bool discard); int (*fd)(void *ectx); void (*put_back)(void *ectx, WMEvent *ev); + void (*post_dispatch)(void *ectx, WMEvent *ev, struct W_View *toplevel); } W_EventBackend; extern const W_EventBackend W_EventBackendX11; diff --git a/src/actions.c b/src/actions.c index 1203e66..5bb2e98 100644 --- a/src/actions.c +++ b/src/actions.c @@ -1427,8 +1427,6 @@ void wIconifyWindow(WWindow *wwin) if (owner && owner->flags.miniaturized) return; } - if (!wwin->frame) - return; /* Phase 71: Wayland — no frame for iconify */ present = WIN_WORKSPACE(wwin) == wwin->screen_ptr->current_workspace; @@ -1497,7 +1495,8 @@ void wIconifyWindow(WWindow *wwin) #ifdef USE_ANIMATIONS if (getAnimationGeometry(wwin, &ix, &iy, &iw, &ih)) animateResize(wwin->screen_ptr, wwin->frame_x, wwin->frame_y, - wwin->frame->core->width, wwin->frame->core->height, ix, iy, iw, ih); + wwin->frame ? (int)wwin->frame->core->width : (int)wwin->client.width, + wwin->frame ? (int)wwin->frame->core->height : (int)wwin->client.height, ix, iy, iw, ih); #endif } @@ -1579,10 +1578,6 @@ void wDeiconifyWindow(WWindow *wwin) w_global.ignore_workspace_change = False; return; } - if (!wwin->frame) { - w_global.ignore_workspace_change = False; - return; /* Phase 71: Wayland — no frame for deiconify */ - } if (wwin->transient_for != WNATIVE_NONE && wwin->transient_for != wwin->screen_ptr->root_win) { WWindow *owner = recursiveTransientFor(wwin); @@ -1590,7 +1585,8 @@ void wDeiconifyWindow(WWindow *wwin) if (owner && owner->flags.miniaturized) { wDeiconifyWindow(owner); wSetFocusTo(wwin->screen_ptr, wwin); - wRaiseFrame(wwin->frame->core); + if (owner->frame) + wRaiseFrame(owner->frame->core); w_global.ignore_workspace_change = False; return; } @@ -1628,8 +1624,10 @@ void wDeiconifyWindow(WWindow *wwin) if (!wwin->flags.shaded) wm_backend->window_map(wwin->client_win); - wm_backend->window_map(wwin->frame->core->window); - wRaiseFrame(wwin->frame->core); + if (wwin->frame) { + wm_backend->window_map(wwin->frame->core->window); + wRaiseFrame(wwin->frame->core); + } if (!wwin->flags.shaded) wClientSetState(wwin, NormalState, None); @@ -1703,7 +1701,8 @@ static void hideWindow(WIcon *icon, int icon_x, int icon_y, WWindow *wwin, int a if (!wwin->screen_ptr->flags.startup && !wPreferences.no_animations && !wwin->flags.skip_next_animation && animate) { animateResize(wwin->screen_ptr, wwin->frame_x, wwin->frame_y, - wwin->frame->core->width, wwin->frame->core->height, + wwin->frame ? (int)wwin->frame->core->width : (int)wwin->client.width, + wwin->frame ? (int)wwin->frame->core->height : (int)wwin->client.height, icon_x, icon_y, icon->core->width, icon->core->height); } #else diff --git a/src/backend/wayland/wl_backend.c b/src/backend/wayland/wl_backend.c index 815eb06..7b76a8b 100644 --- a/src/backend/wayland/wl_backend.c +++ b/src/backend/wayland/wl_backend.c @@ -7301,8 +7301,23 @@ static void wl_noop_prop_set_icon_tile(WScreen *scr, RImage *image) { (void)scr; static void wl_noop_prop_cleanup(WNativeWindow root) { (void)root; } static void wl_noop_client_restore(WWindow *wwin) { (void)wwin; } -static void wl_noop_client_set_state(WWindow *wwin, int state, WNativeWindow icon_win) -{ (void)wwin; (void)state; (void)icon_win; } +static void wl_client_set_state(WWindow *wwin, int state, WNativeWindow icon_win) +{ + (void)icon_win; + struct wl_toplevel_view *v = wl_find_view_by_id(wwin->client_win); + if (!v) + return; + switch (state) { + case 3: /* IconicState */ + if (v->scene_node) + wlr_scene_node_set_enabled(&v->scene_node->node, false); + break; + case 1: /* NormalState */ + if (v->scene_node) + wlr_scene_node_set_enabled(&v->scene_node->node, true); + break; + } +} static void wl_client_set_maximized(WNativeWindow win, int maximized) { @@ -8147,7 +8162,7 @@ const WMBackend wl_backend = { .prop_set_icon_tile = wl_noop_prop_set_icon_tile, .prop_cleanup = wl_noop_prop_cleanup, .client_restore = wl_noop_client_restore, - .client_set_state = wl_noop_client_set_state, + .client_set_state = wl_client_set_state, .client_set_maximized = wl_client_set_maximized, .client_send_protocol = wl_client_send_protocol, .client_kill = wl_client_kill_impl,