diff options
author | okan | 2019-03-04 19:28:17 +0000 |
---|---|---|
committer | okan | 2019-03-04 19:28:17 +0000 |
commit | f9cc6bc28fcaadc3f0eea32de200c98ed65671e4 (patch) | |
tree | 3b59621a6066197982d20408c605078bb092a1d2 /kbfunc.c | |
parent | 630b170b88810b2ccb695b6f715b9a415525c926 (diff) | |
download | cwm-f9cc6bc28fcaadc3f0eea32de200c98ed65671e4.tar.gz |
Separate out the menu window from the client resize/move geom window; in each
case, create and destroy on-demand. Isolate more menu specific code.
Diffstat (limited to 'kbfunc.c')
-rw-r--r-- | kbfunc.c | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -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: kbfunc.c,v 1.162 2019/02/25 16:40:49 okan Exp $ + * $OpenBSD: kbfunc.c,v 1.163 2019/03/04 19:28:18 okan Exp $ */ #include <sys/types.h> @@ -166,8 +166,8 @@ kbfunc_client_move_mb(void *ctx, struct cargs *cargs) CurrentTime) != GrabSuccess) return; - menu_windraw(sc, cc->win, "%4d, %-4d", cc->geom.x, cc->geom.y); - + screen_prop_win_create(sc, cc->win); + screen_prop_win_draw(sc, "%+5d%+5d", cc->geom.x, cc->geom.y); while (move) { XMaskEvent(X_Dpy, MOUSEMASK, &ev); switch (ev.type) { @@ -190,8 +190,8 @@ kbfunc_client_move_mb(void *ctx, struct cargs *cargs) cc->geom.y + cc->geom.h + (cc->bwidth * 2), area.y, area.y + area.h, sc->snapdist); client_move(cc); - menu_windraw(sc, cc->win, - "%4d, %-4d", cc->geom.x, cc->geom.y); + screen_prop_win_draw(sc, + "%+5d%+5d", cc->geom.x, cc->geom.y); break; case ButtonRelease: move = 0; @@ -200,8 +200,7 @@ kbfunc_client_move_mb(void *ctx, struct cargs *cargs) } if (ltime) client_move(cc); - XUnmapWindow(X_Dpy, sc->menu.win); - XReparentWindow(X_Dpy, sc->menu.win, sc->rootwin, 0, 0); + screen_prop_win_destroy(sc); XUngrabPointer(X_Dpy, CurrentTime); } @@ -255,7 +254,8 @@ kbfunc_client_resize_mb(void *ctx, struct cargs *cargs) CurrentTime) != GrabSuccess) return; - menu_windraw(sc, cc->win, "%4d x %-4d", cc->dim.w, cc->dim.h); + screen_prop_win_create(sc, cc->win); + screen_prop_win_draw(sc, "%4d x %-4d", cc->dim.w, cc->dim.h); while (resize) { XMaskEvent(X_Dpy, MOUSEMASK, &ev); switch (ev.type) { @@ -269,7 +269,7 @@ kbfunc_client_resize_mb(void *ctx, struct cargs *cargs) cc->geom.h = ev.xmotion.y; client_applysizehints(cc); client_resize(cc, 1); - menu_windraw(sc, cc->win, + screen_prop_win_draw(sc, "%4d x %-4d", cc->dim.w, cc->dim.h); break; case ButtonRelease: @@ -279,8 +279,7 @@ kbfunc_client_resize_mb(void *ctx, struct cargs *cargs) } if (ltime) client_resize(cc, 1); - XUnmapWindow(X_Dpy, sc->menu.win); - XReparentWindow(X_Dpy, sc->menu.win, sc->rootwin, 0, 0); + screen_prop_win_destroy(sc); XUngrabPointer(X_Dpy, CurrentTime); /* Make sure the pointer stays within the window. */ |