[XForms] Figuring out a windows state
Angus Leeming
angus.leeming at btopenworld.com
Wed May 19 09:52:19 EDT 2004
On Wednesday 19 May 2004 2:42 pm, Jens Thoms Toerring wrote:
> To subscribers of the xforms list
>
>
> Hi,
>
> 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());
}
More information about the Xforms
mailing list