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

Nigel Pearson nigel at ind.tansu.com.au
Mon Feb 28 07:27:51 UTC 2005


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();


On 26/11/2004, at 11:47 PM, Jeremiah Morris wrote:
> 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.

	True. Much better to use Qt, and get it right for all platforms.


>   It looks like the following should work on all platforms:
>
> 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();

	There are a few places in mythcontext.cpp and tv_play.cpp
where the whole desktop's dimensions are used, so I made your
code into a new MythContext::GetScreenBounds(). The attached
patch uses that, throws away the X11-specific code, and slightly
changes the meaning of the "Xinerama screen" setting.

	To use all attached screens now requires a value of -1
in that setting.

	If a few users would test this in the next week or so,
(particularly multi-screen Xinerama-ers) I would appreciate it,
as I have only tested on Mac OS X. If no problems, into CVS it goes.

% cvs diff -u libs/libmyth/{util.h,util.cpp,mythcontext.cpp} 
libs/libmythtv/tv_play.cpp >../patch.general.8

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.general.8
Type: application/octet-stream
Size: 8378 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20050228/c1a73580/patch.general.obj
-------------- next part --------------


--
Nigel Pearson, nigel at ind.tansu.com.au | "Now the world has gone to bed,
Telstra BI&D, Sydney, Australia       |  Darkness won't engulf my head,
Office: 8255 4222    Fax:  8255 3153  |  I can see by infrared,
Mobile: 0408 664435  Home: 9792 6998  |  How I hate the night." -Marvin



More information about the mythtv-dev mailing list