Page 1 of 1

Debug window not always in front when DPI aware executable

Posted: Mon Nov 27, 2023 12:07 am
by coco2
When running code with Enable DPI Aware Executable selected in compiler options and a windowed screen the debug window will not remain "always on top" even it is set to. You can test this by running the following code with the "Enable DPI Aware Executable". I'm not actually sure what causes it but it's linked to my single 4K monitor, it only does it on that.

Code: Select all

ExamineDesktops()
Width = DesktopWidth(0)
Height = DesktopHeight(0)
InitSprite()
OpenWindow(0, 0, 0, Width, Height, "Test Debug", #PB_Window_Maximize | #PB_Window_BorderLess)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0)*DesktopResolutionX(), WindowHeight(0)*DesktopResolutionY(), #False, 0, 0, #PB_Screen_WaitSynchronization)
Debug "Test"
InitKeyboard()
Repeat
  Event = WindowEvent()
  ExamineKeyboard()
  Delay(20)
  FlipBuffers()
Until Event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)

Re: Debug window not always in front when DPI aware executable

Posted: Wed Apr 17, 2024 9:41 am
by Fred
I can reproduce it here as well and it seems like a third party program (here Radeon stuff) put the window on top when it detect a fullscreen opengl window.
If it's not fullscreen, no problem:

Code: Select all

ExamineDesktops()
Width = DesktopWidth(0)
Height = DesktopHeight(0)/2
; Height = DesktopHeight(0) ; Uncomment and it will fail due to Radeon software which put the detected game screen on top

InitSprite()
OpenWindow(0, 0, 0, Width/DesktopResolutionX(), Height/DesktopResolutionY(), "Test Debug", #PB_Window_BorderLess)
OpenWindowedScreen(WindowID(0), 0, 0, WindowWidth(0)*DesktopResolutionX(), WindowHeight(0)*DesktopResolutionY(), #False, 0, 0, #PB_Screen_WaitSynchronization)
Debug "Test"
InitKeyboard()
Repeat
  Event = WindowEvent()
  ExamineKeyboard()
  Delay(20)
  FlipBuffers()
Until Event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)