# HG changeset patch # User doomjoshuaboy # Date 1607424273 -39600 # Tue Dec 08 21:44:33 2020 +1100 # Node ID 84ced827730c070548823eb053f8c7a024665d5e # Parent 7893580a86b95f54838cee05174bcc6e0a51f3d0 Fixed mouse not showing up properly when the game becomes focused or unfocused in fullscreen mode diff -r 7893580a86b9 -r 84ced827730c docs/zandronum-history.txt --- a/docs/zandronum-history.txt Thu Nov 27 10:58:34 2014 +0200 +++ b/docs/zandronum-history.txt Tue Dec 08 21:44:33 2020 +1100 @@ -45,6 +45,7 @@ - - Fixed desaturated translations created with CreateTranslation() not syncing with clients in an online game. [Kaminsky] - - Fixed missiles with the STEPMISSILE flag disappearing in online games. [Kaminsky] - - Fixed faulty armor behaviour that occurred when the player's inventory was cleared. [Kaminsky] +- - Fixed mouse not showing up properly when the game becomes focused or unfocused in fullscreen mode [DoomJoshuaBoy] ! - sv_forcegldefaults renamed to sv_forcevideodefaults. The old name still exists for compatibility. [Dusk] ! - r_3dfloors is now forced to be true when sv_forcevideodefaults is true. [Dusk] ! - When the wad authentication fails for a connecting client, the client only reports the missing and incompatible PWADS instead of all of them. [Pol Marcet] diff -r 7893580a86b9 -r 84ced827730c src/win32/i_mouse.cpp --- a/src/win32/i_mouse.cpp Thu Nov 27 10:58:34 2014 +0200 +++ b/src/win32/i_mouse.cpp Tue Dec 08 21:44:33 2020 +1100 @@ -257,31 +257,31 @@ void I_CheckNativeMouse(bool preferNative) { - bool windowed = (screen == NULL) || !screen->IsFullscreen(); + //[JS] Took some code out to help keep the mouse focusing and unfocusing when using fullscreen + // As it wasn't showing properly in most OSes. + //bool windowed = (screen == NULL) || !screen->IsFullscreen(); bool want_native; - if (!windowed) + /*if (!windowed) + //{ + // ungrab mouse when in the menu with mouse control on. + //want_native = m_use_mouse && (menuactive == MENU_On || menuactive == MENU_OnNoPause); + //} + else*/ + + if ((GetForegroundWindow() != Window) || preferNative || !use_mouse) { - // ungrab mouse when in the menu with mouse control on. - want_native = m_use_mouse && (menuactive == MENU_On || menuactive == MENU_OnNoPause); + want_native = true; + } + else if (menuactive == MENU_WaitKey) + { + want_native = false; } else { - if ((GetForegroundWindow() != Window) || preferNative || !use_mouse) - { - want_native = true; - } - else if (menuactive == MENU_WaitKey) - { - want_native = false; - } - else - { - want_native = ((!m_use_mouse || menuactive != MENU_WaitKey) && - (!CaptureMode_InGame() || GUICapture || paused || demoplayback)); - } - } - + want_native = ((!m_use_mouse || menuactive != MENU_WaitKey) && + (!CaptureMode_InGame() || GUICapture || paused || demoplayback)); + } //Printf ("%d %d %d\n", wantNative, preferNative, NativeMouse); if (want_native != NativeMouse)