<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 23, 2014 at 3:06 AM, Kulig, Mariusz <span dir="ltr"><<a href="mailto:mkulig@psi.pl" target="_blank">mkulig@psi.pl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="PL" link="blue" vlink="purple"><div><p class="MsoNormal"><span lang="EN-US">Hi<u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">I try to understand  how focus is managed in XI2 environment with multiple input devices (MPX). I noticed that Openbox sends <i>SetInputFocus</i> request to set focus on window which was clicked. Openbox works properly with multiple cursors and keyboards from XI2 extension, I can use one master device pair to operate on one window and another master pair to operate on another window. But Openbox does not use XI2 extension and uses core <i>SetInputFocus</i> request which does not define device id. </span><span lang="EN-GB">In XI2 focus is set for the given master keyboard device to the given X window (</span><i><span lang="EN-US" style="color:black">XISetFocus</span></i><span lang="EN-US" style="color:black"> method</span><span lang="EN-US">  <span style="color:black"><a href="http://www.x.org/archive/X11R7.5/doc/man/man3/XIGetFocus.3.html" target="_blank">http://www.x.org/archive/X11R7.5/doc/man/man3/XIGetFocus.3.html</a></span></span><span lang="EN-US" style="font-size:13.5pt;color:black">)</span><span lang="EN-GB">. </span><span lang="EN-US"> I think that If server receives <i>SetInputRequest</i> request which does not contain device id then server shouldn’t know on which device it should set focus to the given window. But it works and I have no idea how it works. How does server know on which keyboard master device to set the focus? Maybe when X server receives <i>SetInputFocus request </i>it checks which master pointer is on window contained in request and sets focus on master keyboard which is a pair of master pointer.  I posted question on superuser StackExchange (<a href="http://superuser.com/questions/813939/how-focus-is-managed-in-x-window-system-with-xi2" target="_blank">http://superuser.com/questions/813939/how-focus-is-managed-in-x-window-system-with-xi2</a>) but It has remained  unanswered.  I used <i>xscope</i> to monitor communication between X server, Openbox and other clients. May be <i>xscope</i> does not show everything. <u></u><u></u></span></p><p class="MsoNormal"><span lang="EN-US">Please explain me how it works.</span></p></div></div></blockquote><div><br></div><div>I'm also not sure. I would try looking around in the X server implementation of SetInputFocus or in XI2's backward compatibility code. I doubt cursor position has anything to do with it though.</div></div></div></div>