<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-GB link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='color:#1F497D'>Hi, I had a look at XFilterEvent.
My problem is that currently I am not receiving any MotionNotify events when my
mouse goes over certain windows that I have XSelectInput() on, and so XNextEvent()
is not getting any events for me to use with XFilterEvent.<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>With Eclipse-CDT's window, what
is strange, is I will get maybe 1 or 2 MotionNotify Events at the edges of the
window when I am entering it with the pointer, but within the window I get
none. The only other possibility I can think of is that the window I am selecting
on is not the correct one, but there are other windows drawn on top of this one.
<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>I have enumerated the whole
window tree (from the root) and I am currently using SelectInput() on a window  that
I retrieve based on its WM_NAME, from the window tree.<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>However if this is not the window
that I should select on (the named one), I cannot see how to accurately 
work out which other window it should be. There seem to be *<b>many</b>* unnamed
windows that also exist in the window tree, that are just children of the Root
window .I can't quite see what other information is available on these unnamed
windows that I can key on, to work out that it is part of 'application XXX..'<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>any suggestions ?<o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'>Rob. <o:p></o:p></span></p>

<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:
"Tahoma","sans-serif";color:windowtext'>From:</span></b><span lang=EN-US
style='font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext'>
Jay.Cotton@Sun.COM<br>
<b>Sent:</b> 04 December 2009 22:34<br>
<b>Subject:</b> Re: Mouse Events in X11<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Have a look at XFilterEvent that may do it for you.  <br>
<br>
<br>
On 12/04/09 14:13, Robin Watson wrote: <o:p></o:p></p>

<p class=MsoNormal>Hello. I am attempting to globally hook or ideally hook
mouse events on a single window using Xlib. I am using Fedora 11. I am
attempting to get the events I want using XSelectInput() on the default
display, with the Window of the application I am trying to read the mouse
events from, using PointerMotionMask. However, I am finding that this seems to
be working intermittently. <o:p></o:p></p>

<p class=MsoNormal> <o:p></o:p></p>

<p class=MsoNormal>Various windows on the desktop, such as the Konsole window,
or Kwrite hook perfectly. and I get a stream of all the mouse move events when
I mouse over these windows. However I am having problems with certain other
windows such as Eclipse-CDT amongst others. Some of these windows seem to feed
back no mouse movement information.<o:p></o:p></p>

<p class=MsoNormal> <o:p></o:p></p>

<p class=MsoNormal>I have tried using xev to test whether there was a problem
with my code or not. However even if I get the Window ID with
xwininfo,(clicking on for example Eclipse-CDT, and then feeding this Window ID
to xev -id  it will also not recieve the any mouse movement events for
this window.<o:p></o:p></p>

<p class=MsoNormal> <o:p></o:p></p>

<p class=MsoNormal>I am confused as to why XSelectInput() will get be able to
select on MotionNotify events on some windows and not others. Eclipse-CDT is
certainly not grabbing the mouse cursor. If anyone could shed any light as to
why I might not be recieving these events on some windows that would be very
helpful.<o:p></o:p></p>

<p class=MsoNormal> <o:p></o:p></p>

<p class=MsoNormal>Thanks<o:p></o:p></p>

<p class=MsoNormal> <o:p></o:p></p>

<p class=MsoNormal>Rob.<o:p></o:p></p>

<pre><o:p> </o:p></pre><pre style='text-align:center'>

<hr size=4 width="90%" align=center>

</pre><pre><o:p> </o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>xorg mailing list<o:p></o:p></pre><pre><a
href="mailto:xorg@lists.freedesktop.org">xorg@lists.freedesktop.org</a><o:p></o:p></pre><pre><a
href="http://lists.freedesktop.org/mailman/listinfo/xorg">http://lists.freedesktop.org/mailman/listinfo/xorg</a><o:p></o:p></pre><pre>  <o:p></o:p></pre>

<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p> </o:p></span></p>

</div>

</body>

</html>