forked from quickshell/quickshell
hyprland/focus_grab: add HyprlandFocusGrab
This commit is contained in:
parent
e7cfb5cf37
commit
87a884ca36
15 changed files with 607 additions and 0 deletions
27
src/wayland/hyprland/focus_grab/manager.cpp
Normal file
27
src/wayland/hyprland/focus_grab/manager.cpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include "manager.hpp"
|
||||
|
||||
#include <qwaylandclientextension.h>
|
||||
|
||||
#include "grab.hpp"
|
||||
|
||||
namespace qs::hyprland::focus_grab {
|
||||
|
||||
FocusGrabManager::FocusGrabManager(): QWaylandClientExtensionTemplate<FocusGrabManager>(1) {
|
||||
this->initialize();
|
||||
}
|
||||
|
||||
bool FocusGrabManager::available() const { return this->isActive(); }
|
||||
|
||||
FocusGrab* FocusGrabManager::createGrab() { return new FocusGrab(this->create_grab()); }
|
||||
|
||||
FocusGrabManager* FocusGrabManager::instance() {
|
||||
static FocusGrabManager* instance = nullptr; // NOLINT
|
||||
|
||||
if (instance == nullptr) {
|
||||
instance = new FocusGrabManager();
|
||||
}
|
||||
|
||||
return instance;
|
||||
}
|
||||
|
||||
} // namespace qs::hyprland::focus_grab
|
Loading…
Add table
Add a link
Reference in a new issue