<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTOURBUG - [regression] recent ABI changes in xorg-video-intel (intel_drv.so) breaks dual-head XBMC"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=82619">bug 82619</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>NOTOURBUG
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTOURBUG - [regression] recent ABI changes in xorg-video-intel (intel_drv.so) breaks dual-head XBMC"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=82619#c43">Comment # 43</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED NOTOURBUG - [regression] recent ABI changes in xorg-video-intel (intel_drv.so) breaks dual-head XBMC"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=82619">bug 82619</a>
              from <span class="vcard"><a class="email" href="mailto:chris@chris-wilson.co.uk" title="Chris Wilson <chris@chris-wilson.co.uk>"> <span class="fn">Chris Wilson</span></a>
</span></b>
        <pre>I'm using awesome -- I thought it would be a small enough ewmh compliant window
manager to figure out what is going on. So far, I can see the request for the
fullscreen window on the HDMI1 output, I can see awesome place it there, and
then for some reason I haven't fathomed yet, it moves it (when processing the
MapRequest) to only occupy the LVDS.

By learning a little bit of Lua, (I am starting to like that little embedded
interpreter!), I found that awesome was moving the newly mapped windows to the
same screen as the mouse. So the race appears to be between the XWarpPointer
performed by xbmc and the processing of the MapRequest by the window manager.
(The dependence upon the ddx is simply whether or not we block doing some
update or not, changing the relative timings of event processing and client
priorities.)

The correct fix is then:

diff --git a/xbmc/windowing/X11/WinSystemX11.cpp
b/xbmc/windowing/X11/WinSystemX11.cpp
index 018a4d2..76f33c1 100644
--- a/xbmc/windowing/X11/WinSystemX11.cpp
+++ b/xbmc/windowing/X11/WinSystemX11.cpp
@@ -151,7 +151,6 @@ bool CWinSystemX11::DestroyWindow()
   CWinEventsX11Imp::Quit();

   XUnmapWindow(m_dpy, m_mainWindow);
-  XSync(m_dpy,TRUE);
   XDestroyWindow(m_dpy, m_glWindow);
   XDestroyWindow(m_dpy, m_mainWindow);
   m_glWindow = 0;
@@ -659,13 +658,13 @@ bool CWinSystemX11::Restore()
 bool CWinSystemX11::Hide()
 {
   XUnmapWindow(m_dpy, m_mainWindow);
-  XSync(m_dpy, False);
+  XFlush(m_dpy);
   return true;
 }
 bool CWinSystemX11::Show(bool raise)
 {
   XMapWindow(m_dpy, m_mainWindow);
-  XSync(m_dpy, False);
+  XFlush(m_dpy);
   m_minimized = false;
   return true;
 }
@@ -931,7 +930,6 @@ bool CWinSystemX11::SetWindow(int width, int height, bool
fullscreen, const std:
       class_hints->res_class = (char*)classString.c_str();
       class_hints->res_name = (char*)classString.c_str();

-      XSync(m_dpy,False);
       XSetWMProperties(m_dpy, m_mainWindow, &windowName, &iconName,
                             NULL, 0, NULL, wm_hints,
                             class_hints);
@@ -942,14 +940,12 @@ bool CWinSystemX11::SetWindow(int width, int height, bool
fullscreen, const std:
       Atom wmDeleteMessage = XInternAtom(m_dpy, "WM_DELETE_WINDOW", False);
       XSetWMProtocols(m_dpy, m_mainWindow, &wmDeleteMessage, 1);
     }
+
+    XWarpPointer(m_dpy, None, m_mainWindow, 0, 0, 0, 0, mouseX*width,
mouseY*height);
+
     XMapRaised(m_dpy, m_glWindow);
     XMapRaised(m_dpy, m_mainWindow);
-    XSync(m_dpy,TRUE);
-
-    if (changeWindow && mouseActive)
-    {
-      XWarpPointer(m_dpy, None, m_mainWindow, 0, 0, 0, 0, mouseX*width,
mouseY*height);
-    }
+    XFlush(m_dpy);

     CDirtyRegionList dr;
     RefreshGlxContext(m_currentOutput.compare(output) != 0);</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>