Debian Codegraph @

src/platform/mac/foregroundbackgroundfilter.h

raw
1 // SPDX-License-Identifier: GPL-3.0-or-later
2
3 #pragma once
4
5
6 #include <QObject>
7
8 /**
9 * This event filter manages the "activationPolicy" for an OS X app by
10 * ensuring that it is a "regular" app when there are windows shown, but
11 * an "accessory" or "prohibited"/"background" app when there are none.
12 *
13 * This allows the app to not have a dock icon unless there is an open window.
14 *
15 * If only menu or some notifications are visible dock icon is hidden.
16 */
17 class ForegroundBackgroundFilter final : public QObject
18 {
19 public:
20 /**
21 * Install the filter to parent.
22 */
23 static void installFilter(QObject *parent);
24
25 protected:
26 bool eventFilter(QObject *obj, QEvent *ev);
27 ForegroundBackgroundFilter(QObject *parent);
28 };