Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

Workaround for WM Focus Issues

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


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 &
Attachments: movemouse (1.60 KB)


mythtv at ml

Sep 6, 2004, 3:31 AM

Post #2 of 8 (6301 views)
Permalink
Re: Workaround for WM Focus Issues [In reply to]

"Michael T. Dean" <mtdean [at] thirdcontact> uttered the following thing:
> /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.

Perhaps xine doesnt like this (I only use mplayer), but I run mythtv
with no window manager at all - I just start the X server manually and
have mythtv open immediately in the X server. No window manager and no
focus problems.

BB


mtdean at thirdcontact

Sep 6, 2004, 5:26 AM

Post #3 of 8 (6299 views)
Permalink
Re: Re: Workaround for WM Focus Issues [In reply to]

On 09/06/2004 06:31 AM, Ben Buxton wrote:

>"Michael T. Dean" <mtdean [at] thirdcontact> uttered the following thing:
>
>
>>/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.
>>
>>
>Perhaps xine doesnt like this (I only use mplayer), but I run mythtv
>with no window manager at all - I just start the X server manually and
>have mythtv open immediately in the X server. No window manager and no
>focus problems.
>
>
Well, I just tried without any WM, and got the same result. I'm pretty
certain it's part of my xine configuration--I just don't know what setting.

Thanks for the feedback.

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


tait at digitallaw

Sep 6, 2004, 10:20 AM

Post #4 of 8 (6275 views)
Permalink
Re: Re: Workaround for WM Focus Issues [In reply to]

At 13:26 06/09/2004, you wrote:
>On 09/06/2004 06:31 AM, Ben Buxton wrote:
>
>>"Michael T. Dean" <mtdean [at] thirdcontact> uttered the following thing:
>>
>>
>>>/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.
>>>
>>Perhaps xine doesnt like this (I only use mplayer), but I run mythtv
>>with no window manager at all - I just start the X server manually and
>>have mythtv open immediately in the X server. No window manager and no
>>focus problems.
>>
>Well, I just tried without any WM, and got the same result. I'm pretty
>certain it's part of my xine configuration--I just don't know what setting.
>
>Thanks for the feedback.
>
>Mike

Funny, I don't experience any of this. I too am using Flux 0.9 and xine
with pretty much default options - the only changes I can recall making
were enabling sloppy focus and turning on the colourpaint option to get
around that Xv nastiness:

banquo root # cat /home/mythtv/.fluxbox/init
session.screen0.slit.direction: Vertical
session.screen0.slit.autoHide: false
session.screen0.slit.maxOver: false
session.screen0.slit.onhead: 0
session.screen0.slit.layer: Dock
session.screen0.slit.alpha: 255
session.screen0.slit.onTop: False
session.screen0.slit.placement: BottomRight
session.screen0.tab.alignment: Left
session.screen0.tab.height: 16
session.screen0.tab.placement: Top
session.screen0.tab.rotatevertical: True
session.screen0.tab.width: 64
session.screen0.toolbar.height: 0
session.screen0.toolbar.tools: workspacename, prevworkspace,
nextworkspace, iconbar, systemtray, prevwindow, nextwindow, clock
session.screen0.toolbar.visible: true
session.screen0.toolbar.onhead: 0
session.screen0.toolbar.onTop: False
session.screen0.toolbar.autoHide: false
session.screen0.toolbar.widthPercent: 66
session.screen0.toolbar.maxOver: false
session.screen0.toolbar.layer: Desktop
session.screen0.toolbar.placement: BottomCenter
session.screen0.iconbar.mode: Workspace
session.screen0.iconbar.alignment: Relative
session.screen0.iconbar.clientWidth: 70
session.screen0.iconbar.usePixmap: true
session.screen0.fullMaximization: false
session.screen0.antialias: false
session.screen0.menuDelayClose: 0
session.screen0.showwindowposition: true
session.screen0.workspacewarping: true
session.screen0.edgeSnapThreshold: 0
session.screen0.opaqueMove: false
session.screen0.autoRaise: false
session.screen0.rowPlacementDirection: LeftToRight
session.screen0.menuMode: Delay
session.screen0.workspaces: 4
session.screen0.imageDither: false
session.screen0.desktopwheeling: true
session.screen0.workspaceNames: one,two,three,four,
session.screen0.rootCommand: mythfrontend
session.screen0.clickRaises: true
session.screen0.menuAlpha: 255
session.screen0.focusLastWindow: true
session.screen0.colPlacementDirection: TopToBottom
session.screen0.strftimeFormat: %k:%M
session.screen0.menuDelay: 0
session.screen0.windowPlacement: RowSmartPlacement
session.screen0.focusNewWindows: true
session.screen0.sloppywindowgrouping: true
session.screen0.resizeMode:
session.screen0.focusModel: SloppyFocus
session.titlebar.left: Stick
session.titlebar.right: Minimize Maximize Close
session.colorsPerChannel: 4
session.tabs: true
session.groupFile:
session.useMod1: true
session.updateDelayTime: 0
session.doubleClickInterval: 250
session.opaqueMove: False
session.cacheMax: 200l
session.autoRaiseDelay: 250
session.imageDither: True
session.ignoreBorder: false
session.menuFile: ~/.fluxbox/menu
session.iconbar: true
session.cacheLife: 5l
session.styleFile: /usr/share/fluxbox/styles/Meta
session.numLayers: 13
session.slitlistFile:
session.keyFile: ~/.fluxbox/keys

banquo root # cat /home/mythtv/.xine/config | grep paint
# autopaint colour key
video.xv_autopaint_colorkey:1


mford2 at comcast

Jan 12, 2005, 4:54 PM

Post #5 of 8 (6031 views)
Permalink
Re: Workaround for WM Focus Issues [In reply to]

On Sunday 05 September 2004 10:46 pm, Michael T. Dean wrote:
> /me punts
>
>
> If anyone knows of a solution to the problem or a less ugly workaround,
> please let me know.
>
> Mike
>
I found a fix digging around the net. There's a section of Xine source code
that sets the focus to the root window upon exit (event.c line 1814-1819).
The attached patch comments out that section. Apply to xine-ui-0.99 and
recompile. This fixed it for me!
--
Mike F.
Attachments: rootfocus.patch.bz2 (0.45 KB)


mtdean at thirdcontact

Jan 11, 2006, 8:47 PM

Post #6 of 8 (5431 views)
Permalink
Re: Workaround for WM Focus Issues [In reply to]

On 01/12/05 19:54, Michael Ford wrote:

>On Sunday 05 September 2004 10:46 pm, Michael T. Dean wrote:
>
>
>>/me punts
>>
>>
>>If anyone knows of a solution to the problem or a less ugly workaround,
>>please let me know.
>>
>>
>I found a fix digging around the net. There's a section of Xine source code
>that sets the focus to the root window upon exit (event.c line 1814-1819).
>The attached patch comments out that section. Apply to xine-ui-0.99 and
>recompile. This fixed it for me!
>
>
For the archives... I can confirm that this fix works (finally got
around to testing it) and, as pointed out by Petr Stehlik in another
thread, it's already applied to xine-ui 0.99.4 and above. So the
easiest fix is to upgrade xine.

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


watkinshome at gmail

Jan 12, 2006, 3:29 AM

Post #7 of 8 (5435 views)
Permalink
Re: Workaround for WM Focus Issues [In reply to]

> >>If anyone knows of a solution to the problem or a less ugly workaround,
> >>please let me know.
> >>
> >>
> >I found a fix digging around the net. There's a section of Xine source code
> >that sets the focus to the root window upon exit (event.c line 1814-1819).
> >The attached patch comments out that section. Apply to xine-ui-0.99 and
> >recompile. This fixed it for me!
> >
> >
> For the archives... I can confirm that this fix works (finally got
> around to testing it) and, as pointed out by Petr Stehlik in another
> thread, it's already applied to xine-ui 0.99.4 and above. So the
> easiest fix is to upgrade xine.

Well if you're using KDE then Jarod Wilson has a suggestion in his
excellent howto

http://wilsonet.com/mythtv/

something to do with the 'focus follows mouse' KDE setting.

Now I'm using the ratpoison window manager with mythtv and Xine, and
have never had a problem with window focus.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Jan 12, 2006, 12:59 PM

Post #8 of 8 (5423 views)
Permalink
Re: Workaround for WM Focus Issues [In reply to]

David Watkins wrote:

>>>>If anyone knows of a solution to the problem or a less ugly workaround,
>>>>please let me know.
>>>>
>>>I found a fix digging around the net. There's a section of Xine source code
>>>that sets the focus to the root window upon exit (event.c line 1814-1819).
>>>The attached patch comments out that section. Apply to xine-ui-0.99 and
>>>recompile. This fixed it for me!
>>>
>>For the archives... I can confirm that this fix works (finally got
>>around to testing it) and, as pointed out by Petr Stehlik in another
>>thread, it's already applied to xine-ui 0.99.4 and above. So the
>>easiest fix is to upgrade xine.
>>
>Well if you're using KDE then Jarod Wilson has a suggestion in his
>excellent howto
>
>http://wilsonet.com/mythtv/
>
>something to do with the 'focus follows mouse' KDE setting.
>
>
Which is how your WM should be configured, but it still didn't work with
affected versions of xine-ui (as it turns out, versions that set focus
to the root window on exit), which was the whole point of the thread.

>Now I'm using the ratpoison window manager with mythtv and Xine, and
>have never had a problem with window focus.
>
Perhaps because some kind packager patched your version of xine (had you
not trimmed the attributions, you would be able to notice that this fix
was pointed out a year ago, today*--like I said, "For the
archives..."--and it's quite probable that some packagers knew of a fix
before Mike Ford pointed out a fix on /this/ list--especially
considering he found his fix elsewhere on the 'net). Using ratpoison
and xine-ui without the patch, I still saw the problem. And, since
there's no reason not to upgrade to xine-ui 0.99.4, workarounds are no
longer necessary.

Mike

*Note that I got around to testing it 20 hours short of a year.
Unfortunately, testing was low on my priority list because my
workaround--the one posted in the thread--worked and couldn't harm
anything even if the problem didn't exist.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.