~mterry/qtmir/report-osk-max-height

« back to all changes in this revision

Viewing changes to src/platforms/mirserver/screensmodel.h

  • Committer: CI Train Bot
  • Author(s): Gerry Boland, Michał Sawicz, Nick Dedekind
  • Date: 2016-04-29 20:04:51 UTC
  • mfrom: (434.5.64 set-display-config)
  • Revision ID: ci-train-bot@canonical.com-20160429200451-v0bjc4pcypynt83b
Enhance ScreenController & the DisplayConfigurationPolicy to implement dynamic grid units.

- Rename ScreenController to ScreenModel, as it just reflects current screen state, does not offer means to configure it
- ScreenController can update state of existing Screens, based on Mir DisplayConfiguration changes.
- Expand Screen to include scale & form factor properties, with getter/notifier in NativeInterface. This enables the dynamic grid units in the shell
- Add a Unity.Screens qml module to give QML better information about connected screens, and allow basic reconfiguring.
- Implement a basic display configuration policy to set suitable scale and form factor on an external display (needed for dynamic grid units) Fixes: #1573532
Approved by: Unity8 CI Bot, Daniel d'Andrada

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2015 Canonical, Ltd.
 
2
 * Copyright (C) 2015-2016 Canonical, Ltd.
3
3
 *
4
4
 * This program is free software: you can redistribute it and/or modify it under
5
5
 * the terms of the GNU Lesser General Public License version 3, as published by
34
34
class QWindow;
35
35
 
36
36
/*
37
 
 * ScreenController monitors the Mir display configuration and compositor status, and updates
 
37
 * ScreensModel monitors the Mir display configuration and compositor status, and updates
38
38
 * the relevant QScreen and QWindow states accordingly.
39
39
 *
40
40
 * Primary purposes are:
53
53
 * All other methods must be called on the Qt GUI thread.
54
54
 */
55
55
 
56
 
class ScreenController : public QObject
 
56
class ScreensModel : public QObject
57
57
{
58
58
    Q_OBJECT
59
59
public:
60
 
    explicit ScreenController(QObject *parent = 0);
 
60
    explicit ScreensModel(QObject *parent = 0);
61
61
 
62
62
    QList<Screen*> screens() const { return m_screenList; }
63
63
    bool compositing() const { return m_compositing; }
66
66
 
67
67
Q_SIGNALS:
68
68
    void screenAdded(Screen *screen);
 
69
    void screenRemoved(Screen *screen);
69
70
 
70
71
public Q_SLOTS:
71
72
    void update();
85
86
 
86
87
private:
87
88
    Screen* findScreenWithId(const QList<Screen*> &list, const mir::graphics::DisplayConfigurationOutputId id);
 
89
    bool canUpdateExistingScreen(const Screen *screen, const mir::graphics::DisplayConfigurationOutput &output);
 
90
    void allWindowsSetExposed(bool exposed);
88
91
 
89
92
    std::weak_ptr<mir::graphics::Display> m_display;
90
93
    std::shared_ptr<mir::compositor::Compositor> m_compositor;