On Mon, 4 Feb 2002, Bob Bomar wrote:

> I was wondering how X knows when you click on an icon or an application, what
> was actually clicked, for lack of better words.  I am in a Calculs 3 class in
> college and we are working on Vectors in 2D and 3D.  I was wondering how X
> knows when you click on a certain icon, what application should it run.  I was
> guessing that since X knows the coordinate of the cursor and the coordinate area
> of the icon, that when you click within that area, it runs the application
> associated with that area.  I was also guessing that X uses the vector to the
> cursor and that it knows the vectors that correspond to that icon, so therefor
> knows the application to use.  In either case, I was wanting to look at that
> section of the code and see how it did it.  I am a novice programmer with
> limited programming experiance with C/C++, Perl, and sh.  I appreciate any help

No, what happens is a little different. Each application, while running,
reserves a rectangular part of the screen - a window. Windows can lie in
different planes so it is like a pile of paper - all aligned vertically
but one can be on top of the other. What X does is intersect them all to
find out which regions are visible. And when you click with the mouse it
looks up which application owns the area under the mouse and passes the
event to it. It is up to the application now to decide what to do with a
mouse click.

This explanation is somewhat simplistic, since applications can request to
monitor all events and can also request to restrict to pass events only to
themselves - but read documentation for that :))

If you want to go somewhat deeper in the mathematics of this, take a look
at the notion of the "semiring of sets" - the comparison is quite rewarding.

                          Vladimir Dergachev

>
>
> Thanks
>
> Bob
> _______________________________________________
> Xpert mailing list
> [EMAIL PROTECTED]
> http://XFree86.Org/mailman/listinfo/xpert
>

_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to