idle-inhibit: move to new impl

This commit is contained in:
Vaxry 2024-04-21 16:29:30 +01:00
parent e823b5d693
commit d9fe1d0f58
14 changed files with 154 additions and 68 deletions

View file

@ -2,6 +2,7 @@
#include "../../defines.hpp"
#include <list>
#include <any>
#include "../../helpers/WLClasses.hpp"
#include "../../helpers/Timer.hpp"
#include "InputMethodRelay.hpp"
@ -9,6 +10,7 @@
class CConstraint;
class CWindow;
class CIdleInhibitor;
enum eClickBehaviorMode {
CLICKMODE_DEFAULT = 0,
@ -132,9 +134,6 @@ class CInputManager {
std::list<STabletTool> m_lTabletTools;
std::list<STabletPad> m_lTabletPads;
// idle inhibitors
std::list<SIdleInhibitor> m_lIdleInhibitors;
// Touch devices
std::list<STouchDevice> m_lTouchDevices;
@ -150,7 +149,7 @@ class CInputManager {
void newTabletTool(wlr_input_device*);
void newTabletPad(wlr_input_device*);
void focusTablet(STablet*, wlr_tablet_tool*, bool motion = false);
void newIdleInhibitor(wlr_idle_inhibitor_v1*);
void newIdleInhibitor(std::any);
void recheckIdleInhibitorStatus();
void onSwipeBegin(wlr_pointer_swipe_begin_event*);
@ -201,6 +200,7 @@ class CInputManager {
// Listeners
struct {
CHyprSignalListener setCursorShape;
CHyprSignalListener newIdleInhibitor;
} m_sListeners;
bool m_bCursorImageOverridden = false;
@ -237,6 +237,14 @@ class CInputManager {
// for releasing mouse buttons
std::list<uint32_t> m_lCurrentlyHeldButtons;
// idle inhibitors
struct SIdleInhibitor {
std::shared_ptr<CIdleInhibitor> inhibitor;
CWindow* pWindow = nullptr;
CHyprSignalListener windowDestroyListener;
};
std::vector<std::unique_ptr<SIdleInhibitor>> m_vIdleInhibitors;
// swipe
void beginWorkspaceSwipe();
void updateWorkspaceSwipe(double);