Thread: [Pipmak-Devel] Two Bugs
Status: Alpha
Brought to you by:
cwalther
From: Aidan G. <wgs...@ih...> - 2008-01-21 08:07:15
Attachments:
startGrab.patch.bz2
saveDialogUnGrab.patch.bz2
|
Hello, I have (I think) fixed the bug with the mouse grabbing. If I remove the call to SDL_WM_GrabInput() that's right before the main for(;;) loop, then it seems to always be possible to get the mouse out of the window, even with edge resistance. Also, when I bring up the save game dialog with the 'S' key, Pipmak doesn't give me my mouse back, and I have to go to a virtual console and kill Pipmak. If I add a call to SDL_WM_GrabInput() to ungrab the mouse in the Lua C function which is called when the 'S' key is pressed, that seems to solve this problem. I can not be sure that I have fixed this bugs, and haven't simply masked them, nor can I be sure that I haven't broken something somewhere else. But what the heck, here are the patches with my modifications, (I also added parentheses around the tests for an if statement (you'll see where), just to suppress a complier warning. No other reason.) let me know what you think. -Aidan |
From: Urs H. <ur...@an...> - 2008-01-21 18:37:47
|
Hi Aidan Gauland wrote: > I have (I think) fixed the bug with the mouse grabbing. If I remove > the call to SDL_WM_GrabInput() that's right before the main for(;;) > loop, then it seems to always be possible to get the mouse out of the > window, even with edge resistance. Yes, your patch fixes the problem on my machine: Debian linux etch (using KDE). Good work! (I think that it is anyway better behaviour not to grab the mouse when Pipmak starts and the mouse is outside the window.) > Also, when I bring up the save game dialog with the 'S' key, Pipmak > doesn't give me my mouse back, and I have to go to a virtual console > and > kill Pipmak. If I add a call to SDL_WM_GrabInput() to ungrab the > mouse in the Lua C function which is called when the 'S' key is > pressed, that seems to solve this problem. I experience the same problem and again, your patch fixes it. |
From: Christian W. <cwa...@gm...> - 2008-01-22 14:11:43
|
Aidan Gauland wrote: > I have (I think) fixed the bug with the mouse grabbing. If I remove the > call to SDL_WM_GrabInput() that's right before the main for(;;) loop, > then it seems to always be possible to get the mouse out of the window, > even with edge resistance. Thanks, I've committed that. That grab must have been a relic from the past, the automatic grab when the mouse moves inside the window is indeed sufficient. > Also, when I bring up the save game dialog with the 'S' key, Pipmak > doesn't give me my mouse back, and I have to go to a virtual console and > kill Pipmak. If I add a call to SDL_WM_GrabInput() to ungrab the mouse > in the Lua C function which is called when the 'S' key is pressed, that > seems to solve this problem. Right, that was an oversight. The other two dialogs (open project and open saved game) have the ungrab. For some reason it worked here on Mac OS X without it. This is committed, thanks! > I also added parentheses around the tests for an if statement (you'll > see where), just to suppress a complier warning. No other reason. GCC doesn't trust us to know that 'and' is stronger than 'or'? Oh well... applied. -Christian |
From: Aidan G. <wgs...@ih...> - 2008-01-27 00:57:47
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> Ahhh, one other thing: If the user brings up a dialog, and then dismisses it, Pipmak seems to do the same thing with grabbing the mouse, even if it's not in the window, and then it is impossible to get the mouse out of the window, until the user brings up another dialog, and closes it when it is over the Pipmak window (so the mouse will be in the Pipmak window when it regrabs the mouse).<br> <br> I did a case-insensitive search for a call to SDL_WMGrabInput(), but only found the one in main.c for the mouse motion event, and two in pipmakLuaLib.c before dialogs are opened. So how is Pipmak grabbing the mouse without calling that function?<br> <br> Oh, and I have the -Wall option set for GCC, because I'm still learning about syntatical gotchas in C. I don't think it gives warnings about parentheses around logical operators normally.<br> <br> -Aidan<br> <br> Christian Walther wrote: <blockquote cite="mid:fn4tcd$pdv$1...@ge..." type="cite"> <pre wrap="">Aidan Gauland wrote: </pre> <blockquote type="cite"> <pre wrap="">I have (I think) fixed the bug with the mouse grabbing. If I remove the call to SDL_WM_GrabInput() that's right before the main for(;;) loop, then it seems to always be possible to get the mouse out of the window, even with edge resistance. </pre> </blockquote> <pre wrap=""><!----> Thanks, I've committed that. That grab must have been a relic from the past, the automatic grab when the mouse moves inside the window is indeed sufficient. </pre> <blockquote type="cite"> <pre wrap="">Also, when I bring up the save game dialog with the 'S' key, Pipmak doesn't give me my mouse back, and I have to go to a virtual console and kill Pipmak. If I add a call to SDL_WM_GrabInput() to ungrab the mouse in the Lua C function which is called when the 'S' key is pressed, that seems to solve this problem. </pre> </blockquote> <pre wrap=""><!----> Right, that was an oversight. The other two dialogs (open project and open saved game) have the ungrab. For some reason it worked here on Mac OS X without it. This is committed, thanks! </pre> <blockquote type="cite"> <pre wrap="">I also added parentheses around the tests for an if statement (you'll see where), just to suppress a complier warning. No other reason. </pre> </blockquote> <pre wrap=""><!----> GCC doesn't trust us to know that 'and' is stronger than 'or'? Oh well... applied. -Christian ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. <a class="moz-txt-link-freetext" href="http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/">http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/</a> _______________________________________________ Pipmak-Devel mailing list <a class="moz-txt-link-abbreviated" href="mailto:Pip...@li...">Pip...@li...</a> <a class="moz-txt-link-freetext" href="news://news.gmane.org/gmane.games.devel.pipmak.devel">news://news.gmane.org/gmane.games.devel.pipmak.devel</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/pipmak-devel">https://lists.sourceforge.net/lists/listinfo/pipmak-devel</a> </pre> </blockquote> </body> </html> |
From: Christian W. <cwa...@gm...> - 2008-01-27 14:15:04
|
Aidan Gauland wrote: > Ahhh, one other thing: If the user brings up a dialog, and then > dismisses it, Pipmak seems to do the same thing with grabbing the mouse, > even if it's not in the window, and then it is impossible to get the > mouse out of the window, until the user brings up another dialog, and > closes it when it is over the Pipmak window (so the mouse will be in the > Pipmak window when it regrabs the mouse). I can't reproduce this - everything seems to work correctly here on Fedora Core 4 with SDL 1.2.13 (perhaps I should try with a less ancient distro some time). So I'm afraid you're on your own with fixing this... > I did a case-insensitive search for a call to SDL_WMGrabInput(), but > only found the one in main.c for the mouse motion event, and two in > pipmakLuaLib.c before dialogs are opened. So how is Pipmak grabbing the > mouse without calling that function? I have 8 total occurences of SDL_WM_GrabInput (2 in pipmakLuaLib.c, 6 in main.c), but none that would explain your observation. > Oh, and I have the -Wall option set for GCC, because I'm still learning > about syntatical gotchas in C. I don't think it gives warnings about > parentheses around logical operators normally. I thought I had -Wall too, but it turns out I only had -Wmost, which explicitly excludes -Wparentheses. I'll change that to -Wall and see how far I get until it annoys me. -Christian |