From c2f596a06aaa14468285d038f8553ecf87e791ed Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 12 Nov 2014 20:35:53 +0100 Subject: [PATCH] Fix wrong deskshow function Summary: The loop E_CLIENT_REVERSE_FOREACH was used to iconify and uniconify the icons. The worked well for uninconify. But if the first client with the focus gets iconifyed the lower one in the stack will get the focus and will be raised to the top, but the loop will continue with the next of the now iconifyed e_client, so this one will be skipped. Now the forward loop is used to iconify and the reverse to uniconify the e_clients. This fixes T1797 Reviewers: zmike Reviewed By: zmike Subscribers: cedric, cippp Maniphest Tasks: T1797 Differential Revision: https://phab.enlightenment.org/D1655 --- src/bin/e_desk.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/bin/e_desk.c b/src/bin/e_desk.c index 045a086be..58f221174 100644 --- a/src/bin/e_desk.c +++ b/src/bin/e_desk.c @@ -341,23 +341,31 @@ e_desk_deskshow(E_Zone *zone) E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE); desk = e_desk_current_get(zone); - /* uniconify raises windows and changes stacking order - * go top-down to avoid skipping windows - */ - E_CLIENT_REVERSE_FOREACH(zone->comp, ec) + if (desk->deskshow_toggle) { - if (e_client_util_ignored_get(ec)) continue; - if (ec->desk != desk) continue; - if (desk->deskshow_toggle) + /* uniconify raises windows and changes stacking order + * go top-down to avoid skipping windows + */ + E_CLIENT_REVERSE_FOREACH(zone->comp, ec) { + if (e_client_util_ignored_get(ec)) continue; + if (ec->desk != desk) continue; if (ec->deskshow) { ec->deskshow = 0; e_client_uniconify(ec); } } - else + } + else + { + /* + * iconify raises, so we ahve to start from the bottom so we are going forward + */ + E_CLIENT_FOREACH(zone->comp, ec) { + if (e_client_util_ignored_get(ec)) continue; + if (ec->desk != desk) continue; if (ec->iconic) continue; if (ec->netwm.state.skip_taskbar) continue; if (ec->user_skip_winlist) continue;