project-navigation
Personal tools

Author Topic: Fullscreen mouse grab  (Read 4497 times)

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Fullscreen mouse grab
« on: December 26, 2013, 02:39:29 pm »
Is there any reason that mouse grab is disabled in fullscreen mode?

I have multiple monitors, but run the game in full screen on a single monitor. In order to enable mouse grab after starting the game, I need to go into the options, disable fullscreen, enable mouse grab and just don't restart. I also re-enable fullscreen (also without restarting) otherwise the next time I restart the game it will appear windowed.

I have commented out the code stopping input grabbing in fullscreen mode and done some initial testing without any noticeable problems. I'll post if I come across any.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Fullscreen mouse grab
« Reply #1 on: December 26, 2013, 06:41:12 pm »
ctrl+g might be a shortcut.

there was a reason afair - but I don't remember the background of it. I would rather not change this for 2.5 before we release. But we can either talk about 2.5.1 or 2.6 to change that.

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Fullscreen mouse grab
« Reply #2 on: December 27, 2013, 07:57:35 am »
Ctrl+G doesn't work in fullscreen so you still have to go to the options to disable fullscreen to toggle it with Ctrl+G.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Fullscreen mouse grab
« Reply #3 on: December 27, 2013, 12:17:42 pm »
well, that is something i would accept a patch for even for 2.5. let ctrl+g work in fullscreen might be useful.

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Fullscreen mouse grab
« Reply #4 on: December 27, 2013, 12:41:51 pm »
well, that is something i would accept a patch for even for 2.5. let ctrl+g work in fullscreen might be useful.
This just removes the else block containing the warning and turns the full screen test into the else block. Works for me so far.
Code: [Select]
diff --git a/src/client/input/cl_input.cpp b/src/client/input/cl_input.cpp
index 4407034..ad15cf2 100644
--- a/src/client/input/cl_input.cpp
+++ b/src/client/input/cl_input.cpp
@@ -941,8 +941,7 @@ void IN_Frame (void)
 #else
                        SDL_WM_GrabInput(SDL_GRAB_OFF);
 #endif
-               /* don't allow grabbing the input in fullscreen mode */
-               } else if (!vid_fullscreen->integer) {
+               } else {
                        /* grab the pointer */
                        Com_Printf("Switch grab input on\n");
 #if SDL_VERSION_ATLEAST(2,0,0)
@@ -950,9 +949,6 @@ void IN_Frame (void)
 #else
                        SDL_WM_GrabInput(SDL_GRAB_ON);
 #endif
-               } else {
-                       Com_Printf("No input grabbing in fullscreen mode!\n");
-                       Cvar_SetValue("vid_grabmouse", 0);
                }
        }
 
« Last Edit: December 27, 2013, 12:44:15 pm by Grug »

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Fullscreen mouse grab
« Reply #5 on: January 13, 2014, 05:57:01 am »
well, that is something i would accept a patch for even for 2.5. let ctrl+g work in fullscreen might be useful.
I just cleared my local changes and noticed that this hasn't gone in to the 2.5 branch yet

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: Fullscreen mouse grab
« Reply #6 on: January 13, 2014, 04:45:59 pm »
Pushed it to both master and 2.5. Sorry for the delay.

You must be a rather qualified dev if you can find the line of code you need even in the ufoai src ;)

Needless to say that such persons are of course invited to deliver more patches of even join the team.

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Fullscreen mouse grab
« Reply #7 on: January 13, 2014, 06:20:53 pm »
Pushed it to both master and 2.5. Sorry for the delay.
No probs. Was just checking it wasn't forgotten.

You must be a rather qualified dev if you can find the line of code you need even in the ufoai src ;)
lol, thanks. Wasn't super hard, just a little grepping.

Needless to say that such persons are of course invited to deliver more patches of even join the team.
Yeah, I've been thinking I'd love to join the team. Been looking around for little bits and pieces here and there to submit patches for, but I also wanted to really play the game seriously (rather than just here and there for a week or so every couple of releases) before requesting to join the team more officially.

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: Fullscreen mouse grab
« Reply #8 on: January 14, 2014, 04:09:55 am »
Take your time playing. A dev should know the game he is programming ;)

Looking for bugfixes all by yourself is tough. With a little help from the other teammembers it's much easier. And that's part of the fun...

Offline Grug

  • Rookie
  • ***
  • Posts: 56
    • View Profile
Re: Fullscreen mouse grab
« Reply #9 on: January 14, 2014, 09:10:31 am »
Take your time playing. A dev should know the game he is programming ;)
Indeed!

Looking for bugfixes all by yourself is tough. With a little help from the other teammembers it's much easier. And that's part of the fun...
Sure, certainly planning on interacting with the other devs once I join the team (I'm actually lurking in IRC incognito)...

I wasn't actively looking for bugs to fix, just playing the game and fixing things as I came across them that's all. ;-)