Re: restore size/position of gtk window



On Thu, 2005-10-20 at 16:41, Allin Cottrell wrote:
This eliminates the creep.  But so far I have found nothing that 
fixes window creep on win32.  If a user maximizes my app's main 
window, then despite my best efforts, when we attempt to restore the 
maximized main window on startup it is offset relative to the screen 
such there's a margin of exposed desktop at the top and crucial 
stuff goes under the Windows taskbar.

Is there any known fix for this?
As you've probably figured out the creep is caused by the window's title
bar and depends on the window manager. (When you request that a window
be positioned on the screen, the WM usually puts the window's title
there, and the window itself is offset by the height of the title bar.
Also slightly offset by the width of the window border)

Since there's only one window manager under MS Windows you should be
able to compute the title bar's height once and 
        if ( on_MS_Windows )
            y -= WINDOWS_TITLE_HEIGHT
It might depend on the font size...

You can always open a window at some specific offscreen location, check
where the WM actually put the window, and then use that value to fix up
your positioning.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]