[mythtv-users] is there a way to force mythfrontend to actually _obey_ -geometry?

Robert M. Riches Jr. rm.riches at jacob21819.net
Fri Jan 6 03:28:11 UTC 2012


> From: "Michael T. Dean" <mtdean at thirdcontact.com>
> To: Discussion about MythTV <mythtv-users at mythtv.org>
>
> On 01/05/2012 10:40 AM, Ronald Frazier wrote:
> > On Thu, Jan 5, 2012 at 5:31 AM, Mark Kendall wrote:
> >>> Using the mythtv-frontend-0.24.1-20111019.0.1.mga1 and
> >>> other packages supplied with Mageia 1 64-bit, I invoke
> >>> mythfrontend with -geometry 640x360-0+0.  The window
> >>> comes up correctly, the right size and in the upper
> >>> right-hand corner of the screen.  However, a second or
> >>> so later, it moves to the upper left-hand corner.  Is
> >>> there a -yes-actually-do-obey-geometry option or one
> >>> to that effect?
> >> Based upon your arguments, mythfrontend *should* be in the top left
> >> corner. Arguments 3 and 4 (which should be +X+Y) are offsets from that
> >> corner. The fact that it first appears in the top right will just be
> >> something related to your window manager.
> > Notice that he's NOT using +X+Y, but rather -X+Y. I think his thinking
> > is that -0 would mean zero pixels from the right edge. A lot of
> > window/gui systems use that sort of scheme. Whether or not myth does,
> > I have no idea, but I imagine that's what he's thinking it does
>
> Right.  MythTV is not using Xlib code to handle -geometry, but is using 
> a hack that was never written to allow support for using negative to 
> index off the right/bottom.  (It will accept negative offsets, but 
> ignores them.)
>
> The reason we do this is because MythTV provides settings for location 
> and offset, so -geometry is actually just a -O override for those 
> settings.  In other words, MythTV's providing support for specific 
> window sizing and placement (regardless of that performed by the Window 
> Manager) requires that we ignore the X-provided code.
>
> The reason he sees it in the "proper" place first, then it snaps to the 
> MythTV-defined place, is because the initial window is created and 
> placed by the Window Manager, then MythTV requests that it be moved.  
> You can also see this if you do: mythfrontend -geometry 800x600 (don't 
> specify a location)...  It will create the window and place it wherever 
> your Window Manager likes, then MythTV will request that it be moved to 
> the proper place.  Note, also, that on some systems, you may have a race 
> condition where the "move" request doesn't actually occur at the right 
> time, so the window stays in the wrong place.
>
> If someone really wants the negative offset support, they can write a 
> patch, but, alternatively, they could do a little math to get the 
> positive offsets or they could move the window manually.
>
> Mike


Thanks for explaining what mythfrontend does.  It is true that
I'm using -X+Y, which is the documented syntax for X geometry
specifications to place a window relative to the upper-right-hand
corner of the screen.  It appears mythfrontend does not support
the documented syntax for the -geometry option.

It would be nice if -geometry supported the full documented
syntax.  It could perhaps argued that if the non-MythTV (XLib?)
code that puts the window in the proper place (per X specs and
user intent), it would work for mythfrontend to simply leave the
window there instead of moving it.  As a workaround, I'm using
'-geometry 640x360+1280+0'.  I put it in a wrapper shell script.
That seems to work well enough.

My second question, which I failed to find in my search of MythTV
documentation, is whether there is a keyboard command (or a way
to set one up) to toggle mythfrontend between full-screen and
non-full-screen.  Is there a way to do that?

Thanks,

Robert


More information about the mythtv-users mailing list