From ddc7c581fe02f0f2632ac206d938e4d952e598b4 Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Wed, 10 Aug 2011 17:27:08 +0200 Subject: [PATCH] Add todo --- wmfs2/TODO | 25 +++++++++++++++++++++++++ wmfs2/src/event.c | 15 +++++++++++---- wmfs2/src/wmfs.c | 8 +------- wmfs2/src/wmfs.h | 7 ++++++- 4 files changed, 43 insertions(+), 12 deletions(-) create mode 100755 wmfs2/TODO diff --git a/wmfs2/TODO b/wmfs2/TODO new file mode 100755 index 0000000..7658783 --- /dev/null +++ b/wmfs2/TODO @@ -0,0 +1,25 @@ +WMFS's Infobar/Element low-level structure + +[ ] +[ SCR33N ] => [ Infobar ] +[ ] [ (head) ] => [ Element ] + | [ (head) ] => [ SLIST_HEAD(Barwin) bars; + | | [ ElemTypes type; { ElemTag, ElemLayout, ElemSelbar, ElemStatus, (ElemSystray?) } + ... | [ Geo geo; + ... [ STAILQ_ENTRY(Elements) next; + | + ... + +This will be used with some functions, depending of element type : + +Element* elem_tag_init(Infobar *i) + layout + selbar + statustext + systray? + +void element_tag_update(Element *e) + layout + selbar + statustext + systray? diff --git a/wmfs2/src/event.c b/wmfs2/src/event.c index 4ffa077..be77595 100755 --- a/wmfs2/src/event.c +++ b/wmfs2/src/event.c @@ -1,4 +1,4 @@ -/* + /* * wmfs2 by Martin Duquesnoy { for(i = 2011; i < 2111; ++i) ©(i); } * For license, see COPYING. */ @@ -7,6 +7,7 @@ #include "util.h" #include "wmfs.h" #include "client.h" +#include "barwin.h" #define EVDPY(e) (e)->xany.display @@ -35,6 +36,7 @@ static void event_clientmessageevent(XEvent *e) { XClientMessageEvent *ev = &e->xclient; + Client *c; } static void @@ -197,10 +199,15 @@ event_keypress(XEvent *e) static void event_expose(XEvent *e) { - /* - * XExposeEvent *ev = &e->xexpose; - */ + XExposeEvent *ev = &e->xexpose; + Barwin *b; + SLIST_FOREACH(b, &W->h.barwin, next) + if(b->win == ev->window) + { + barwin_refresh(b); + return; + } } static void diff --git a/wmfs2/src/wmfs.c b/wmfs2/src/wmfs.c index a7ea899..9728432 100755 --- a/wmfs2/src/wmfs.c +++ b/wmfs2/src/wmfs.c @@ -203,9 +203,7 @@ wmfs_loop(void) { XEvent ev; - W->running = true; - - while(W->running || XPending(W->dpy)) + while(XPending(W->dpy)) { XNextEvent(W->dpy, &ev); HANDLE_EVENT(&ev); @@ -232,8 +230,6 @@ wmfs_init(void) void wmfs_quit(void) { - W->running = false; - /* X stuffs */ XFreeGC(W->dpy, W->gc); XFreeFontSet(W->dpy, W->font.fontset); @@ -267,7 +263,5 @@ main(int argc, char **argv) wmfs_loop(); - wmfs_quit(); - return 1; } diff --git a/wmfs2/src/wmfs.h b/wmfs2/src/wmfs.h index b507c10..2681374 100755 --- a/wmfs2/src/wmfs.h +++ b/wmfs2/src/wmfs.h @@ -58,6 +58,12 @@ struct Barwin SLIST_ENTRY(Barwin) next; }; +/* Infobar */ +struct Infobar +{ + Barwin *bar; +}; + /* Screen */ struct Scr33n { @@ -125,7 +131,6 @@ struct Config struct Wmfs { /* X11 stuffs */ - bool running; Display *dpy; Window root; int xscreen, xdepth;