Bad x,y values on resize event
Aaron Plattner
aplattner at nvidia.com
Thu Jul 19 09:27:07 PDT 2007
On Thu, Jul 19, 2007 at 11:19:56AM +0300, Itamar Axelrod wrote:
> Hi all,
>
> I'm trying to get the x,y values of my window during a resize event - but,
> strangely, I seem to get the same values (constant values) all the time.
>
> I create my window using:
>
> *XCreateSimpleWindow(m_Display, RootWindow(m_Display, screen_num), m_X, m_Y,
> m_Width, m_Height, win_border_width, m_BckColor, m_BckColor);*
>
> I subscribe to the xevents I would like to receive:
>
> *attr.event_mask = KeyPressMask | KeyReleaseMask | StructureNotifyMask |
> FocusChangeMask;*
>
> **
>
> *XSelectInput(**m_Vw->getDisplay(), m_Vw->getWindow(), attr.event_mask);*
>
> Then whenever I receive a *ConfigureNotify* related to a *resize event* - I
> check its x and y values and I get the same value every time (independent of
> the window's location).
>From XConfigureEvent(3x):
The x and y members are set to the coordinates *relative to the
parent window's origin* and indicate the position of the upper-left
outside corner of the window.
(emphasis added)
Try XTranslateCoordinates.
> Also, when I try to get the window's attributes or *XGetGeometry* - the x,y
> values I receive are, again, the same.
>
> However, when a move window event is received I do get the correct x,y
> values of my window - but only then!
>
>
>
> Please help,
>
> Thanks in advance,
>
> Itamar.
>
>
>
> P.S.
>
> I using X11 version 6.8
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg
More information about the xorg
mailing list