aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorokan2019-02-28 13:11:53 +0000
committerokan2019-02-28 13:11:53 +0000
commitf0f3f957861987532ec41c77ea3d04cec1e43938 (patch)
tree774ed75abb458b1db5a34e97229fea06c42bcc0f
parent35d7a7dabf8e1cb8891b2661e5798de4f9f06f87 (diff)
downloadcwm-f0f3f957861987532ec41c77ea3d04cec1e43938.tar.gz
Selectively hide and show clients based on state; merge client_unhide() and
client_show().
Diffstat (limited to '')
-rw-r--r--calmwm.h3
-rw-r--r--client.c19
-rw-r--r--group.c10
3 files changed, 12 insertions, 20 deletions
diff --git a/calmwm.h b/calmwm.h
index aac949d..b9e002f 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: calmwm.h,v 1.364 2019/02/25 16:40:49 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.365 2019/02/28 13:11:53 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -435,7 +435,6 @@ void client_toggle_skip_taskbar(struct client_ctx *);
void client_toggle_sticky(struct client_ctx *);
void client_toggle_vmaximize(struct client_ctx *);
void client_transient(struct client_ctx *);
-void client_unhide(struct client_ctx *);
void client_urgency(struct client_ctx *);
void client_vtile(struct client_ctx *);
void client_wm_hints(struct client_ctx *);
diff --git a/client.c b/client.c
index fc02996..e86ded2 100644
--- a/client.c
+++ b/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: client.c,v 1.251 2019/02/23 19:17:17 okan Exp $
+ * $OpenBSD: client.c,v 1.252 2019/02/28 13:11:53 okan Exp $
*/
#include <sys/types.h>
@@ -128,7 +128,7 @@ client_init(Window win, struct screen_ctx *sc, int active)
if (client_get_wm_state(cc) == IconicState)
client_hide(cc);
else
- client_unhide(cc);
+ client_show(cc);
if (mapped) {
if (cc->gc) {
@@ -527,10 +527,10 @@ client_hide(struct client_ctx *cc)
{
XUnmapWindow(X_Dpy, cc->win);
- if (cc->flags & CLIENT_ACTIVE)
+ if (cc->flags & CLIENT_ACTIVE) {
+ cc->flags &= ~CLIENT_ACTIVE;
xu_ewmh_net_active_window(cc->sc, None);
-
- cc->flags &= ~CLIENT_ACTIVE;
+ }
cc->flags |= CLIENT_HIDDEN;
client_set_wm_state(cc, IconicState);
}
@@ -538,15 +538,6 @@ client_hide(struct client_ctx *cc)
void
client_show(struct client_ctx *cc)
{
- if (cc->flags & CLIENT_HIDDEN)
- client_unhide(cc);
- else
- client_raise(cc);
-}
-
-void
-client_unhide(struct client_ctx *cc)
-{
XMapRaised(X_Dpy, cc->win);
cc->flags &= ~CLIENT_HIDDEN;
diff --git a/group.c b/group.c
index c07d2d3..af7ceaf 100644
--- a/group.c
+++ b/group.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: group.c,v 1.129 2019/02/25 16:40:49 okan Exp $
+ * $OpenBSD: group.c,v 1.130 2019/02/28 13:11:53 okan Exp $
*/
#include <sys/types.h>
@@ -67,7 +67,8 @@ group_hide(struct group_ctx *gc)
screen_updatestackingorder(gc->sc);
TAILQ_FOREACH(cc, &gc->clientq, group_entry) {
- if (!(cc->flags & CLIENT_STICKY))
+ if (!(cc->flags & CLIENT_STICKY) &&
+ !(cc->flags & CLIENT_HIDDEN))
client_hide(cc);
}
}
@@ -78,8 +79,9 @@ group_show(struct group_ctx *gc)
struct client_ctx *cc;
TAILQ_FOREACH(cc, &gc->clientq, group_entry) {
- if (!(cc->flags & CLIENT_STICKY))
- client_unhide(cc);
+ if (!(cc->flags & CLIENT_STICKY) &&
+ (cc->flags & CLIENT_HIDDEN))
+ client_show(cc);
}
group_restack(gc);