Sorry for bringing this back again, but it still doesn't work on Ubuntu 24.04.
The help documentation states:
Code: Select all
#PB_Window_Maximize : Opens the window maximized. (Note: on Linux, not all Windowmanagers support this)
Right now, I can't compile my open-source tool for Ubuntu because the code below returns from debugger:
Code: Select all
10
30
Here is the source-code:
Code: Select all
; Display a requester with an error message.
;
; To clean up the code
;
; V1.0 - 07/APR/2024
;
Procedure MessageRequesterError(MARCOAGPINTO_error_text$)
MessageRequester("Error!",MARCOAGPINTO_error_text$,#PB_MessageRequester_Error)
EndProcedure
; Gets the maximum size a window can become in the desktop.
; (height)
;
; It opens an invisible full desktop window to find the value.
;
; 30/JUL/2024: Now asynchronous trick for Linux
;
;
; V1.0 - 14/AUG/2022
; V1.1 - 27/FEB/2024
; o Use of flag: #PB_Window_MaximizeGadget
; V1.2 - 31/MAR/2024
; o Check if temp window already exists, opening a message requester warning and exits the procedure with #False
; V1.3 - 30/JUL/2024
; o Now asynchronous trick for Linux
;
Procedure GetMaxWindowDesktopHeight()
MARCOAGPINTO_dynamic_value_for_window=3000
; Check if window already exists
If IsWindow(MARCOAGPINTO_dynamic_value_for_window)=#True
MessageRequesterError("Window number "+Str(MARCOAGPINTO_dynamic_value_for_window)+" already exists.")
ProcedureReturn #False
EndIf
If OpenWindow(MARCOAGPINTO_dynamic_value_for_window,0,0,10,10,"Getting Maximum Window Size",#PB_Window_Maximize|#PB_Window_Invisible|#PB_Window_MaximizeGadget)=0
MessageRequesterError("Can't open a window.")
ProcedureReturn 0
EndIf
Repeat
MARCOAGPINTO_event=WindowEvent()
Until IsWindow(MARCOAGPINTO_dynamic_value_for_window)
MARCOAGPINTO_max_height=WindowHeight(MARCOAGPINTO_dynamic_value_for_window)
CloseWindow(MARCOAGPINTO_dynamic_value_for_window)
ProcedureReturn MARCOAGPINTO_max_height
EndProcedure
; SAME PROCEDURE AS ABOVE BUT NOT WITH INVISIBLE WINDOW
Procedure GetMaxWindowDesktopHeight_not_invisible()
MARCOAGPINTO_dynamic_value_for_window=3000
; Check if window already exists
If IsWindow(MARCOAGPINTO_dynamic_value_for_window)=#True
MessageRequesterError("Window number "+Str(MARCOAGPINTO_dynamic_value_for_window)+" already exists.")
ProcedureReturn #False
EndIf
If OpenWindow(MARCOAGPINTO_dynamic_value_for_window,0,0,10,10,"Getting Maximum Window Size",#PB_Window_Maximize|#PB_Window_MaximizeGadget)=0
MessageRequesterError("Can't open a window.")
ProcedureReturn 0
EndIf
Repeat
MARCOAGPINTO_event=WindowEvent()
Until IsWindow(MARCOAGPINTO_dynamic_value_for_window)
MARCOAGPINTO_max_height=WindowHeight(MARCOAGPINTO_dynamic_value_for_window)
CloseWindow(MARCOAGPINTO_dynamic_value_for_window)
ProcedureReturn MARCOAGPINTO_max_height
EndProcedure
Debug GetMaxWindowDesktopHeight()
Debug GetMaxWindowDesktopHeight_not_invisible()