2
* Copyright (C) 2016 Canonical, Ltd.
4
* This program is free software: you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License version 3, as published by
6
* the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
10
* SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
* Lesser General Public License for more details.
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
#include "application.h"
25
class MirSurfaceInterface;
28
Enables other processes to check what is the currently focused application or surface,
29
normally for security purposes.
31
class DBusFocusInfo : public QObject
34
Q_CLASSINFO("D-Bus Interface", "com.canonical.Unity.FocusInfo")
36
explicit DBusFocusInfo(const QList<Application*> &applications);
37
virtual ~DBusFocusInfo() {}
42
Returns true if the application with the given PID has input focus
44
FIXME: Identifying an app through its PID is deemed racy.
45
isSurfaceFocused() is the preferred method.
47
Q_SCRIPTABLE bool isPidFocused(unsigned int pid);
50
Returns true if the surface with the given id has input focus
52
Q_SCRIPTABLE bool isSurfaceFocused(const QString &surfaceId);
55
QSet<pid_t> fetchAssociatedPids(pid_t pid);
56
SessionInterface* findSessionWithPid(const QSet<pid_t> &pidSet);
57
MirSurfaceInterface *findQmlSurface(const QString &serializedId);
59
const QList<Application*> &m_applications;
61
CGManager *m_cgManager;