PB 6.21 beta 5: #PB_Window_Maximize doesn't work Ubuntu 24.04
Posted: Wed Apr 16, 2025 5:32 am
Heya,
Sorry for bringing this back again, but it still doesn't work on Ubuntu 24.04.
The help documentation states:
But I have downloaded the specific Ubuntu 24.04 version of PureBasic so it should be 100% compatible with Ubuntu 24.04 (at least with the Windowmanager since it was made for that specific version of Ubuntu?).
Right now, I can't compile my open-source tool for Ubuntu because the code below returns from debugger:
Which results in negative values while opening a dynamic preferences window in my app.
Here is the source-code:
Thanks!
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()