Page 1 of 3
leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 3:57 am
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...
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 9:48 am
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)
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 10:18 am
by UserOfPure
Confirmed here too. Very strange! I can't even Alt+Tab back to it.
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 11:30 am
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.
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 11:57 am
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
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 1:13 pm
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)
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 1:28 pm
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.
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 1:32 pm
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...
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 5:26 pm
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

Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 5:53 pm
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.
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 6:41 pm
by djes
I have posted ten times this question and a possible solution to that. Well, not this time.

Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 6:48 pm
by Kaeru Gaman
what?
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 6:54 pm
by netmaestro
I posted a solution using a lowlevel keyboard hook to disable ALT but it no longer works if dx9 is used.
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 7:10 pm
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.
Re: leave FullScreen with Alt-Tab is not functional?
Posted: Sun Mar 14, 2010 8:24 pm
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...