Ansible
January 20th, 2008, 07:43 PM
I'm writing an application with GTK+, and I'd like to save/restore the window position so that it is the same size as the last time the app was run. Restoring window position is a secondary concern, but that would be nice too.
I got this to work with gtk_window_resize and gtk_window_move. However, the GTK docs say that "It's much preferred to let the window manager handle these things rather than doing it yourself". However, the window manager doesn't save and restore my window position or size, if I don't resize it myself it comes up in the minimum size every time, usually in a random corner of the screen. I don't see anything in the GTK docs to enable save/restore in the window manager.
So I want to do the right/standard thing here, whatever that is. Is there a way to tell GTK to tell the window manager to save/restore my window position?
An additional complication is that my app is cross platform, so all this has to work in ms windows too - although I could use an alternative method on that platform if necessary.
I got this to work with gtk_window_resize and gtk_window_move. However, the GTK docs say that "It's much preferred to let the window manager handle these things rather than doing it yourself". However, the window manager doesn't save and restore my window position or size, if I don't resize it myself it comes up in the minimum size every time, usually in a random corner of the screen. I don't see anything in the GTK docs to enable save/restore in the window manager.
So I want to do the right/standard thing here, whatever that is. Is there a way to tell GTK to tell the window manager to save/restore my window position?
An additional complication is that my app is cross platform, so all this has to work in ms windows too - although I could use an alternative method on that platform if necessary.