Also strange:
Code: Select all
CompilerIf #PB_Compiler_IsMainFile
EnableExplicit
CompilerEndIf
Structure GetMaxWindowDesktopInfo_Structure
InnerX.i
InnerY.i
FrameX.i
FrameY.i
InnerWidth.i
InnerHeight.i
FrameWidth.i
FrameHeight.i
EndStructure
Procedure.i GetMaxWindowDesktopInfo(*Info.GetMaxWindowDesktopInfo_Structure)
Protected.i Win, Event, Result
Win = OpenWindow(#PB_Any, 0, 0, 0, 0, "", #PB_Window_MaximizeGadget|#PB_Window_Maximize|#PB_Window_Invisible)
If Win
AddWindowTimer(Win, 1, 10)
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Timer And EventTimer() = 1
RemoveWindowTimer(Win, 1)
Break
EndIf
ForEver
*Info\InnerX = WindowX(Win, #PB_Window_InnerCoordinate)
*Info\InnerY = WindowY(Win, #PB_Window_InnerCoordinate)
*Info\FrameX = WindowX(Win, #PB_Window_FrameCoordinate)
*Info\FrameY = WindowY(Win, #PB_Window_FrameCoordinate)
*Info\InnerWidth = WindowWidth(Win, #PB_Window_InnerCoordinate)
*Info\InnerHeight = WindowHeight(Win, #PB_Window_InnerCoordinate)
*Info\FrameWidth = WindowWidth(Win, #PB_Window_FrameCoordinate)
*Info\FrameHeight = WindowHeight(Win, #PB_Window_FrameCoordinate)
CloseWindow(Win)
Result = #True
Else
MessageRequester("Error", "Can't open window.", #PB_MessageRequester_Error)
EndIf
ProcedureReturn Result
EndProcedure
CompilerIf #PB_Compiler_IsMainFile
Define Info.GetMaxWindowDesktopInfo_Structure, Event.i
If GetMaxWindowDesktopInfo(@Info)
Debug Str(Info\FrameX) + "/" + Str(Info\FrameY) + " " + Str(Info\InnerX) + "/" + Str(Info\InnerY) + " " + Str(Info\InnerWidth) + "/" + Str(Info\InnerHeight) + " " + Str(Info\FrameWidth) + "/" + Str(Info\FrameHeight)
OpenWindow(0, Info\FrameX, Info\FrameY, Info\InnerWidth, Info\InnerHeight, "Max", #PB_Window_MaximizeGadget)
CanvasGadget(0, 0, 0, Info\InnerWidth, Info\InnerHeight)
If StartDrawing(CanvasOutput(0))
Plot(0, 0, #Red)
Plot(Info\InnerWidth - 1, 0, #Red)
StopDrawing()
EndIf
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_MaximizeWindow
Debug WindowX(0)
EndIf
Until Event = #PB_Event_CloseWindow
EndIf
CompilerEndIf
Results in: 0/0 3/26 1280/961 1286/990
My screen resolution is 1280/1024
FrameX and FrameY is 0/0, that's expected.
But InnerWidth is 1280. That's my screen size! So the inner window is not fully displayed, since InnerX is 3 on my PC.
This would result in 3 pixels not visible on the right side of the inner window area.
The opened window at 0/0 is not displayed at 0/0.
But if I press the maximize Gadget, it is placed correct, I can see both red points.
But then the x cordinate needs to be -3, whichj is the case.
Then the initial #PB_Window_Maximize is not correct.