[XForms] Figuring out a windows state

Jens Thoms Toerring Jens.Toerring at physik.fu-berlin.de
Wed May 19 10:10:57 EDT 2004


On Wed, May 19, 2004 at 02:52:19PM +0100, Angus Leeming wrote:
> On Wednesday 19 May 2004 2:42 pm, Jens Thoms Toerring wrote:
> > To subscribers of the xforms list
> >    I have just a stupid question. I would like to find out if a
> > certain window is iconified or not. I looked throught the documen-
> > tation and also tried to find something fitting in the sources but
> > to no avail, no function seems to exist that helps me finding that
> > out. So, do I have to do that myself using XGetWindowProperty()
> > or something similar or am I just not looking carefully enough?
> 
> No, you're looking closely enough. 
> 
> FWIW, this is how LyX goes about showing an iconified window.
> 
> HTH,
> Angus
> 
> 	if (form()->visible) {
> 		fl_raise_form(form());
> 		/* This XMapWindow() will hopefully ensure that
> 		 * iconified dialogs are de-iconified. Mad props
> 		 * out to those crazy Xlib guys for forgetting a
> 		 * XDeiconifyWindow(). At least WindowMaker, when
> 		 * being notified of the redirected MapRequest will
> 		 * specifically de-iconify. From source, fvwm2 seems
> 		 * to do the same.
> 		 */
> 		XMapWindow(fl_get_display(), form()->window);
> 	} else {
> 		// calls to fl_set_form_minsize/maxsize apply only to the next
> 		// fl_show_form(), so this comes first.
> 		fl_set_form_minsize(form(), minw_, minh_);
> 		if (!allow_resize_)
> 			fl_set_form_maxsize(form(), minw_, minh_);
> 
> 		string const maximize_title = "LyX: " + title_;
> 		int const iconify_policy =
> 			getController().IconifyWithMain() ? FL_TRANSIENT : 0;
> 
> 		fl_show_form(form(),
> 			     FL_PLACE_MOUSE | FL_FREE_SIZE,
> 			     iconify_policy,
> 			     maximize_title.c_str());
> 	}

Thanks, but as far as a quick test shows me form()->visible seems only
to tell me if the window is mapped, it doesn't seem to make a difference
if the window is fully visible or iconified. So what your code seems to,
as far as I understand it, is to make sure a window gets de-iconified.
But for my problem I need to know if a window is iconfied because I
take that as a hint from the user on how to continue within the program.
So, I probably will have to figure out how to get XGetWindowProperty()
to tell me ;-)
                                        Thanks, Jens
-- 
  \   Jens Thoms Toerring  ___  Jens.Toerring at physik.fu-berlin.de
   \__________________________  http://www.toerring.de



More information about the Xforms mailing list