DocumentWindow doesn't always come up correct size


#1

This is a long-term issue I've  been having on Linux.  My main window is derived from DocumentWindow using native toolbars.  In the constructor I set the bounds (or specific size, depending).  Most of the time, the window shows up correctly, but sometimes it shows up as a 128x128 window (instead of, say 800x600).  

This only occurs on Linux, so my presumption is that it may be a timing issue with X messages or something. But I've no clue where to look to debug this.

I"m running Mint 17 with the Cinnamon window manager (not that it *should* make a difference, but who knows)

Any help would be most appreciated.


#2

Am I the only one with this issue?


#3

Not something that I've ever seen..


#4

This is something I have seen from time to time, maybe not with a 128x128 window, but I know I have some horrible workarounds in my code to prevent the main window (with native toolbar) from being 1x1 (randomly of course). I also recall having a lot of hard time to get the main window to show up reliably with a native titlebar at the correct size and without flickering (like when it temporarily appears at position (0,0) before it is moved at its final position).

These workaround are now quite old so I don't know if they are still required, but in my version , I have a timerCallback that checks if the main window has a suspicious size (like getWidth() < 100 & getHeight < 100) and then performs a resize of the content component. It is that ugly.


#5

I can't figure it out.  The window always ends up as 128x128 (when there's a problem).  My only hope here is to do an initialization-only callback on the 'resize()' which checks the current size, and if it doesn't match the size it should be, then resize the window.  Dunno if that will work...


#6

Well, it does.  So for LInux and Raspberry Pi, I'm trapping after a 'resize to this size' command, and checking on the resize() callback if the item has the right size.  This does seem to work, though it is really, really ugly.