~gerboland/qtmir/desktophintenvvar

« back to all changes in this revision

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

  • Committer: Bileto Bot
  • Author(s): Daniel d'Andrada
  • Date: 2017-03-07 23:41:01 UTC
  • mfrom: (606.1.1 sessionFixes)
  • Revision ID: ci-train-bot@canonical.com-20170307234101-b5mjas8lm0g6hups
Some qtmir::Session fixes

- Emit Session::focusedChanged when adding an already focused window
- When session dies, besides killing all its surfaces, also kill its closing surfaces

Approved by: Gerry Boland, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2014-2016 Canonical, Ltd.
 
2
 * Copyright (C) 2014-2017 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
215
215
{
216
216
    DEBUG_MSG << "(surface=" << newSurface << ")";
217
217
 
 
218
    const bool focusedBefore = focused();
 
219
 
218
220
    connect(newSurface, &MirSurfaceInterface::stateChanged,
219
221
        this, &Session::updateFullscreenProperty);
220
222
 
244
246
        setState(Running);
245
247
    }
246
248
 
 
249
    const bool focusedNow = focused();
 
250
    if (focusedNow != focusedBefore) {
 
251
        Q_EMIT focusedChanged(focused());
 
252
    }
 
253
 
247
254
    updateFullscreenProperty();
248
255
}
249
256
 
389
396
                surface->setLive(false);
390
397
            }
391
398
 
 
399
            for (int i = 0; i < m_closingSurfaces.count(); ++i) {
 
400
                auto surface = static_cast<MirSurfaceInterface*>(m_closingSurfaces[i]);
 
401
                surface->setLive(false);
 
402
            }
 
403
 
392
404
            deleteIfZombieAndEmpty();
393
405
        }
394
406
    }