Re: Question on Iconify and Deiconify



Indrayana Rustandi <Indrayana Rustandi Sun COM> writes:

I'm working on a GTK peer set for Java here at Sun. Now I need to
implement catching window (de)iconify events from the GTK layer. I
heard that this functionality is available for GTK 2.0, but at this
stage I need to work with GTK 1.2. Looking at the API, I saw the
signals map-event and unmap-event, which might be supersets for
these events, but not quite the equivalent. I assume I might need to
go to the X layer to catch these events. We already have to go to
the X layer to iconify window programmatically (using the
XIconifyWindow function). I'm looking for any tips that you guys
might have.


unmap_event is the correct way to tell when you've been
iconified. Note that you can't tell what user-visible form of
iconification this is (window shading, actual iconification with an
icon, minimization, or window-not-on-current-workspace). The deiconify
will result in a map_event. The way you tell whether a map/unmap means
iconification or not is by checking whether the window is currently
mapped according to client-side state; if the window is mapped
according to GDK's client-side state, then the unmap must have been
initiated by the window manager, and similarly if the window is
unmapped and the WM maps it.

This is all specified in the ICCCM and clarified further in the EWMH
(www.freedesktop.org).

Havoc




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