saving/restoring window position



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?

Thank you,
Olaf



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