forked from quickshell/quickshell
wayland/toplevel: refactor toplevel output tracking to its own file
This commit is contained in:
parent
20c3da01f1
commit
27f97c3283
6 changed files with 119 additions and 82 deletions
34
src/wayland/output_tracking.hpp
Normal file
34
src/wayland/output_tracking.hpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#pragma once
|
||||
|
||||
#include <qlist.h>
|
||||
#include <qobject.h>
|
||||
#include <qscreen.h>
|
||||
#include <qtmetamacros.h>
|
||||
|
||||
struct wl_output;
|
||||
|
||||
namespace qs::wayland {
|
||||
|
||||
class WlOutputTracker: public QObject {
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
[[nodiscard]] const QList<QScreen*>& screens() const { return this->mScreens; }
|
||||
|
||||
signals:
|
||||
void screenAdded(QScreen* screen);
|
||||
void screenRemoved(QScreen* screen);
|
||||
|
||||
public slots:
|
||||
void addOutput(::wl_output* output);
|
||||
void removeOutput(::wl_output* output);
|
||||
|
||||
private slots:
|
||||
void onQScreenAdded(QScreen* screen);
|
||||
|
||||
private:
|
||||
QList<QScreen*> mScreens;
|
||||
QList<::wl_output*> mOutputs;
|
||||
};
|
||||
|
||||
} // namespace qs::wayland
|
||||
Loading…
Add table
Add a link
Reference in a new issue