changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: games/doom: fix white window issue on exit

changeset 5067: 863e33d86749
parent 5066: 813115218568
child 5068: fa3700dc38f9
author: cinap_lenrek@felloff.net
date: Sat, 30 Jan 2016 19:11:33 +0100
files: sys/src/games/doom/i_video.c
description: games/doom: fix white window issue on exit

make kbdproc() and mouseproc() share fd table with the main proc
and not explicitely close the file descriptors. so /dev/mouse gets
closed *after* /dev/draw/new to avoid the white window refresh issue.
     1.1--- a/sys/src/games/doom/i_video.c
     1.2+++ b/sys/src/games/doom/i_video.c
     1.3@@ -46,13 +46,13 @@ void I_InitGraphics(void)
     1.4 	center = addpt(screen->r.min, Pt(Dx(screen->r)/2, Dy(screen->r)/2));
     1.5 	grabout = insetrect(screen->r, Dx(screen->r)/8);
     1.6 
     1.7-	if((pid = rfork(RFPROC|RFMEM|RFFDG)) == 0){
     1.8+	if((pid = rfork(RFPROC|RFMEM)) == 0){
     1.9 		kbdproc();
    1.10 		exits(nil);
    1.11 	}
    1.12 	kbdpid = pid;
    1.13 
    1.14-	if((pid = rfork(RFPROC|RFMEM|RFFDG)) == 0){
    1.15+	if((pid = rfork(RFPROC|RFMEM)) == 0){
    1.16 		mouseproc();
    1.17 		exits(nil);
    1.18 	}
    1.19@@ -300,7 +300,6 @@ kbdproc(void)
    1.20 		}
    1.21 		strcpy(buf2, buf);
    1.22 	}
    1.23-	close(kfd);
    1.24 }
    1.25 
    1.26 static void
    1.27@@ -356,6 +355,5 @@ mouseproc(void)
    1.28 			break;
    1.29 		}
    1.30 	}
    1.31-	close(fd);
    1.32 }
    1.33