leave FullScreen with Alt-Tab is not functional?

Advanced game related topics
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

leave FullScreen with Alt-Tab is not functional?

Post by Kaeru Gaman »

I just happen to stumble over a Problem that a Fullscreen does not recover properly after Alt-Tab..
I can leave it, but when i click on the TaskBar Icon it does not recover...
or is it forbidden to test IsScreenActive() twice in one loop?
just a quick question if this issue is known, I will provide a short code producing the problem tomorrow...
oh... and have a nice day.
#NULL
Addict
Addict
Posts: 1440
Joined: Thu Aug 30, 2007 11:54 pm
Location: right here

Re: leave FullScreen with Alt-Tab is not functional?

Post by #NULL »

i have the same problem, but didn't realize it as a possible PB bug

Code: Select all

InitSprite()
InitMouse()
InitKeyboard()
OpenScreen(1024,768,32,"fllscrn")

Repeat
  If IsScreenActive()
    ExamineMouse()
    ExamineKeyboard()
    ClearScreen(0)
    StartDrawing( ScreenOutput() )
      Circle(MouseX(),MouseY(),5,$770000)
    StopDrawing()
  Else
    ReleaseMouse(1)
    Delay(200)
  EndIf
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: leave FullScreen with Alt-Tab is not functional?

Post by UserOfPure »

Confirmed here too. Very strange! I can't even Alt+Tab back to it.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: leave FullScreen with Alt-Tab is not functional?

Post by Kaeru Gaman »

@#NULL
thanks for providing a demo.

yes, I also cannot Alt-Tab back on it, the Cursor on the TaskRow just jumps on to the next task.

I also see that when I reactivate the game task, I hear the "maximize" sound of the desktop,
and then my mouse vanishes and refresh is infunctional
for the top left part of the desktop that has the size of the fullscreen.

tested it with xp-skin support on/off and debugger on/off.
oh... and have a nice day.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: leave FullScreen with Alt-Tab is not functional?

Post by blueznl »

Browse around, this is a known issue.

If you look through the forum a bit you'll find some solutions. Here's my take on it:

http://www.xs4all.nl/~bluez/purebasic/p ... abbing_out
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: leave FullScreen with Alt-Tab is not functional?

Post by Kaeru Gaman »

well, I ran into it late last night, on the last test before I had to sleep.
so I just dropped a note, also to make me not forget to ask early this morning.

in your guide you only mention the drawing problem... this is not my point.
read the posts carefully again, the problem is that it is IMPOSSIBLE to Tab-In again, no matter drawing or not.

[edit]

I modified #NULL's example to take the drawing out of the loop.
also, I took the ExamineKeyboard out of the If, to make it possible to end the program with ESC when backed in.
you cannot reach the red [X] in the IDE to stop it, because it's beyond the screen area.

Code: Select all

InitSprite()
InitMouse()
InitKeyboard()
OpenScreen(1024,768,32,"fllscrn")

CreateSprite(0, 64,64)
  StartDrawing(SpriteOutput(0))
    Line( 0, 0, 48, 32,$0FF0FF)
    Line( 0, 0, 64, 64,$0FF0FF)
    Line( 0, 0, 32, 48,$0FF0FF)
  StopDrawing()

Repeat
  ExamineKeyboard()
  If IsScreenActive()
    ReleaseMouse(0)
    ExamineMouse()
    ClearScreen(0)
    DisplayTransparentSprite(0,MouseX(),MouseY())
  Else
    ReleaseMouse(1)
    Delay(200)
  EndIf
  FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
Last edited by Kaeru Gaman on Sun Mar 14, 2010 1:28 pm, edited 1 time in total.
oh... and have a nice day.
User avatar
luis
Addict
Addict
Posts: 3876
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: leave FullScreen with Alt-Tab is not functional?

Post by luis »

Try with directx7 as subsystem.

It's a problem with the new dx9 subsystem I believe.

There are work arounds posted, maybe by djes ? I'm not sure.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: leave FullScreen with Alt-Tab is not functional?

Post by Kaeru Gaman »

your're right. just tested it with DX7 and it works flawlessly...

*sigh* I have to take a deep thought if I could use DX7 then...
was the AlphaSprite stuff working with DX7?

gna! sometimes this language is no fun anymore...
oh... and have a nice day.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: leave FullScreen with Alt-Tab is not functional?

Post by blueznl »

If you read through the guide, you may have seen my work around using a maximized windowed screen, which does work with DirectX9. Also, I seem to recall that there was a fix by one of our french members, but it was a little too difficult for me :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: leave FullScreen with Alt-Tab is not functional?

Post by Kaeru Gaman »

I know about the Maximized WindowedScreen. http://www.purebasic.fr/english/viewtop ... 12&t=41174
but this is not the same, since it would have to use the full area of the recent desktop.
a 1024x768 Screen is 4:3, a 1920x1080 Desktop is 16:9. maximizing the screen will squeeze it.

I read the whole paragraph in your guide, and you do not mention the not-tab-in-again-problem.
oh... and have a nice day.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: leave FullScreen with Alt-Tab is not functional?

Post by djes »

I have posted ten times this question and a possible solution to that. Well, not this time. :evil:
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: leave FullScreen with Alt-Tab is not functional?

Post by Kaeru Gaman »

what?
oh... and have a nice day.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8433
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: leave FullScreen with Alt-Tab is not functional?

Post by netmaestro »

I posted a solution using a lowlevel keyboard hook to disable ALT but it no longer works if dx9 is used.
BERESHEIT
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: leave FullScreen with Alt-Tab is not functional?

Post by Kaeru Gaman »

netmaestro wrote:I posted a solution using a lowlevel keyboard hook to disable ALT but it no longer works if dx9 is used.
thanks for the hint, but that is no option at all.
using fullscreen means to me, to be able to tab out of it and back into, and additionally that the game goes to pause mode automatically when you leave.
anyways, when using DX7 the tabbing works.
and the maximized windowedscreen works on both DX.
I maybe come back to the container (where you helped me with the mouse)
or searching for some API stuff to determine Heigth of WindowCaption + Border + Taskbar and offer one size where the Window goes Desktop-fit.


...
if I was in good mood (I'm bloody not) I would've cared which question djes meant.
oh... and have a nice day.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6161
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: leave FullScreen with Alt-Tab is not functional?

Post by blueznl »

Frankly, Kaeru, you seldom seem to be in a good mood. I'd be tempted to suggest another hobby but won't as you seem to be enjoying yourself that much...
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Post Reply