Author Topic: Alt Tab dosent work in fullscreen (AUTOPAUSE not works correctly Windows 10).  (Read 760 times)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3589
    • View Profile
    • Space Fractal
as topic said, Alt Tab dosent work in fullscreen, and even jobcenter can been shown at all! This bug needs to been fixed before the steam release really. Im not sure what it happens, since im even used AUTOPAUSE True, that also dosent work correctly on Windows.

Etc there also no way to set a borderless windowered mode at all, which could have fix it.
« Last Edit: 2019-Feb-09 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline Qedo

  • Mr. Polyvector
  • ***
  • Posts: 157
  • UNUS SED LEO
    • View Profile
Re: Alt Tab dosent work in fullscreen.
« Reply #1 on: 2018-Dec-24 »
while waiting debug try this workaround.

Code: GLBasic [Select]
f_fullscreen=TRUE
Nf_fullscreen=TRUE
CGLB_ON_RESUME=GETTIMERALL()

REPEAT
        IF Nf_fullscreen<>f_fullscreen
                f_fullscreen=Nf_fullscreen
                SETSCREEN 640, 480, f_fullscreen
                CGLB_ON_RESUME=GETTIMERALL()
        ENDIF
.......



........
UNTIL FALSE

SUB GLB_ON_PAUSE:
IF Nf_fullscreen=f_fullscreen
                CGLB_ON_RESUME=GETTIMERALL()-CGLB_ON_RESUME
                IF CGLB_ON_RESUME>1000
                        Nf_fullscreen=NOT Nf_fullscreen
                ENDIF
ENDIF
        CGLB_ON_RESUME=GETTIMERALL()

ENDSUB
SUB GLB_ON_RESUME:
IF Nf_fullscreen=f_fullscreen
                CGLB_ON_RESUME=GETTIMERALL()-CGLB_ON_RESUME
                IF CGLB_ON_RESUME>1000
                        Nf_fullscreen=NOT Nf_fullscreen
                ENDIF
ENDIF
CGLB_ON_RESUME=GETTIMERALL()
ENDSUB
 
« Last Edit: 2018-Dec-25 by spacefractal »

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3589
    • View Profile
    • Space Fractal
Re: Alt Tab dosent work in fullscreen.
« Reply #2 on: 2018-Dec-25 »
the only issue is SUB GLB_ON_PAUSE and SUB GLB_ON_RESUME seens not been called on Windows 10, even with AUTOPAUSE True. Otherwise im would have done something extractly like this workaround by switch between fullscreen and windowred mode. Me and Gernot should look why its dont call them as its should. This was a hell to support this on iOS as well Android correctly.
« Last Edit: 2018-Dec-25 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline Qedo

  • Mr. Polyvector
  • ***
  • Posts: 157
  • UNUS SED LEO
    • View Profile
Re: Alt Tab dosent work in fullscreen.
« Reply #3 on: 2018-Dec-25 »
tried on win10 and it seems to work

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3589
    • View Profile
    • Space Fractal
Re: Alt Tab dosent work in fullscreen.
« Reply #4 on: 2018-Dec-25 »
not here or at my friend. When im alt-tab from a full window, the windows is still stays in fullscreen and got inactivated. A friend of my did even forced to restart windows, because ctrl,alt,delete diddent work. Howover im do have implemented that workaround its send to windowered mode on Tab, Ctrl+ALT and Alt-Enter in that game.

GLB_ON_PAUSE and GLB_ON_RESUME is newer called on a alt/tab here. but if they did, then this workaround would have works fine.

Property a GLB_WIN32_MSG subrutine can been checked the windows is activated or not. This sub does calls its seen.
« Last Edit: 2018-Dec-25 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3589
    • View Profile
    • Space Fractal
Re: Alt Tab dosent work in fullscreen.
« Reply #5 on: 2018-Dec-25 »
This is actuelly not a bug, but its is the code: its dosent work in the debugger mode.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3589
    • View Profile
    • Space Fractal
Re: Alt Tab dosent work in fullscreen.
« Reply #6 on: 2018-Dec-25 »
but its still dosent works as intendend. Im get a black screen when doing workaround like this and resume dosent works when you just reactivate the window, but require to been minimized and maximized again. So its still quite fuzzy here.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3589
    • View Profile
    • Space Fractal
Re: Alt Tab dosent work in fullscreen.
« Reply #7 on: 2018-Dec-25 »
To get that workaround to work, you do a little more work to do:

in the glb_pc.cpp in the function LRESULT CALLBACK __WndProc and in the WM_ACTIVATE case:
Code: GLBasic [Select]
                case WM_ACTIVATE:
                {                                      
                        switch(wParam & 0xffff)
                        {
                                case WA_ACTIVE: case WA_CLICKACTIVE:
                                        if(!__DG_DEBUG)
                                        {
                                                glb_do_pause(false);
                                                if(!__g_paused && __g_allowPause)
                                                        ::SetWindowText(__hWnd, __g_Caption().c_str());
                                        }
                                        else
                                        {       CALLBYNAME(DGStr("GLB_ON_RESUME"));

                                        }
                                        break;
                                case WA_INACTIVE:
                                        if(!__DG_DEBUG)
                                        {
                                                glb_do_pause(true);
                                                if(__g_paused && __g_allowPause)
                                                        ::SetWindowText(__hWnd, (__g_Caption() + CGStr(" <pause>")).c_str());
                                        }
                                        else
                                        {       CALLBYNAME(DGStr("GLB_ON_PAUSE"));
                                        }
                                        break;
                        }
                }
                return 0L;
 

Now the above issue workaround can been done and works, even with AUTOPAUSE FALSE as well. Those subs is required to been called when the windows is in fullscreen, or the user cant switch betweens apps.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline Qedo

  • Mr. Polyvector
  • ***
  • Posts: 157
  • UNUS SED LEO
    • View Profile
Re: Alt Tab dosent work in fullscreen.
« Reply #8 on: 2018-Dec-25 »
Great !!!

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3589
    • View Profile
    • Space Fractal
im have still got issues, but im do found a very simple fix in the c++ code, all its actuelly was need to do is MINIMIZE the window, when its in FULLSCREEN,  then its escape its correctly!

Code: GLBasic [Select]
        case WM_ACTIVATE:
                {
                        switch(wParam & 0xffff)
                        {
                                case WA_ACTIVE: case WA_CLICKACTIVE:
                                        if(!__DG_DEBUG)
                                        {
                                                glb_do_pause(false);
                                                if(!__g_paused && __g_allowPause)
                                                        ::SetWindowText(__hWnd, __g_Caption().c_str());
                                        }
                                        break;
                                case WA_INACTIVE:
                                        if (__DG_FULLSCREEN==1)
                                        {
                                                ::ShowWindow(__hWnd,SW_MINIMIZE);
                                        }
                                        if(!__DG_DEBUG)
                                        {
                                                glb_do_pause(true);
                                                if(__g_paused && __g_allowPause)
                                                        ::SetWindowText(__hWnd, (__g_Caption() + CGStr(" <pause>")).c_str());
                                        }
                                        break;
                        }
                }
                return 0L;
 

Actuelly pretty simple fix! Windows 10 simply dosent minimize from fullscreen as its should? So im just let it minimze if its fullscreen. You dont need to maximize, which works as intended.
« Last Edit: 2019-Feb-09 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1622
  • Particle Hawk
    • View Profile
I noticed this too, and thought about this solution:
Code: GLBasic [Select]
IF (KEY(alt+tab) detected)
SETSCREEN 1920,1080, FALSE
Render a button too, (SETSCREEN 1920,1080, TRUE), so its waiting for the user to reactivate the fullscreen mode when they tab back to program.
ENDIF
« Last Edit: 2019-Feb-10 by Hemlos »
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1622
  • Particle Hawk
    • View Profile
i tried alt-tab detection....its hit or miss.

There are many games that use ALT+ENTER to toggle fullscreen mode.

This is what i'm going to use as a solution for ALT-TAB not working from fullscreen mode:

Code: GLBasic [Select]
        // ALT+ENTER -- toggle fullscreen mode
        STATIC tempscrmode
        IF (KEY(184)) AND (KEY(28)) AND (tempscrmode = FALSE)
                SETSCREEN 1900,1000,FALSE
                tempscrmode = TRUE
        ELSEIF (KEY(184)) AND (KEY(28)) AND (tempscrmode = TRUE)
                SETSCREEN 1920,1080,TRUE
                tempscrmode = FALSE
        ENDIF
 
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3589
    • View Profile
    • Space Fractal
just use the source code modification, then its works as intended (and dont try to detect alt-tab etc, which might conflict so). Windows 10 simply just do not minimize the window as its should. Then you dosent need to detect the alt-tab anymore.

Etc the main issue is in the glbasic source code when WA_INACTIVE is called:
LRESULT CALLBACK __WndProc_(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)

The new code checks, if the windows is fullscreen, then manually minimize it. Done with success with 3 of my games, with 2 is remaining.
« Last Edit: 2019-Feb-12 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1622
  • Particle Hawk
    • View Profile
Its not only win10, Its the same for windows 7, full screen is not maximized, its fullscreen.

Many fullscreen games use ALT+ENTER to induce window mode because their games dont minimize on ALT TAB, its not a window.

How do you implement your sourcecode?
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3589
    • View Profile
    • Space Fractal
im put the source code under compiler/platform/source from the downloaded one (can been download from the main site). then you can build the source code by using _build.bat from each platform.

Hopefully Gernot adds this to the glbasic 16 soon. Im only just added 2 lines or code or such in glb_pc.cpp.

Here im do manual minimize it (which worked best in this case), if its fullscreen when the windows inactivate status is called.

This seens to also make sure the Windows dosent got stuck in the game, which was happens (im was needed to reset it).
« Last Edit: 2019-Feb-12 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.