commit 426cc37

Devine Lu Linvega  ·  2026-01-08 18:27:39 +0000 UTC
parent 8c31cf1
Flush X window on init to prevent black flicker
1 files changed,  +5, -6
+5, -6
 1@@ -1287,6 +1287,8 @@ emu_init(void)
 2 	if(emu.fd_timer < 0)
 3 		return !fprintf(stderr, "timerfd_create: failed\n");
 4 	timerfd_settime(emu.fd_timer, 0, &screen_tspec, NULL);
 5+	XMapWindow(emu.dpy, emu.win);
 6+	XFlush(emu.dpy);
 7 	return 1;
 8 }
 9 
10@@ -1296,12 +1298,9 @@ emu_run(void)
11 	int has_input, has_eof, has_sent = 1;
12 	char expirations[8], coninp[CONINBUFSIZE];
13 	struct pollfd fds[3];
14-	fds[0].fd = emu.fd_x11;
15-	fds[0].events = POLLIN;
16-	fds[1].fd = emu.fd_timer;
17-	fds[1].events = POLLIN;
18-	fds[2].fd = STDIN_FILENO;
19-	fds[2].events = POLLIN | POLLHUP;
20+	fds[0].fd = emu.fd_x11, fds[0].events = POLLIN;
21+	fds[1].fd = emu.fd_timer, fds[1].events = POLLIN;
22+	fds[2].fd = STDIN_FILENO, fds[2].events = POLLIN | POLLHUP;
23 	while(!dev[0x0f]) {
24 		if(poll(fds, 3, -1) <= 0)
25 			continue;