Owen Taylor otaylor at redhat.com
Fri Dec 3 15:05:26 PST 2004

On Fri, 2004-12-03 at 15:54 -0500, Kristian Benoit wrote:
> Kristian Benoit wrote:
> > Kristian Benoit wrote:
> >
> >> I want to know when a resize comme from XResizeWindow or from the 
> >> user resizing the window by hand, but cant find any way to do it. 
> >> Anyone know how to do that ?
> >>
> > I found a way !!! :)
> >
> > XSendEvent({client message "Start Resizing"});
> > XResizeWindow(...);
> > XSendEvent({client message "Stop Resizing"});
> > XFlush();
> >
> > Then I know If the resize comme from me !!! :)
> >
> That does not seem to work as I always get the ConfigureNotify before 
> the Start Resizing client message. Even if I sync just before XResizeWindow.
> Any idea on how to make sure the client message get queued before the 
> ConfigureNotify ?

I sort of doubt you'll get the ConfigureNotify first. I don't see
how that could happen. Maybe you are actually getting the
ConfigureNotify for a *previous* resize?

Anyways, I would suggest that it's actually not well defined:

 - Your window is 100x100
 - You XResizeWindow to 150x150
 - The user grabs the window and resizes to 150x150
 - You get a ConfigureNotify from the user resize
 - The window manager processes your request and sends a
   synthetic ConfigureNotify because it didn't do anything

When you get the first ConfigureNotify from the user resize, there 
is no way to tell that it isn't from your request.

You can tell that a new size *wasn't* from a XResizeWindow (because
you've gotten replies for every request you've made). You can't tell
that a new size *is* from a XResizeWindow.

I would suggest that in general a properly written program shouldn't
care where a resize comes from. 

GTK+ does a little bit of optimization - if it knows that it has sent
out three ConfigureRequests and only has gotten two replies back,
it will wait for the third reply before processing the new size.

But if the user starts resizing the window at the same time, it will
process at the third ConfigureNotify even if it's from the user's


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg/attachments/20041203/b8190b80/attachment.pgp>

More information about the xorg mailing list