Re: [gtk-list] saving/restoring window position



On Mon, 16 Aug 1999, Olaf Klischat wrote:

> Hello!
> 
> I want to save the position of the main window when my program exits and restore it when it is next 
> started.
> 
> Currenty, I' using
> 
> gdk_window_get_position (GTK_WIDGET(mainwindow)->window, &x,&y)
> 
> to save the position and
> 
> gdk_window_move (GTK_WIDGET(mainwindow)->window, x,y)
> 
> to restore it.
> But, unfortunately, the gdk_window_move command places the window somewhat underneath where it was 
> placed on the last gdk_window_get_position call (it seems that gdk_window_move also considers the 
> "decorations" generated by the window manager (title bar, borders), while gdk_window_get_position does 
> not).
> Getting the position through widget->allocation.(x,y) doesn't work either...
> 
> Any suggestions, anyone?

gdk_window_get_position() returns the position of the actuall gtk window, while
gdk_window_move() will actually determine the position of the window mananagers
window for toplevels.
you want to save the position of the window managers decoration window, which
can be aquired through gdk_window_get_deskrelative_origin().

> 
> Thank you,
> Olaf
> 

---
ciaoTJ



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