Fullscreen Window - Dumb beginner question

Just starting out? Need help? Post your questions and find answers here.
Qube
New User
New User
Posts: 4
Joined: Wed Jun 11, 2025 10:57 pm

Fullscreen Window - Dumb beginner question

Post 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.
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Fullscreen Window - Dumb beginner question

Post 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)
Qube
New User
New User
Posts: 4
Joined: Wed Jun 11, 2025 10:57 pm

Re: Fullscreen Window - Dumb beginner question

Post 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?
User avatar
moulder61
Enthusiast
Enthusiast
Posts: 193
Joined: Sun Sep 19, 2021 6:16 pm
Location: U.K.

Re: Fullscreen Window - Dumb beginner question

Post 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.
"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
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Fullscreen Window - Dumb beginner question

Post 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.)
User avatar
moulder61
Enthusiast
Enthusiast
Posts: 193
Joined: Sun Sep 19, 2021 6:16 pm
Location: U.K.

Re: Fullscreen Window - Dumb beginner question

Post 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.
"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
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Fullscreen Window - Dumb beginner question

Post by miso »

Ah, thanks again. Yes, I totally misunderstood. It's a relief. ;)
User avatar
Piero
Addict
Addict
Posts: 914
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Fullscreen Window - Dumb beginner question

Post 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)
miso
Enthusiast
Enthusiast
Posts: 466
Joined: Sat Oct 21, 2023 4:06 pm
Location: Hungary

Re: Fullscreen Window - Dumb beginner question

Post by miso »

Thanks, Piero. Good to have a solution, OP will be glad if that works.
Qube
New User
New User
Posts: 4
Joined: Wed Jun 11, 2025 10:57 pm

Re: Fullscreen Window - Dumb beginner question

Post by Qube »

@ Piero, that works perfectly, thank you very much :D
User avatar
Piero
Addict
Addict
Posts: 914
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Fullscreen Window - Dumb beginner question

Post by Piero »

Qube wrote: Thu Jun 12, 2025 4:29 pm @ Piero, that works perfectly, thank you very much :D
viewtopic.php?p=641513#p641513

viewtopic.php?p=620351
Qube
New User
New User
Posts: 4
Joined: Wed Jun 11, 2025 10:57 pm

Re: Fullscreen Window - Dumb beginner question

Post by Qube »

Piero wrote: Thu Jun 12, 2025 4:58 pm
Qube wrote: Thu Jun 12, 2025 4:29 pm @ Piero, that works perfectly, thank you very much :D
viewtopic.php?p=641513#p641513

viewtopic.php?p=620351
Ahh, more PB magic to look into. I feel like such a newbie again :lol:

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 8)
User avatar
Piero
Addict
Addict
Posts: 914
Joined: Sat Apr 29, 2023 6:04 pm
Location: Italy

Re: Fullscreen Window - Dumb beginner question

Post 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
Post Reply