Page 1 of 1
Fullscreen Window - Dumb beginner question
Posted: Wed Jun 11, 2025 11:04 pm
by Qube
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.
Re: Fullscreen Window - Dumb beginner question
Posted: Thu Jun 12, 2025 1:58 am
by miso
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)
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
Posted: Thu Jun 12, 2025 2:48 am
by Qube
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
Posted: Thu Jun 12, 2025 1:18 pm
by moulder61
@miso
Your code also works as described on Linux.
I'm still on PB 611 at the moment, if that makes a difference?
Moulder.
Re: Fullscreen Window - Dumb beginner question
Posted: Thu Jun 12, 2025 1:23 pm
by miso
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.)
Re: Fullscreen Window - Dumb beginner question
Posted: Thu Jun 12, 2025 1:55 pm
by moulder61
@miso
I'm not sure if you misunderstood my comment? It works fine on Linux, fullscreen, no titlebar or dock/panel showing.
Moulder.
Re: Fullscreen Window - Dumb beginner question
Posted: Thu Jun 12, 2025 2:01 pm
by miso
Ah, thanks again. Yes, I totally misunderstood. It's a relief.

Re: Fullscreen Window - Dumb beginner question
Posted: Thu Jun 12, 2025 2:44 pm
by Piero
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
Posted: Thu Jun 12, 2025 2:50 pm
by miso
Thanks, Piero. Good to have a solution, OP will be glad if that works.
Re: Fullscreen Window - Dumb beginner question
Posted: Thu Jun 12, 2025 4:29 pm
by Qube
@ Piero, that works perfectly, thank you very much

Re: Fullscreen Window - Dumb beginner question
Posted: Thu Jun 12, 2025 4:58 pm
by Piero
Qube wrote: Thu Jun 12, 2025 4:29 pm
@ Piero, that works perfectly, thank you very much

viewtopic.php?p=641513#p641513
viewtopic.php?p=620351
Re: Fullscreen Window - Dumb beginner question
Posted: Fri Jun 13, 2025 4:10 am
by Qube
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
Posted: Mon Jun 16, 2025 10:22 am
by Piero
Qube wrote: Fri Jun 13, 2025 4:10 amPB magic
I would call it:
"How to easily run shell (''''Terminal'''') stuff in PB (including AppleScripts via the 'osascript' command)"
;P