This code has a bug on Ubuntu 22.04 LTS (it gives the wrong size of an invisible window)
Windows results:
desktop_resolution$:1920x1080
window_resolution_max_width:1920
window_resolution_max_height:1057
Ubuntu 22.04 results:
desktop_resolution$:1920x969
window_resolution_max_width:10
window_resolution_max_height:10
After around a year without releasing an update for Proofing Tool GUI, I thought it was about time and found this.
Code: Select all
; Gets the maximum size a window can become in the desktop.
; (width)
;
; It opens an invisible full desktop window to find the value.
;
; V1.0 - 14/AUG/2022
;
Procedure GetMaxWindowDesktopWidth()
MARCOAGPINTO_dynamic_value_for_window=3000
If OpenWindow(MARCOAGPINTO_dynamic_value_for_window,0,0,10,10,"Getting Maximum Window Size",#PB_Window_Maximize|#PB_Window_Invisible)=0 : MessageRequester("Error", "Can't open a window.",#PB_MessageRequester_Error) : EndIf
MARCOAGPINTO_max_width=WindowWidth(MARCOAGPINTO_dynamic_value_for_window)
CloseWindow(MARCOAGPINTO_dynamic_value_for_window)
ProcedureReturn MARCOAGPINTO_max_width
EndProcedure
; Gets the maximum size a window can become in the desktop.
; (height)
;
; It opens an invisible full desktop window to find the value.
;
; V1.0 - 14/AUG/2022
;
Procedure GetMaxWindowDesktopHeight()
MARCOAGPINTO_dynamic_value_for_window=3000
If OpenWindow(MARCOAGPINTO_dynamic_value_for_window,0,0,10,10,"Getting Maximum Window Size",#PB_Window_Maximize|#PB_Window_Invisible)=0 : MessageRequester("Error", "Can't open a window.",#PB_MessageRequester_Error) : EndIf
MARCOAGPINTO_max_height=WindowHeight(MARCOAGPINTO_dynamic_value_for_window)
CloseWindow(MARCOAGPINTO_dynamic_value_for_window)
ProcedureReturn MARCOAGPINTO_max_height
EndProcedure
; Get maximum window size from an invisible window
ExamineDesktops()
desktop_resolution$=Str(DesktopWidth(0))+"x"+Str(DesktopHeight(0))
Debug "desktop_resolution$:"+desktop_resolution$
window_resolution_max_width=GetMaxWindowDesktopWidth()
Debug "window_resolution_max_width:"+Str(window_resolution_max_width)
window_resolution_max_height=GetMaxWindowDesktopHeight()
Debug "window_resolution_max_height:"+window_resolution_max_height