Merge lp:~gerboland/qtmir/multimonitor-spike into lp:qtmir
| Status: | Superseded |
|---|---|
| Proposed branch: | lp:~gerboland/qtmir/multimonitor-spike |
| Merge into: | lp:qtmir |
| Diff against target: |
3591 lines (+2090/-463) 51 files modified
debian/changelog (+6/-0) demos/qml-demo-shell/qml-demo-shell.qml (+71/-1) src/modules/Unity/CMakeLists.txt (+1/-0) src/modules/Unity/Screens/CMakeLists.txt (+18/-0) src/modules/Unity/Screens/plugin.cpp (+41/-0) src/modules/Unity/Screens/qmldir (+2/-0) src/modules/Unity/Screens/screens.cpp (+71/-0) src/modules/Unity/Screens/screens.h (+54/-0) src/platforms/mirserver/CMakeLists.txt (+4/-2) src/platforms/mirserver/display.cpp (+0/-46) src/platforms/mirserver/display.h (+0/-39) src/platforms/mirserver/logging.h (+1/-0) src/platforms/mirserver/miropenglcontext.cpp (+24/-9) src/platforms/mirserver/mirserver.cpp (+32/-4) src/platforms/mirserver/mirserver.h (+7/-3) src/platforms/mirserver/mirserverintegration.cpp (+45/-40) src/platforms/mirserver/mirserverintegration.h (+4/-7) src/platforms/mirserver/offscreensurface.cpp (+61/-0) src/platforms/mirserver/offscreensurface.h (+43/-0) src/platforms/mirserver/qmirserver.cpp (+12/-2) src/platforms/mirserver/qmirserver.h (+3/-0) src/platforms/mirserver/qmirserver_p.h (+2/-0) src/platforms/mirserver/qtcompositor.cpp (+10/-35) src/platforms/mirserver/qtcompositor.h (+14/-6) src/platforms/mirserver/qteventfeeder.cpp (+96/-87) src/platforms/mirserver/qteventfeeder.h (+13/-9) src/platforms/mirserver/screen.cpp (+97/-8) src/platforms/mirserver/screen.h (+32/-4) src/platforms/mirserver/screencontroller.cpp (+261/-0) src/platforms/mirserver/screencontroller.h (+96/-0) src/platforms/mirserver/screenwindow.cpp (+32/-83) src/platforms/mirserver/screenwindow.h (+11/-27) src/platforms/mirserver/tileddisplayconfigurationpolicy.cpp (+44/-0) src/platforms/mirserver/tileddisplayconfigurationpolicy.h (+35/-0) tests/common/fake_displayconfigurationoutput.h (+73/-0) tests/common/gmock_fixes.h (+124/-0) tests/common/mock_display.h (+53/-0) tests/common/mock_display_buffer.h (+43/-0) tests/common/mock_display_configuration.h (+35/-0) tests/common/mock_main_loop.h (+53/-0) tests/mirserver/CMakeLists.txt (+1/-0) tests/mirserver/QtEventFeeder/mock_qtwindowsystem.h (+17/-10) tests/mirserver/QtEventFeeder/qteventfeeder_test.cpp (+27/-16) tests/mirserver/Screen/CMakeLists.txt (+1/-0) tests/mirserver/Screen/screen_test.cpp (+38/-24) tests/mirserver/ScreenController/CMakeLists.txt (+28/-0) tests/mirserver/ScreenController/screencontroller_test.cpp (+193/-0) tests/mirserver/ScreenController/stub_display.h (+91/-0) tests/mirserver/ScreenController/stub_screen.h (+31/-0) tests/mirserver/ScreenController/testable_screencontroller.h (+38/-0) tests/modules/common/qtmir_test.h (+1/-1) |
| To merge this branch: | bzr merge lp:~gerboland/qtmir/multimonitor-spike |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| PS Jenkins bot | continuous-integration | Approve on 2015-08-07 | |
| Daniel d'Andrada (community) | 2015-07-01 | Needs Fixing on 2015-08-06 | |
|
Review via email:
|
|||
This proposal has been superseded by a proposal from 2015-09-02.
Commit Message
Initial multimonitor support - react correctly to Mir DisplayConfigur
On Mir DisplayConfigur
1. blocks Mir until it has stopped all renderers and has their GL contexts released
2. reads the new DisplayConfigur
3. restarts all renderers
This also solves shutdown crash issues due to raciness of mir destroying the GL context backing the shell's QWindow before its renderer had stopped
| Gerry Boland (gerboland) wrote : | # |
| Gerry Boland (gerboland) wrote : | # |
Gah, input on second display not working
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:338
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
| Daniel d'Andrada (dandrader) wrote : | # |
src/modules/
"""
public Q_SLOTS:
void onScreenAdded(
void onScreenRemoved
"""
Shouldn't they be private?
-------
src/platforms/
"""
EGLDisplay m_eglDisplay;
EGLContext m_eglContext;
"""
You store them as member variables but they are still only used in the constructor.
-------
In MirServerIntegr
"""
qDebug() << "createPlatform
"""
A leftover.
"""
// If Screen was not specified, just grab an unused one, if available
"""
I don't get the first "if". This method doesn't seem to handle the case where a screen *is* specified. It doesn't even seem possible.
"""
if (!screens) {
qDebug() << "Screens are not initialized, unable to create a new QWindow/
return nullptr;
}
[...]
if (!screen) {
qDebug() << "No available Screens to create a new QWindow/
return nullptr;
}
"""
I think these should be turned into criticals (and also use the logging category API).
"""
qDebug() << "New" << window << "with geom" << window->geometry()
<< "is backed by a" << screen << "with geometry" << screen->geometry();
"""
You might want to keep this, but using the logging category API.
-------
In MirServerIntegr
"""
qDebug() << "ScreenController not initialized";
"""
More qDebug. Maybe this should be a qFatal?
-------
In src/platforms/
"""
#include <QDebug>
"""
You don't need that.
-------
In src/platforms/
"""
QWeakPointe
"""
Why return a weak pointer if all users of it do "screenControll
-------
QtEventFeeder:
I think it would be cleaner to have two constructors instead:
QtEventFeeder:
: QtEventFeeder(new QtWindowSystem(
{
}
QtEventFeeder:
{
- if (windowSystem) {
- mQtWindowSystem = windowSystem;
- } else {
- mQtWindowSystem = new QtWindowSystem;
- }
}
And remove the "= nullptr" from the signature of the second one.
-------
"""
void QtEventFeeder:
{
- auto type = mir_event_
- if (type != mir_event_
- return;
"""
Why remove it?
-------
"""
void QtEventFeeder:
{
[...]
+ mQtWindowSystem
}
"""
You have to pass the window chosen in QtEventFeeder:
-------
Please update...
| Daniel d'Andrada (dandrader) wrote : | # |
As for testing: When I connected my monitor to the micro hdmi port of my yoga 2 laptop, qtmir detected the new display and reacted accordingly. So I saw the unity logo on a green background in the external monitor.
But when I disconnected it, nothing happened on qtmir side. Connected back again and that was when I got the screen disconnected info in qtmir, it seems. Restarted the qml mirserver and now it wouldn't detect the external monitor at all.
Rebooted the laptop.
Run the mirserver again. Connected the external monitor. All fine. Disconnected and reconnected and boom. Laptop shuts itself down.
Despite the somewhat bad results, since this is just the first step in the multi-monitor story I'm still ok with having it merged.
| Gerry Boland (gerboland) wrote : | # |
I'll be addressing your code comments soon.
On your testing, please watch the console output carefully. ScreenControlle
Also, can you have the shell animating on both screens before you unplug?
Can you compare with mir_proving_server too?
I'm just trying to figure out if it is a QtMir bug, or a Mir one.
Thanks for the review!
- 339. By Gerry Boland on 2015-07-27
-
Slots can be private, not public
- 340. By Gerry Boland on 2015-07-27
-
Merge trunk
- 341. By Gerry Boland on 2015-07-27
-
MirOpenGLContext does not need to keep copy of the egl display and context
- 342. By Gerry Boland on 2015-07-27
-
Clean up debug outputs in MirServerIntegr
ation, use categories - 343. By Gerry Boland on 2015-07-27
-
Remove commented out lines and useless debug outputs from ScreenController
- 344. By Gerry Boland on 2015-07-27
-
Update comment in MirServerIntegr
ation to make actual sense - 345. By Gerry Boland on 2015-07-27
-
Remove unneeded QDebug include from OffscreenSurface
- 346. By Gerry Boland on 2015-07-27
-
Update licence years
- 347. By Gerry Boland on 2015-07-27
-
Remove authors from \*screen.\* licences
- 348. By Gerry Boland on 2015-07-27
-
Remove useless debug prints from ScreenWindow, and use category logging elsewhere
- 349. By Gerry Boland on 2015-07-27
-
s/deconstructor
/destructor/ - 350. By Gerry Boland on 2015-07-27
-
ScreenController - remove another useless debug statement
- 351. By Gerry Boland on 2015-07-27
-
TiledDisplayConfig - update licence year
- 352. By Gerry Boland on 2015-07-27
-
Fix FTBFS
- 353. By Gerry Boland on 2015-07-27
-
ScreenController not need mirserver header
- 354. By Gerry Boland on 2015-07-27
-
Fix mouse click on non-primary screen
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:354
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 355. By Gerry Boland on 2015-08-05
-
Add second QtEventFeeder constructor which creates non-test QtWindowSystemI
nterface by default - 356. By Gerry Boland on 2015-08-05
-
Drop ScreenWindow:
:isExposed - 357. By Gerry Boland on 2015-08-05
-
Ensure touch validation events are passed to the correct window
- 358. By Gerry Boland on 2015-08-05
-
Move ScreenController explanation comment to the header
- 359. By Gerry Boland on 2015-08-05
-
screencontroller does not depend on mirserver any more, so remove header file include
- 360. By Gerry Boland on 2015-08-06
-
Simplify ScreenWindow further, drop QObject dependence and remove event handler
- 361. By Gerry Boland on 2015-08-06
-
Better variable name in ScreenWindow
- 362. By Gerry Boland on 2015-08-06
-
Use camelCase instead of under_score
- 363. By Gerry Boland on 2015-08-06
-
sc -> screenController
- 364. By Gerry Boland on 2015-08-06
-
screenFactory -> createScreen
- 365. By Gerry Boland on 2015-08-06
-
ScreenController: do not be friends, make public interfaces to be called by MirServer
| Gerry Boland (gerboland) wrote : | # |
I think I've followed all the recommendations you've made. I've only a couple of replies:
> """
> // If Screen was not specified, just grab an unused one, if available
> """
>
> I don't get the first "if". This method doesn't seem to handle the case where
> a screen *is* specified. It doesn't even seem possible.
You're right, it was terribly phrased. Have updated it to make sense now
> qDebug() << "Screens are not initialized, unable to create a new
> QWindow/
<snip>
> qDebug() << "No available Screens to create a new QWindow/
>
> I think these should be turned into criticals (and also use the logging
> category API).
I did make them critical, but I always want those errors to print so didn't make them part of a category.
> In src/platforms/
>
> """
> QWeakPointer<
> """
>
> Why return a weak pointer if all users of it do "screenControll
> So why not make it return a shared pointer already (making for cleaner code)?
Because the QMirServer has ownership of the ScreenController, and manages its lifetime. A ScreenController will only exist after the mir server is started, and must be deleted before mir shuts down. I can't have API users keeping it around longer than it should.
This may be exposing an API problem which can be resolved, but I didn't see any obvious solution. So this will have to do.
> src/platforms/
> """
> auto displayConfig = display-
> """
>
> I think you're abusing the use of "auto" here. I would prefer to know the
> class of this object.
You really want to know is it std::unique_
- 366. By Gerry Boland on 2015-08-06
-
Merge trunk
- 367. By Gerry Boland on 2015-08-06
-
Ensure deregister ScreenWindow from Screen on destruction
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:366
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
| Daniel d'Andrada (dandrader) wrote : | # |
On 06/08/15 08:49, Gerry Boland wrote:
>> qDebug() << "Screens are not initialized, unable to create a new
>> > QWindow/
> <snip>
>> > qDebug() << "No available Screens to create a new QWindow/
>> >
>> > I think these should be turned into criticals (and also use the logging
>> > category API).
> I did make them critical, but I always want those errors to print so didn't make them part of a category.
>
This doesn't stop you from using logging categories. You can configure
logging categories to print by severity. Eg: only from warnings and
upwards, or only criticals.
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:367
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
| Gerry Boland (gerboland) wrote : | # |
> On 06/08/15 08:49, Gerry Boland wrote:
> > I did make them critical, but I always want those errors to print so didn't
> make them part of a category.
> >
>
> This doesn't stop you from using logging categories. You can configure
> logging categories to print by severity. Eg: only from warnings and
> upwards, or only criticals.
I know that. But IMO this error should always print if that codepath hit, as it's an error path which I see no reason to be filter-able.
| Daniel d'Andrada (dandrader) wrote : | # |
"""
qtmir (0.4.6) vivid; urgency=medium
"""
nitpick: Shouldn't it be UNRELEASED instead of vivid?
| Daniel d'Andrada (dandrader) wrote : | # |
Good clean up! Only a couple of minor issues left:
-------
Please update copyright year of src/platforms/
-------
src/platforms/
It still has some qDebug() messages and commented-out code.
"""
if (window && window->window()) { qDebug() << "HIDE" << window;
"""
"""
"""
NB: the stuff above appears in two separate locations in the file
-------
In tests/mirserver
"""
ASSERT_
"""
Google test format for assertions is as follows: ASSERT_EQ(expected, actual)
But in this file you're doing the other way around, which will make for confusing messages in case of failure.
Same goes for EXPECT_EQ() and friends.
| Daniel d'Andrada (dandrader) wrote : | # |
Ah, and the qml-demo-shell changes, naturally. You probably gonna rebase this branch on top of lp:~dandrader/qtmir/mousePointer or lp:~dandrader/qtmir/mirSurface, right?
- 368. By Gerry Boland on 2015-08-07
-
Update changelog to mark latest as UNRELEASED
- 369. By Gerry Boland on 2015-08-07
-
Update copyright year on MirOpenGLContext
- 370. By Gerry Boland on 2015-08-07
-
debug & commented line removed from ScreenController
- 371. By Gerry Boland on 2015-08-07
-
ScreenControlle
rTest- flip argument in assert/expect_eq statements
| PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:371
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
- 371. By Gerry Boland on 2015-08-07
-
ScreenControlle
rTest- flip argument in assert/expect_eq statements - 370. By Gerry Boland on 2015-08-07
-
debug & commented line removed from ScreenController
- 369. By Gerry Boland on 2015-08-07
-
Update copyright year on MirOpenGLContext
- 368. By Gerry Boland on 2015-08-07
-
Update changelog to mark latest as UNRELEASED
- 367. By Gerry Boland on 2015-08-06
-
Ensure deregister ScreenWindow from Screen on destruction
- 366. By Gerry Boland on 2015-08-06
-
Merge trunk
- 365. By Gerry Boland on 2015-08-06
-
ScreenController: do not be friends, make public interfaces to be called by MirServer
- 364. By Gerry Boland on 2015-08-06
-
screenFactory -> createScreen
- 363. By Gerry Boland on 2015-08-06
-
sc -> screenController
- 362. By Gerry Boland on 2015-08-06
-
Use camelCase instead of under_score

The QML demo is pretty lame, but I'm holding on until your demo work in the mirSurface is approved.
Also there are FIXMEs related to input, which I would prefer to address later. This MR is big enough.