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]
	cwd=/home/federico
	list_type=2
	...bla bla...

	[Window 1]
	cwd=/cvs/mc-head/gnome
	list_type=1
	...bla bla...

	[...etc...]

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.

  Federico



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