Thanks you all for the clarification, but why not follow xrandr?

Let's consider one use case: 
Video playback shows on on-device screen, then HDMI is connected, we expect 
video playback show on HDMI output, and control panel show on device screen.

For xrandr solution, it just move the playback window and resize it to fit HDMI 
output. Application cares little about the output change but handle a normal 
'resize' event.
For Qt/screen solution, it requires create a new widget for video playback, and 
requires change video sink of media pipeline. And application is also required 
to fully aware the scenario. I don't think it's the nice way.


-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Thiago Macieira
Sent: Thursday, September 23, 2010 10:35 PM
To: [email protected]
Cc: meego-touch-dev
Subject: Re: [MeeGo-dev] how to support multiple displays in MeeGo? (HDMI and 
primary display have different content)

Em Quinta-feira 23 Setembro 2010, às 13:24:19, Tomas Junnonen escreveu:
> On 09/22/2010 06:31 AM, ext Zhao, Halley wrote:
> > Thanks Tomas.
> > Is there any examples to have multi-windows for MeeGo touch application?
> > I think video playback on HDMI is done by moving windows inside virtual
> > screen; just move it to a region of virtual screen which map to HDMI
> > output, right? Does mcompositor aware virtual screen now?
> 
> A multi-window app is simply created by instantiating several windows
> (MApplicationWindow w1; w1.show(); MApplicationWindow w2; w2.show()).
> 
> The app is however not able to determine the placement of the windows
> relative to each other, that is up to the window manager. A device with
> multiple outputs is also not likely map these into a single virtual
> screen, the management of the windows would be complicated. Instead I
> would expect the two outputs to be represented as different screens in
> X. An app can be started on a specific screen with something like
> "DISPLAY=:2 MyApp". Unfortunately, while for instance Gtk+ allows to
> specify the X screen when creating a window in an app, Qt apparently
> does not.

DISPLAY=:2 isn't a separate screen, it's a separate display. A separate screen 
would be DISPLAY=:0.1 and that really depends on how the window manager does 
it (Xinerama or not).

To specify which screen you want a widget to show in Qt, you simply pass the 
screen as the parent:

        QWidget *screen1 = QApplication::desktop()->screen(1);
        QMainWindow myWIndow(screen1);
        myWindow.show();

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

Qt Developer Days 2010  -  Munich Oct 11-13  -  San Francisco Nov 1-3
For more information and to register: http://qt.nokia.com/qtdevdays2010
_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev

Reply via email to