commit 835bb73
uint
·
2026-07-14 18:09:20 +0000 UTC
parent 74a0ab1
Expose redrawing event
2 files changed,
+7,
-0
+1,
-0
1@@ -63,6 +63,7 @@ typedef enum {
2 MAUS_EV_MOUSE_BUTTON,
3 MAUS_EV_MOUSE_MOTION,
4 MAUS_EV_RESIZE,
5+ MAUS_EV_REDRAW, /* TODO: MAUS_EV_REDRAW for windows */
6 } MausEventType;
7
8 typedef struct {
+6,
-0
1@@ -193,6 +193,12 @@ static bool handle_event(XEvent* xev, MausEvent* ev, Maus* mw)
2 MausMouseButton mbtype;
3
4 switch (xev->type) {
5+ case Expose:
6+ if (xev->xexpose.count != 0)
7+ return false;
8+ ev->type = MAUS_EV_REDRAW;
9+ return true;
10+
11 case ClientMessage:
12 if ((Atom)xev->xclient.data.l[0] == be->atoms[MAUS_ATOM_WM_DELETE_WINDOW]) {
13 ev->type = MAUS_EV_CLOSE;