summaryrefslogtreecommitdiffstats
path: root/src/core/desktop_screen_qt.h
blob: 385ffcfc1539c9278e89767fa86b8fdd89f4fced (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#ifndef DESKTOP_SCREEN_QT_H
#define DESKTOP_SCREEN_QT_H

#include "ui/display/screen_base.h"

#include <qmetaobject.h>

namespace QtWebEngineCore {

class DesktopScreenQt : public display::ScreenBase
{
public:
    DesktopScreenQt();
    ~DesktopScreenQt() override;

    display::Display GetDisplayNearestWindow(gfx::NativeWindow /*window*/) const override;
    bool SetScreenSaverSuspended(bool suspend) override;
    bool IsScreenSaverActive() const override;

private:
    void initializeScreens();
    bool updateAllScreens();
    QMetaObject::Connection m_connections[3];
};

} // namespace QtWebEngineCore

#endif // DESKTOP_SCREEN_QT_H