Page 1 of 1

[Ubuntu 24.04] Window won't maximize until refocused

Posted: Sat Jan 10, 2026 4:10 am
by kenmo
PureBasic 6.21 x64
and PureBasic 6.30 Beta 7 x64

I updated my Linux OS from ElementaryOS 7.1 to 8.1, which jumps from Ubuntu 22 based to Ubuntu 24.04 based, and I have a PB window problem. Affects default and "gtk2" subsystem. "qt" OK.
Yes I am now using the "Ubuntu 24.04" PB suite.

If a window is opened with #PB_Window_Maximize, it does not start maximized.
It appears within the desktop, and it functions, until I focus another window (Alt+Tab, or mouse click) then it suddenly changes to maximized.


This affects the PB IDE window itself, the PB Help browser, and my own windows opened by OpenWindow() with #PB_Window_Maximize

Example

Code: Select all

If OpenWindow(0, 0, 0, 400, 100, "Timer Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_Maximize | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)
  ProgressBarGadget(0, 10, 10, 380, 20, 0, 100)
  AddWindowTimer(0, 123, 250)
  
  TextGadget(1, 10, 40, 380, 20, "Set focus to another window... this will become maximized")
  
  Value = 0
  Repeat
    Event = WaitWindowEvent()
    
    If Event = #PB_Event_Timer And EventTimer() = 123
      Value = (Value + 5) % 100
      SetGadgetState(0, Value)
    EndIf    
    
  Until Event = #PB_Event_CloseWindow
EndIf

Re: [Ubuntu 24.04] Window won't maximize until refocused

Posted: Sat Jan 10, 2026 10:18 pm
by kenmo
Issue occurs whether I'm in an x11 or a wayland session, confirmed with echo $XDG_SESSION_TYPE, I don't know if that info matters...

Also opening a Requester shows the effect too, it suddenly maximizes its parent window, which was supposed to already be maximized.

Thanks for reading...

Re: [Ubuntu 24.04] Window won't maximize until refocused

Posted: Sat Jan 10, 2026 11:40 pm
by Drone
Hi.
Try to remove #PB_Window_ScreenCentered from the OpenWindow command.

Code: Select all

If OpenWindow(0, 0, 0, 400, 100, "Timer Example", #PB_Window_SystemMenu | #PB_Window_Maximize | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)

Re: [Ubuntu 24.04] Window won't maximize until refocused

Posted: Sun Jan 11, 2026 12:13 am
by kenmo
Drone wrote: Sat Jan 10, 2026 11:40 pm Hi.
Try to remove #PB_Window_ScreenCentered from the OpenWindow command.

Code: Select all

If OpenWindow(0, 0, 0, 400, 100, "Timer Example", #PB_Window_SystemMenu | #PB_Window_Maximize | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)
Good idea, but doesn't solve the issue. It just opens at top-left, unmaximized, and then maximizes whenever I focus any other window.

(plus Maximized | ScreenCentered should work OK together, they always have)


Whatever is happening here, it doesn't seem to trigger a #PB_Event_SizeWindow either. Very noticeable in the IDE, because the IDE will suddenly expand to maximized but the contents (Scintilla, log, tools panel etc.) remain covering just part of the window.