From d824b961b096c6925dde65659bb5a6842385d2aa Mon Sep 17 00:00:00 2001 From: garbeam Date: Fri, 9 Dec 2005 01:42:52 +0200 Subject: [PATCH] fixed detach annoyances, identified problem with visual attaching clients from detached clients --- cmd/wm/client.c | 5 ++++- cmd/wm/wm.c | 10 +++++----- rc/wmirc | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/cmd/wm/client.c b/cmd/wm/client.c index 26a8b8f4..532ab222 100644 --- a/cmd/wm/client.c +++ b/cmd/wm/client.c @@ -333,11 +333,14 @@ void attach_client(Client * c) } void detach_client(Client *c) { + Page *p; if (c->frame) c->frame->area->layout->detach(c->frame->area, c); if (c->destroyed) destroy_client(c); - sel_page(get_sel_page()); + p = get_sel_page(); + sel_page(p); + draw_page(p); } Client *get_sel_client() diff --git a/cmd/wm/wm.c b/cmd/wm/wm.c index 2f9f69a8..cd195aa2 100644 --- a/cmd/wm/wm.c +++ b/cmd/wm/wm.c @@ -28,7 +28,7 @@ static void _attach_client(void *obj, char *cmd); static void _detach_client(void *obj, char *cmd); static void _close_client(void *obj, char *cmd); static void pager(void *obj, char *cmd); -static void icons(void *obj, char *cmd); +static void detached_clients(void *obj, char *cmd); /* action table for /ctl namespace */ Action wm_acttbl[] = { @@ -40,7 +40,7 @@ Action wm_acttbl[] = { {"close", _close_client}, {"quit", quit}, {"pager", pager}, - {"icons", icons}, + {"detached clients", detached_clients}, {0, 0} }; @@ -279,7 +279,7 @@ static void pager(void *obj, char *cmd) } } -static void draw_icons() +static void draw_detached_clients() { unsigned int i, ic, ir, tw, th, rows, cols, size; int dx, dy; @@ -317,7 +317,7 @@ static void draw_icons() } -static void icons(void *obj, char *cmd) +static void detached_clients(void *obj, char *cmd) { XEvent ev; int i, n; @@ -329,7 +329,7 @@ static void icons(void *obj, char *cmd) XClearWindow(dpy, transient); XMapRaised(dpy, transient); - draw_icons(); + draw_detached_clients(); while (XGrabKeyboard (dpy, transient, True, GrabModeAsync, GrabModeAsync, CurrentTime) != GrabSuccess) diff --git a/rc/wmirc b/rc/wmirc index 1bb6f8a2..313cdafd 100644 --- a/rc/wmirc +++ b/rc/wmirc @@ -130,7 +130,7 @@ kbind normal $MODKEY-C-w,y wmirc kbind normal $MODKEY-t 'extern xterm ''+sb'' -bg ''#000000'' -fg ''#ffffff'' -cr ''#ffffff'' -sl 4000 -fn -artwiz-smoothansi-*-*-*-*-*-*-*-*-*-*-*-*' kbind normal $MODKEY-d 'wmir write /wm/ctl detach' kbind normal $MODKEY-a 'wmir write /wm/ctl attach' -kbind normal $MODKEY-S-a 'wmir write /wm/ctl icons' +kbind normal $MODKEY-S-a 'wmir write /wm/ctl ''detached clients'' kbind normal $MODKEY-Return 'wmir write /wm/sel/ctl ''select zoomed''' kbind normal $MODKEY-C-y 'wmir write /wm/ctl new' kbind normal $MODKEY-u 'wmir write /wm/sel/layout/sel/frame/sel/locked 0'