Fullscreen Window - Dumb beginner question
Fullscreen Window - Dumb beginner question
This is probably the most stupid question but..
On MacOS I'm trying to open a fullscreen window which is actually fullscreen and doesn't just maximise the window leaving the dock bar in view still. No problems with OpenScreen but it's more preferred these days to open a full screen window than force a resolution change.
Am I missing something really stupid? thanks in advance.
On MacOS I'm trying to open a fullscreen window which is actually fullscreen and doesn't just maximise the window leaving the dock bar in view still. No problems with OpenScreen but it's more preferred these days to open a full screen window than force a resolution change.
Am I missing something really stupid? thanks in advance.
Re: Fullscreen Window - Dumb beginner question
This code is fullscreen windowed on windows. I don't own a MAC, but I assumed it should be the same. Could you test it? Is the dockbar visible?
(I'm curious)
(I'm curious)
Code: Select all
ExamineDesktops()
InitSprite()
InitKeyboard()
InitMouse()
OpenWindow(0,0,0,DesktopUnscaledX(DesktopWidth(0)),DesktopUnscaledY(DesktopHeight(0)),"Sprite Creation", #PB_Window_BorderLess)
OpenWindowedScreen(WindowID(0),0,0,WindowWidth(0),WindowHeight(0),1,0,0,#PB_Screen_SmartSynchronization)
SetFrameRate(60)
;Sprite Creation
CreateSprite(1,64,64,#PB_Sprite_AlphaBlending)
StartDrawing(SpriteOutput(1))
DrawingMode(#PB_2DDrawing_AllChannels)
Box(0,0,OutputWidth(),OutputHeight(),RGBA(0,0,0,0)) ; This sets the alpha channel to transparent fully
Circle(OutputWidth()/2,OutputHeight()/2,SpriteHeight(1)/2-1,RGBA(255,0,0,255)) ; drawing a red circle
StopDrawing()
Repeat
Repeat: Until Not WindowEvent()
ExamineKeyboard() : ExamineMouse() : ClearScreen(RGB(50,20,20))
DisplayTransparentSprite(1,ScreenWidth()/2-SpriteWidth(1)/2,ScreenHeight()/2-SpriteHeight(1)/2)
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
Re: Fullscreen Window - Dumb beginner question
Unfortunately the dock is still visible and the title bar of the app is still there. Any other tips and tricks I can try?
Re: Fullscreen Window - Dumb beginner question
@miso
Your code also works as described on Linux.
I'm still on PB 611 at the moment, if that makes a difference?
Moulder.
Your code also works as described on Linux.
I'm still on PB 611 at the moment, if that makes a difference?
Moulder.
"If it ain't broke, fix it until it is!
This message is brought to you thanks to SenselessComments.com
My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
This message is brought to you thanks to SenselessComments.com
My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
Re: Fullscreen Window - Dumb beginner question
Thanks! I was wondering, as I only test things in Windows, and was sure that this would have the same output in the other 2 OS.
(On windows it looks like a true fullscreen)
(If anyone knows the solution Linux- and MAC-wise for a windowed fullscreen, I'm also pretty much interested.)
(On windows it looks like a true fullscreen)
(If anyone knows the solution Linux- and MAC-wise for a windowed fullscreen, I'm also pretty much interested.)
Re: Fullscreen Window - Dumb beginner question
@miso
I'm not sure if you misunderstood my comment? It works fine on Linux, fullscreen, no titlebar or dock/panel showing.
Moulder.
I'm not sure if you misunderstood my comment? It works fine on Linux, fullscreen, no titlebar or dock/panel showing.
Moulder.
"If it ain't broke, fix it until it is!
This message is brought to you thanks to SenselessComments.com
My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
This message is brought to you thanks to SenselessComments.com
My PB stuff for Linux: "https://u.pcloud.link/publink/show?code ... z3MR0T3jyV
Re: Fullscreen Window - Dumb beginner question
Ah, thanks again. Yes, I totally misunderstood. It's a relief. 

Re: Fullscreen Window - Dumb beginner question
AppleScript/UI Hack:
Code: Select all
Procedure simpleShell(ShellCommand$)
Protected shell = RunProgram("/bin/sh","","", #PB_Program_Open|#PB_Program_Write)
If shell
WriteProgramStringN(shell,ShellCommand$)
WriteProgramData(shell,#PB_Program_Eof,0)
CloseProgram(shell)
EndIf
EndProcedure
ExamineDesktops()
InitSprite():InitKeyboard():InitMouse()
OpenWindow(0,0,0,DesktopUnscaledX(DesktopWidth(0)),DesktopUnscaledY(DesktopHeight(0)),"Sprite Creation",
#PB_Window_MaximizeGadget)
OpenWindowedScreen(WindowID(0),0,0,WindowWidth(0),WindowHeight(0),1,0,0,#PB_Screen_SmartSynchronization)
SetFrameRate(60)
simpleShell(~"osascript -e 'tell application \"System Events\" to set value of attribute \"AXFullScreen\" of front window of (first process whose frontmost is true) to true' > /dev/null 2>&1 &")
;Sprite Creation
CreateSprite(1,64,64,#PB_Sprite_AlphaBlending)
StartDrawing(SpriteOutput(1))
DrawingMode(#PB_2DDrawing_AllChannels)
Box(0,0,OutputWidth(),OutputHeight(),RGBA(0,0,0,0)) ; This sets the alpha channel to transparent fully
Circle(OutputWidth()/2,OutputHeight()/2,SpriteHeight(1)/2-1,RGBA(255,0,0,255)) ; drawing a red circle
StopDrawing()
Repeat
Repeat: Until Not WindowEvent()
ExamineKeyboard() : ExamineMouse() : ClearScreen(RGB(50,20,20))
DisplayTransparentSprite(1,ScreenWidth()/2-SpriteWidth(1)/2,ScreenHeight()/2-SpriteHeight(1)/2)
FlipBuffers()
Until KeyboardPushed(#PB_Key_Escape)
Re: Fullscreen Window - Dumb beginner question
Thanks, Piero. Good to have a solution, OP will be glad if that works.
Re: Fullscreen Window - Dumb beginner question
@ Piero, that works perfectly, thank you very much 

Re: Fullscreen Window - Dumb beginner question
Ahh, more PB magic to look into. I feel like such a newbie again

Having a good look into PB since Apple have said that Rosetta 2 will be removed in a couple of years and as an AGK Studio user on MacOS the main IDE was never compiled to ARM and even though they've released the source code it's just error after error trying to get the IDE to compile.
As PB's IDE is ARM on MacOS then time to leap into PB

Re: Fullscreen Window - Dumb beginner question
I would call it:
"How to easily run shell (''''Terminal'''') stuff in PB (including AppleScripts via the 'osascript' command)"
;P