[Ubuntu 24.04] Window won't maximize until refocused

Post bugreports for the Linux version here
User avatar
kenmo
Addict
Addict
Posts: 2078
Joined: Tue Dec 23, 2003 3:54 am

[Ubuntu 24.04] Window won't maximize until refocused

Post 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
User avatar
kenmo
Addict
Addict
Posts: 2078
Joined: Tue Dec 23, 2003 3:54 am

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

Post 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...
Drone
User
User
Posts: 10
Joined: Fri May 03, 2019 10:21 pm

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

Post 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)
User avatar
kenmo
Addict
Addict
Posts: 2078
Joined: Tue Dec 23, 2003 3:54 am

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

Post 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.
Post Reply