diff options
| author | Enno Boland (tox) <tox@s01.de> | 2009-09-07 14:21:26 +0200 |
|---|---|---|
| committer | Enno Boland (tox) <tox@s01.de> | 2009-09-07 14:21:26 +0200 |
| commit | 2f2e21c0bb53e60c663ad617a186ca4f1d50f83a (patch) | |
| tree | b02e2c56f4dadf78c6007d5fefb7204908761946 /tabbed.c | |
| parent | aa5f91e0d54333e4da247528f5eacb721710d16d (diff) | |
| download | tabbed-2f2e21c0bb53e60c663ad617a186ca4f1d50f83a.tar.gz | |
event system works, some code arranging
Diffstat (limited to 'tabbed.c')
| -rw-r--r-- | tabbed.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -17,7 +17,7 @@ /* macros */ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define LENGTH(x) (sizeof x / sizeof x[0]) -#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask)) +#define CLEANMASK(mask) (mask & ~(numlockmask|LockMask)) enum { ColFG, ColBG, ColLast }; /* color */ @@ -50,12 +50,16 @@ typedef struct { } font; } DC; /* draw context */ -typedef struct Client Client; -struct Client { +typedef struct Client { char name[256]; struct Client *next; Window win; -}; +} Client; + +typedef struct Listener { + int fd; + struct Listener *next; +} Listener; /* function declarations */ static void cleanup(void); @@ -209,24 +213,23 @@ keypress(XEvent *e) { void move(const Arg *arg) { - + puts("move to nth tab"); } void newtab(const Arg *arg) { - + puts("opening new tab"); } void rotate(const Arg *arg) { - + puts("next/prev tab"); } void run(void) { XEvent ev; - /* main event loop, also reads status text from stdin */ XSync(dpy, False); while(running) { XNextEvent(dpy, &ev); @@ -260,7 +263,7 @@ setup(void) { win = XCreateSimpleWindow(dpy, root, wx, wy, ww, wh, 0, dc.norm[ColFG], dc.norm[ColBG]); XSelectInput(dpy, win, StructureNotifyMask|PointerMotionMask| - ButtonReleaseMask|ButtonPressMask|ExposureMask| + ButtonPressMask|ExposureMask|KeyPressMask| LeaveWindowMask); wmh = XAllocWMHints(); wmh->input = False; |