shithub: qk1

Download patch

ref: 774702b72beca0424f7998754e2f258dbb7086a6
parent: aa377eccbe2f49395b65cb83fe68e857e08c144f
author: Konstantinn Bonnet <qu7uux@gmail.com>
date: Tue Mar 10 19:51:31 EDT 2015

crude mouse ungrab when toggling main menu

--- a/README
+++ b/README
@@ -58,7 +58,6 @@
 	- net_9p.c
 	- cd_9.c,net_udp.c,net_dgrm.c: actuallyport
 	- manpages
-	- ungrab mouse when entering console or menus a la games/doom (IN_Grabm())
 	- cleanse *_9.c from linux legacy
 	- fix potential fp exceptions in code rather than ignoring them?
 	- g '/\* FIXME'
--- a/in_9.c
+++ b/in_9.c
@@ -247,7 +247,7 @@
 
 	if(mouseon == on)
 		return;
-	if(mouseon = on){
+	if(mouseon = on && m_windowed.value){
 		if((fd = open("/dev/cursor", ORDWR|OCEXEC)) < 0){
 			Con_Printf("IN_Grabm:open: %r\n");
 			return;
--- a/menu.c
+++ b/menu.c
@@ -226,6 +226,7 @@
 {
 	m_entersound = true;
 
+	IN_Grabm(0);
 	if (key_dest == key_menu)
 	{
 		if (m_state != m_main)
@@ -294,6 +295,7 @@
 		cls.demonum = m_save_demonum;
 		if (cls.demonum != -1 && !cls.demoplayback && cls.state != ca_connected)
 			CL_NextDemo ();
+		IN_Grabm(1);
 		break;
 
 	case K_DOWNARROW:
@@ -401,6 +403,7 @@
 				Cbuf_AddText ("disconnect\n");
 			Cbuf_AddText ("maxplayers 1\n");
 			Cbuf_AddText ("map start\n");
+			IN_Grabm(1);
 			break;
 
 		case 1:
@@ -528,6 +531,7 @@
 
 	// issue the load command
 		Cbuf_AddText (va ("load s%d\n", load_cursor) );
+		IN_Grabm(1);
 		return;
 
 	case K_UPARROW: