changeset: 70:9b0522eedb36
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Wed Mar 21 14:43:00 2007 +0100
summary: eliminating waitforevent()
diff -r 2810bce547d0 -r 9b0522eedb36 main.c
--- a/main.c Wed Mar 21 12:57:07 2007 +0100
+++ b/main.c Wed Mar 21 14:43:00 2007 +0100
@@ -112,12 +112,17 @@ initwin(void) {
XSizeHints sh;
XWMHints wmh;
XClassHint ch;
+ XEvent ev;
win = XCreateSimpleWindow(dpy, root, 0, 0, ww, wh, 0, dc.bg[0], dc.bg[0]);
XSelectInput(dpy, win, StructureNotifyMask);
XMapWindow(dpy, win);
/* Wait for the window to be mapped */
- waitforevent(MapNotify);
+ for(;;) {
+ XNextEvent(dpy, &ev);
+ if(ev.type == MapNotify)
+ break;
+ }
dc.gc = XCreateGC(dpy, win, 0, NULL);
XSetForeground(dpy, dc.gc, dc.fg[0]);
XSetBackground(dpy, dc.gc, dc.bg[0]);
diff -r 2810bce547d0 -r 9b0522eedb36 st.h
--- a/st.h Wed Mar 21 12:57:07 2007 +0100
+++ b/st.h Wed Mar 21 14:43:00 2007 +0100
@@ -80,7 +80,6 @@ char *estrdup(const char *str);
char *estrdup(const char *str);
/* vt.c */
-void waitforevent(int event_type);
void settextattrs(Glyph l);
void redrawscreen(void);
void redrawscreenf(void);
diff -r 2810bce547d0 -r 9b0522eedb36 vt.c
--- a/vt.c Wed Mar 21 12:57:07 2007 +0100
+++ b/vt.c Wed Mar 21 14:43:00 2007 +0100
@@ -779,16 +779,6 @@ showcursor(void) {
}
void
-waitforevent(int event_type) {
- XEvent e;
- for(;;) {
- XNextEvent(dpy, &e);
- if(e.type == event_type)
- break;
- }
-}
-
-void
wrapline(void) {
while(curr_col > screen_cols) {
curr_col -= screen_cols;
@@ -807,4 +797,3 @@ insert(unsigned char c) {
text_screen[curr_row-1].line[curr_col-1] = text_attrs;
text_screen[curr_row-1].needs_update = 1;
}
-
Received on Thu Mar 22 2007 - 14:52:55 UTC
This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:56:21 UTC