Don't un-grab mouse when taking screenshots (fixes #18) #40

Merged
merged 2 commits into from Nov 12, 2012

Projects

None yet

3 participants

@DanielGibson
dhewm member

On windows un-grabbing (or possibly re-grabbing) the mouse seems to
mess up the view angly (view is centered afterwards), see
#18
That's fixed by not releasing the mouse (there is no reason to do that
anyway).

@DanielGibson DanielGibson Don't un-grab mouse when taking screenshots (fixes #18)
On windows un-grabbing (or possibly re-grabbing) the mouse seems to
mess up the view angly (view is centered afterwards), see
dhewm#18
That's fixed by not releasing the mouse (there is no reason to do that
anyway).
844cd2d
@andre-d

Awesome, thanks

@motorsep

After introducing this fix I noticed random switching to full screen. I am not sure if it's related to the fix, but I haven't seen it happening before (at least on Linux).

@andre-d

Flip-flop between the two commits, does it definitely only happen with this commit?

@motorsep

I've never seen that issue before. I happens randomly, but persistently. Usually I pull down console, type 'quit', hit Enter and end up in the full screen mode instead of quitting. It happens on Windows and Linux.

I've been told that issue is in here void idRenderSystemLocal::TakeScreenshot as last parameter in the function (renderView_t *ref) turns into NULL; an not in the line 1087 session->UpdateScreen(); where we put (false).

I don't know, but it's something to look into :)

@DanielGibson
dhewm member

I really can't reproduce that behavior, even on winxp (in virtualbox) and it doesn't make any sense that my change should do this (the changed code is only ever reached when creating screenshots, videos or envshots, not when opening the console).

Anyway, could anyone else try to reproduce this? I was told (by motorsep) it happens on both Linux and Windows. He uses nvidia binary drivers, maybe that has something to do with it.

So please just apply the patch (possibly by hand, it's just one line), start a game (in windowed mode), open the console and enter random commands, maybe take a screenshot, reopen the console or whatever in between.

@motorsep

Most of the cases I had happened after playing a map (typing 'quit' and hitting Enter) or after running dmap and then trying to load the resulted map as 'map testmaps\blah.map' and hitting Enter.

@DanielGibson
dhewm member

ok, I could reproduce it on windows (did I already mention it's awesome that I can run dhewm3 in winxp in vbox on linux? ;-)):

  • start dhewm3
  • alt-tab to another window
  • go back to dhewm3 window
  • open console, enter command

but that also happens without my fix.

@motorsep

It could be Alt-Tab thing. As I recall, I didn't have to Alt-Tab in Doom 3, but in SS2 I always alt tab when tuning maps and materials.

@DanielGibson
dhewm member
@motorsep

Tried several times doing that on Linux. Can't reproduce. After the last fix it happens extremely seldom. Will try on Win when I reboot. Will report later.

@DanielGibson
dhewm member
@motorsep

I only reverted RenderSystem_init.cpp and I still can't get it to happen on Linux. Signed and unsigned int could have contributed to the issue, but there is no way I am going to revert all that :/

@DanielGibson
dhewm member

this should fix the fullscreen-after-alt-tab problem (at least it does for me).
The SDL2 code is untested, would be nice if someone could try to compile it (if it compiles it should work) to make sure I didn't miss anything.

@DanielGibson DanielGibson Unset key modifiers when regaining focus to unset ALT
There used to be a bug (discussed in #40), that ALT was still set after
using ALT-Tab. Thus when next pressing enter fullscreen was toggled.
This should now be fixed by unsetting the modifiers when focus is
regained (SDL_ACTIVEEVENT or SDL_WINDOWEVENT_FOCUS_GAINED).
fa8f092
@DanielGibson DanielGibson added a commit to DanielGibson/dhewm3 that referenced this pull request Oct 6, 2012
@DanielGibson DanielGibson Unset key modifiers when regaining focus to unset ALT
There used to be a bug (discussed in #40), that ALT was still set after
using ALT-Tab. Thus when next pressing enter fullscreen was toggled.
This should now be fixed by unsetting the modifiers when focus is
regained (SDL_ACTIVEEVENT or SDL_WINDOWEVENT_FOCUS_GAINED).
cd38f52
@DanielGibson DanielGibson merged commit fa8f092 into dhewm:master Nov 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment