Re: Notification of window position change



nicholas allen <nicholas allen ireland sun com> writes:

I am writing a peer set for personal profile for Java which uses
GTk+. I am having trouble notifying the java code that a window has
been moved to a new position (eg by the user dragging it). I can't
find any way of receiving notifications of such an event. There does
not appear to be any signals I can connect to in GtkWindow for this
purpose. Does anyone know how I can acihieve this? I noticed that
there is a "window-position" argument. Is it possible to somehow
listen to changes in an arg on a GtkObvject. I can't find anyway of
doing this either. Any help would be much appreciated.


Connect to configure_event, and look at event->x, event->y. That
should be the position of the window in root window coordinates.

Note that setting that position back may not put the window at those
coordinates. ;-) X is amusing this way, and we expose it.
See: http://www.freedesktop.org/standards/wm-spec/x280.html, 
the section "Window Movement," what it says about XMoveWindow() will
also apply to gdk_window_move().

There's still a plan to add high-level functions to get/set window
position that handle some of the details, those will appear hopefully
in the next couple weeks. Argument is ongoing about how they're
supposed to work, what to name them, blah blah.

Havoc





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