~unity-team/qtmir/surfaceItemFillMode2

« back to all changes in this revision

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

  • Committer: Nick Dedekind
  • Date: 2015-09-24 12:09:54 UTC
  • mfrom: (345.1.32 qtmir)
  • Revision ID: nick.dedekind@canonical.com-20150924120954-rw7q7qgvyjbg4vih
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
222
222
    }
223
223
}
224
224
 
225
 
SessionInterface* MirSurface::session() const
226
 
{
227
 
    return m_session.data();
228
 
}
229
 
 
230
225
Mir::Type MirSurface::type() const
231
226
{
232
227
    switch (m_surface->type()) {
280
275
            << "buffer dropped."
281
276
            << framesPending-1
282
277
            << "left.";
 
278
    } else {
 
279
        // The client can't possibly be blocked in swap buffers if the
 
280
        // queue is empty. So we can safely enter deep sleep now. If the
 
281
        // client provides any new frames, the timer will get restarted
 
282
        // via scheduleTextureUpdate()...
 
283
        m_frameDropperTimer.stop();
283
284
    }
284
285
}
285
286
 
358
359
 
359
360
void MirSurface::setFocus(bool focus)
360
361
{
 
362
    if (!m_session) {
 
363
        return;
 
364
    }
 
365
 
361
366
    // Temporary hotfix for http://pad.lv/1483752
362
 
    if (session() && session()->childSessions()->rowCount() > 0) {
 
367
    if (m_session->childSessions()->rowCount() > 0) {
363
368
        // has child trusted session, ignore any focus change attempts
 
369
        qCDebug(QTMIR_SURFACES).nospace() << "MirSurface[" << appId() << "]::setFocus(" << focus
 
370
            << ") - has child trusted session, ignore any focus change attempts";
364
371
        return;
365
372
    }
366
373
 
 
374
    qCDebug(QTMIR_SURFACES).nospace() << "MirSurface[" << appId() << "]::setFocus(" << focus << ")";
 
375
 
367
376
    if (focus) {
368
377
        m_shell->set_surface_attribute(m_session->session(), m_surface, mir_surface_attrib_focus, mir_surface_focused);
369
378
    } else {
642
651
{
643
652
    Q_EMIT sizeChanged(m_size);
644
653
}
 
654
 
 
655
QString MirSurface::appId() const
 
656
{
 
657
    QString appId;
 
658
 
 
659
    if (m_session && m_session->application()) {
 
660
        appId = m_session->application()->appId();
 
661
    } else {
 
662
        appId.append("-");
 
663
    }
 
664
    return appId;
 
665
}