~unity-team/qtmir/shell_chrome

« back to all changes in this revision

Viewing changes to src/modules/Unity/Application/mirsurface.cpp

  • Committer: Nick Dedekind
  • Date: 2016-03-10 11:55:28 UTC
  • Revision ID: nick.dedekind@canonical.com-20160310115528-wdionh3b6ivx9r5k
Changed sizeHint to creationHint. Moved chrome property to observer changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
        SessionInterface* session,
173
173
        mir::shell::Shell* shell,
174
174
        std::shared_ptr<SurfaceObserver> observer,
175
 
        const SizeHints &sizeHints)
 
175
        const CreationHints &creationHints)
176
176
    : MirSurfaceInterface()
177
177
    , m_surface(surface)
178
178
    , m_session(session)
184
184
    , m_live(true)
185
185
    , m_shellChrome(Mir::NormalChrome)
186
186
{
187
 
    m_minimumWidth = sizeHints.minWidth;
188
 
    m_minimumHeight = sizeHints.minHeight;
189
 
    m_maximumWidth = sizeHints.maxWidth;
190
 
    m_maximumHeight = sizeHints.maxHeight;
191
 
    m_widthIncrement = sizeHints.widthIncrement;
192
 
    m_heightIncrement = sizeHints.heightIncrement;
 
187
    m_minimumWidth = creationHints.minWidth;
 
188
    m_minimumHeight = creationHints.minHeight;
 
189
    m_maximumWidth = creationHints.maxWidth;
 
190
    m_maximumHeight = creationHints.maxHeight;
 
191
    m_widthIncrement = creationHints.widthIncrement;
 
192
    m_heightIncrement = creationHints.heightIncrement;
 
193
    m_shellChrome = creationHints.shellChrome;
193
194
 
194
195
    m_surfaceObserver = observer;
195
196
    if (observer) {
203
204
        connect(observer.get(), &SurfaceObserver::maximumHeightChanged, this, &MirSurface::setMaximumHeight);
204
205
        connect(observer.get(), &SurfaceObserver::widthIncrementChanged, this, &MirSurface::setWidthIncrement);
205
206
        connect(observer.get(), &SurfaceObserver::heightIncrementChanged, this, &MirSurface::setHeightIncrement);
 
207
        connect(observer.get(), &SurfaceObserver::shellChromeChanged, this, [&](MirShellChrome shell_chrome) {
 
208
            setShellChrome(static_cast<Mir::ShellChrome>(shell_chrome));
 
209
        });
206
210
        observer->setListener(this);
207
211
    }
208
212