
mtdean at thirdcontact
Sep 5, 2004, 7:46 PM
Post #1 of 8
(6525 views)
Permalink
|
|
Workaround for WM Focus Issues
|
|
/me punts What follows is an ugly hack. Continue reading at your own risk. ;) I'm using Fluxbox 0.9.x as a WM and have tried RatPoison and TWM. With all three, I have been having a problem that after running xine, mythfrontend receives focus, but on certain screens (such as the "Do you really want to exit" screen and the Program Guide, among others), there are "focus issues." For example, the exit screen displays with neither the Yes nor the No button highlighted and I have to move the mouse to "reset" focus so I could select one or the other. On the Program Guide, I am able to move one space in any direction and after doing so the arrow keys stop working (but the escape key works fine????) until i "reset" focus with the mouse. I tried all day to figure out what setting I needed to change--testing various configurations of Fluxbox (focus policies, new window focusing, autoraise, etc.) and xine (gui.always_layer_above and gui.always_layer, etc.)--and after several hours without any luck, I took the easy way out. Since it's possible to regain focus by moving the mouse to the edge of the screen and then back into the mythfrontend window, I wrote a script to do that for me. Yes, I know this is treatin the symptom and not the problem. No, I don't live in Redmond, WA. ;) The movemouse script uses the X Windows XTrap extension to perform a simple movement of the mouse cursor (moves the mouse to 0,0, then in a small box around the screen (screen size >= 640x480), and leaves it well within the mythfrontend window (at 320, 240)). To use the script, you must load the xtrap module: verify you have xtrap by running "man xtrap" or "which xtrapin" and, if available and if you haven't done so before, add the "Load" line below to the modules section of your XF86Config or xorg.conf as shown (do not remove any other "Load" lines you may have). Section "Module" Load "xtrap" EndSection Make sure your WM is set to use sloppy or semi-sloppy focus (as appropriate for your WM), and ensure that the movemouse script is run after using any program that causes focus problems. I did so by creating a script ~mythtv/bin/xine that calls /usr/bin/xine with the supplied arguments and then runs the movemouse script (see the three line script below). Appending a "; movemouse" to the end of your player command should also work. The script completes in 60ms, so you shouldn't even notice it (but if you do, feel free to change the value of TS from 10 to some smaller number of ms :). If anyone knows of a solution to the problem or a less ugly workaround, please let me know. Mike contents of ~mythtv/bin/xine: #!/bin/sh /usr/bin/xine $@ movemouse &
|