From b3848afd887737f81cf761e3e5d7ce16fdd3891b Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 16 Sep 2007 15:55:37 +0200 Subject: [PATCH] allow tiled window to be resize/moved, setting them to the floating state --- event.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/event.c b/event.c index b2c3231e4..bb01850fd 100644 --- a/event.c +++ b/event.c @@ -184,16 +184,27 @@ handle_event_buttonpress(XEvent * e, awesome_config *awesomeconf) focus(c->display, c->screen, &dc[c->screen], c, ev->same_screen, &awesomeconf[c->screen]); if(CLEANMASK(ev->state, c->screen) != awesomeconf[c->screen].modkey) return; - if(ev->button == Button1 && (IS_ARRANGE(floating) || c->isfloating)) + if(ev->button == Button1) { - restack(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen]); + if(IS_ARRANGE(floating) || c->isfloating) + uicb_togglefloating(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen], NULL); + else + restack(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen]); movemouse(c, &awesomeconf[c->screen]); } else if(ev->button == Button2) - uicb_zoom(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen], NULL); - else if(ev->button == Button3 && (IS_ARRANGE(floating) || c->isfloating) && !c->isfixed) { - restack(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen]); + if(IS_ARRANGE(tile) && !c->isfixed && c->isfloating) + uicb_togglefloating(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen], NULL); + else + uicb_zoom(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen], NULL); + } + else if(ev->button == Button3) + { + if(IS_ARRANGE(floating) && !c->isfloating) + uicb_togglefloating(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen], NULL); + else + restack(e->xany.display, c->screen, &dc[c->screen], &awesomeconf[c->screen]); resizemouse(c, &awesomeconf[c->screen]); } }