Martin Duquesnoy 12 years ago
parent
commit
ddc7c581fe
4 changed files with 43 additions and 12 deletions
  1. 25 0
      wmfs2/TODO
  2. 11 4
      wmfs2/src/event.c
  3. 1 7
      wmfs2/src/wmfs.c
  4. 6 1
      wmfs2/src/wmfs.h

+ 25 - 0
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?

+ 11 - 4
wmfs2/src/event.c

@@ -1,4 +1,4 @@
-/*
+  /*
  *  wmfs2 by Martin Duquesnoy <xorg62@gmail.com> { 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

+ 1 - 7
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;
 }

+ 6 - 1
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;