[mythtv] [PATCH] Multiple screen sanity (not just on Mac OS X)

Jeremiah Morris jm at whpress.com
Fri Nov 26 12:47:29 UTC 2004

On 25 Nov 2004, at 10:47 PM, Nigel Pearson wrote:

> 	On a Mac with multiple screens, the GUI spans the screen
> because the context uses the whole desktop. i.e.
>         m_height = QApplication::desktop()->height();
>         m_width = QApplication::desktop()->width();

This patch adds OS X-specific code, to go along with the X11-specific 
code.  However, QDesktopWidget is already designed to support Xinerama 
and multiple screens.  It looks like the following should work on all 

int screen = gContext->GetNumSetting("XineramaScreen", 0);
if (screen >= QApplication::desktop()->numScreens())
     screen = 0;
QRect bounds = QApplication::desktop()->availableGeometry(screen);
x = bounds.x();
y = bounds.y();
width = bounds.width();
height = bounds.height();

Is there a reason this code, or something similar, will not work?  It 
seems like this can be done without any platform #ifdefs at all.  Can 
any Xinerama users comment?

- Jer

More information about the mythtv-dev mailing list