restore size/position of gtk window



I posted on this topic a few days ago and didn't get a response. Now I'm trying a more specific variant of my question after doing some testing.

What I'd like is for my gtk app to "remember" the size and position of its main window from one session to another (at least as an option).

I have tried attaching a callback to "configure_event" on the main window, which enables me to record x and y position plus width and height. In its simplest form, this does not work properly (as is suggested in the GTK docs): restoration of the main window is subject to "creep," which can result in crucial elements of the main window going off-screen or under the taskbar.

On linux (more specifically, with Sawfish as window manager) I can fix that by taking the main window's x and y position from the function

gdk_window_get_root_origin()

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?

--
Allin Cottrell
Department of Economics
Wake Forest University, NC



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