Re: Application window size.

>  How does an application uniquely identify its (multiple) top-level
>  windows?
>  e.g. with gnome-terminal as it may have multiple windows open.

You should take a look at how MC does this (yes, this is a clean
portion of MC's code!) :-)  Take a look at mc/gnome/gsesssion.c.

Basically, you keep a list of all your windows (but you already do).
You then do

	gtk_window_set_wmclass (w, "gnome-terminal", "unique-id");

For MC's unique identifier I am using a simple sequential integer.
MC's "panel" structure, which represents a file window, holds an
integer that is generated when a new window is created.

For session management, my session data file looks like this:

	[Window 0]
	...bla bla...

	[Window 1]
	...bla bla...


I.e. it is a gnome-config file and each section is named according to
the windows' unique IDs.  I iterate through them and re-create windows
as appropriate.


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