Window focus problem with WINE and Alt-Tab in XFCE 4.0

Mike McCormack mike at codeweavers.com
Mon Dec 22 05:59:43 CET 2003


Hi Oliver,

I have investigated this further, and I believe that Wine is doing the 
right thing, and that xfwm4 is doing the wrong thing.

xfwm4 is sending a FocusIn event to our window, yet we are using the
WM_TAKE_FOCUS protocol as specified by the ICCCM.  You need to send us a
WM_TAKE_FOCUS client message instead of a FocusIn event.

See: http://tronche.com/gui/x/icccm/sec-4.html#s-4.2.8

See below for a patch that shows the problem very clearly, and which can 
be used for a workaround when Wine is used with xfwm4.

Mike


> It *is* a WINE issue, focus is broken in wine. Simply let the WM manage
> WINE windows:
> 
> ; Allow the window manager to manage created windows
> "Managed" = "Y"
> 
> In your $HOME/.xine/config
> 
> Cheers,
> Olivier.
> 
> On Tue, 2003-09-30 at 18:01, Eric Pell wrote:
>> When running Windows applications through WINE while using XFCE the
>> window does not focus correctly when switching applications via
>> ALT-TAB.  It does appear to have the focus on the window you are
>> selecting but you cannot use the program WINE is running unless you
>> click on the window.  It appears that the focus is being given to the
>> window manager border and not the actual application.  This does not
>> appear to be a WINE issue because it works fine using Gnome or KDE. 
>> I'd really like to move XFCE into production for our end users here
>> because it is such a fast user interface but this issue is stopping me
>> from doing such.  I'm running XFCE 4.0 along with the latest version
>> of WINE (20030911) all running on Red Hat 9.
>> 
>> Any suggestions?
>> 
>> Thanks!
>> 
>> Eric Pell

Index: dlls/x11drv/event.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/event.c,v
retrieving revision 1.30
diff -u -r1.30 event.c
--- dlls/x11drv/event.c 5 Dec 2003 04:45:50 -0000       1.30
+++ dlls/x11drv/event.c 22 Dec 2003 04:36:25 -0000
@@ -494,7 +494,6 @@
          XSetICFocus( xic );
          wine_tsx11_unlock();
      }
-    if (use_take_focus) return;  /* ignore FocusIn if we are using take 
focus */

      if (!can_activate_window(hwnd))
      {





More information about the Xfce mailing list