[mythtv-users] [mythtv] Minimizing and restoring an external application by pressing a mythtv menu button?

Joseph Caputo jcaputo1 at gmail.com
Fri Jun 1 14:28:49 UTC 2007


On 6/1/07, Michael T. Dean <mtdean at thirdcontact.com> wrote:
> On 06/01/2007 03:54 AM, florin baiduc wrote:
> >
> > I plan to launch an external application from a MythTV menu (in the
> > background by using exec &). This starts then minimized Has anyone
> > have any clue on how can one restore this already running application
> > by pressing the same MythTV button? I presume there should be some
> > call to the windowmanager, but my search returned no good results
> > (still looking around). This would be really useful for example for
> > skype and other "always on" applications..
>
>
> Please ask on the -users list.  When you do, you should specify which WM
> you're using, too, as it's purely a WM issue (not a Myth thing).
>
> Mike


[Transferred thread from -dev list]

It depends on what the application is... some applications have either
command-line based remote control, or a simple network control
protocol.  Probably the most universal solution would be to find the
window ID of the window you want to restore and send it an X protocol
message to re-map/un-iconify itself.  That *should* be window-manager
independent, since it works at the Xlib level, though I suppose a
window manager could choose to be obnoxious about it (obviously this
solution wouldn't work if you're using Qt/Embedded & no X11).  We use
this mechanism in the software that we develop at work, and it is also
basically how the Mozilla/Netscape/Firefox remote control works.  The
trickiest part might be finding the window ID; Mozilla works by
setting a custom X window property that the remote control app can
look for (making it slow over a slow X connection, since it has to
query the X server for all of its windows, but ).  You might have to
look for something else, like a window title, widget or class name.  I
think there may be some example code on the Mozilla site; if not, just
Google "X protocol iconify".

-JAC


More information about the mythtv-users mailing list