From 780f1c23d3b5e7199e077f7fcbe0ef0cde379c76 Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Mon, 16 Mar 2020 16:57:19 -0400 Subject: [PATCH] stubbed out some thoughts for better mouse handling --- anvil.c | 6 ++++-- mons.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/anvil.c b/anvil.c index fe3da5b..3f9ebde 100644 --- a/anvil.c +++ b/anvil.c @@ -30,13 +30,14 @@ static void xbtnpress(XEvent* e) { XButtonEvent* ev = &(e->xbutton); Client* c = client_get(e->xbutton.window); + X.start_x = ev->x_root; + X.start_y = ev->y_root; if (c && (ev->window == c->frame)) { +// client_btnclick(c, ev->button, ev->x, ev->y); if (ev->button == Button1) { client_raise(c); - X.start_x = ev->x_root; - X.start_y = ev->y_root; if (ev->y > (TITLE_HEIGHT + BORDER_WIDTH)) { X.mode = M_RESIZE; @@ -68,6 +69,7 @@ static void xbtnmotion(XEvent* e) Client* c = client_get(ev->window); if (c && (ev->window == c->frame)) { +// client_btnmove(c, ev->button, ev->x, ev->y); if (PRESSED(ev->state, Button1)) { if (X.mode != M_RESIZE) diff --git a/mons.c b/mons.c index 2191bdf..6a3c213 100644 --- a/mons.c +++ b/mons.c @@ -61,6 +61,20 @@ void mons_addclient(Client* c) else { Column* col = pickcol(mon->cspace->columns, ptrx - mon->x); + /* + Client* c = find_max(col->clients); + if (c) + { + c->next = col->clients; + col->clients = c; + } + else + { + shrink the window; + fill the gap with the new window; + } + */ + c->next = col->clients; col->clients = c; /* TODO: tile the window approriately */ -- 2.51.0