mirror of
https://github.com/0intro/wmii
synced 2024-11-29 00:53:09 +03:00
began new container type for areas
This commit is contained in:
parent
a89682c17e
commit
806a6ea150
@ -323,8 +323,10 @@ void gravitate(Client * c, unsigned int tabh, unsigned int bw, int invert)
|
||||
void attach_client(Client * c)
|
||||
{
|
||||
Area *a = 0;
|
||||
Frame *old;
|
||||
if (!page)
|
||||
alloc_page();
|
||||
old = SELFRAME(page[sel]);
|
||||
/* transient stuff */
|
||||
a = SELAREA;
|
||||
if (c && c->trans) {
|
||||
@ -332,8 +334,9 @@ void attach_client(Client * c)
|
||||
if (t && t->frame)
|
||||
a = t->frame->area;
|
||||
}
|
||||
|
||||
a->layout->attach(a, c);
|
||||
if (old)
|
||||
draw_frame(old);
|
||||
invoke_wm_event(def[WM_EVENT_PAGE_UPDATE]);
|
||||
}
|
||||
|
||||
|
@ -63,6 +63,7 @@ static void handle_buttonpress(XEvent * e)
|
||||
Client *c;
|
||||
XButtonPressedEvent *ev = &e->xbutton;
|
||||
Frame *f = win_to_frame(ev->window);
|
||||
|
||||
if (f) {
|
||||
handle_frame_buttonpress(ev, f);
|
||||
return;
|
||||
@ -76,6 +77,7 @@ static void handle_buttonpress(XEvent * e)
|
||||
if (c->frame) { /* client is attached */
|
||||
ev->state &= valid_mask;
|
||||
if (ev->state & Mod1Mask) {
|
||||
Align align;
|
||||
if (!c->frame->area->page->sel)
|
||||
XRaiseWindow(dpy, c->frame->win);
|
||||
switch (ev->button) {
|
||||
@ -83,13 +85,9 @@ static void handle_buttonpress(XEvent * e)
|
||||
mouse_move(c->frame);
|
||||
break;
|
||||
case Button3:
|
||||
{
|
||||
Align align = xy_to_align(&c->rect, ev->x, ev->y);
|
||||
if (align == CENTER)
|
||||
mouse_move(c->frame);
|
||||
else
|
||||
mouse_resize(c->frame, align);
|
||||
}
|
||||
align = xy_to_align(&c->rect, ev->x, ev->y);
|
||||
if (align == CENTER) mouse_move(c->frame);
|
||||
else mouse_resize(c->frame, align);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -120,23 +118,16 @@ static void handle_configurerequest(XEvent * e)
|
||||
tabh = tab_height(f);
|
||||
}
|
||||
if (ev->value_mask & CWStackMode) {
|
||||
if (wc.stack_mode == Above)
|
||||
XRaiseWindow(dpy, c->win);
|
||||
else
|
||||
ev->value_mask &= ~CWStackMode;
|
||||
if (wc.stack_mode == Above) XRaiseWindow(dpy, c->win);
|
||||
else ev->value_mask &= ~CWStackMode;
|
||||
}
|
||||
gravitate(c, tabh ? tabh : bw, bw, 1);
|
||||
|
||||
if (ev->value_mask & CWX)
|
||||
c->rect.x = ev->x;
|
||||
if (ev->value_mask & CWY)
|
||||
c->rect.y = ev->y;
|
||||
if (ev->value_mask & CWWidth)
|
||||
c->rect.width = ev->width;
|
||||
if (ev->value_mask & CWHeight)
|
||||
c->rect.height = ev->height;
|
||||
if (ev->value_mask & CWBorderWidth)
|
||||
c->border = ev->border_width;
|
||||
if (ev->value_mask & CWX) c->rect.x = ev->x;
|
||||
if (ev->value_mask & CWY) c->rect.y = ev->y;
|
||||
if (ev->value_mask & CWWidth) c->rect.width = ev->width;
|
||||
if (ev->value_mask & CWHeight) c->rect.height = ev->height;
|
||||
if (ev->value_mask & CWBorderWidth) c->border = ev->border_width;
|
||||
|
||||
gravitate(c, tabh ? tabh : bw, bw, 0);
|
||||
|
||||
@ -144,8 +135,7 @@ static void handle_configurerequest(XEvent * e)
|
||||
f->rect.x = wc.x = c->rect.x - bw;
|
||||
f->rect.y = wc.y = c->rect.y - (tabh ? tabh : bw);
|
||||
f->rect.width = wc.width = c->rect.width + 2 * bw;
|
||||
f->rect.height = wc.height =
|
||||
c->rect.height + bw + (tabh ? tabh : bw);
|
||||
f->rect.height = wc.height = c->rect.height + bw + (tabh ? tabh : bw);
|
||||
wc.border_width = 1;
|
||||
wc.sibling = None;
|
||||
wc.stack_mode = ev->detail;
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
include ../config.mk
|
||||
|
||||
SRC = array.c emalloc.c estrdup.c strlcat.c strlcpy.c strtonum.c tokenize.c
|
||||
SRC = container.c emalloc.c estrdup.c strlcat.c strlcpy.c strtonum.c tokenize.c
|
||||
|
||||
OBJ = ${SRC:.c=.o}
|
||||
|
||||
|
@ -15,7 +15,25 @@
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
/* array.c */
|
||||
/* container.c */
|
||||
typedef struct Container Container;
|
||||
typedef struct CItem CItem;
|
||||
|
||||
struct CItem {
|
||||
void *item;
|
||||
CItem *prev;
|
||||
CItem *next;
|
||||
};
|
||||
|
||||
struct Container {
|
||||
CItem *list;
|
||||
CItem *stack;
|
||||
} Container;
|
||||
|
||||
void attach_item
|
||||
void *item_at(
|
||||
|
||||
|
||||
void **attach_item_end(void **old, void *item, size_t size_item);
|
||||
void **attach_item_begin(void **old, void *item, size_t size_item);
|
||||
void **detach_item(void **old, void *item, size_t size_item);
|
||||
|
@ -7,6 +7,10 @@
|
||||
|
||||
#include "cext.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void **attach_item_begin(void **old, void *item, size_t size_item)
|
||||
{
|
||||
int i, size_old;
|
Loading…
Reference in New Issue
Block a user