mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-14 19:45:45 -07:00
Window: add destroy signal
This commit is contained in:
@@ -26,6 +26,8 @@ CWindow::~CWindow() {
|
|||||||
g_pCompositor->m_pLastWindow = nullptr;
|
g_pCompositor->m_pLastWindow = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
events.destroy.emit();
|
||||||
|
|
||||||
if (!g_pHyprOpenGL)
|
if (!g_pHyprOpenGL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
#include "../macros.hpp"
|
#include "../macros.hpp"
|
||||||
#include "../managers/XWaylandManager.hpp"
|
#include "../managers/XWaylandManager.hpp"
|
||||||
#include "DesktopTypes.hpp"
|
#include "DesktopTypes.hpp"
|
||||||
|
#include "../helpers/signal/Signal.hpp"
|
||||||
|
|
||||||
enum eIdleInhibitMode {
|
enum eIdleInhibitMode {
|
||||||
IDLEINHIBIT_NONE = 0,
|
IDLEINHIBIT_NONE = 0,
|
||||||
@@ -216,6 +217,10 @@ class CWindow {
|
|||||||
|
|
||||||
CWLSurface m_pWLSurface;
|
CWLSurface m_pWLSurface;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
CSignal destroy;
|
||||||
|
} events;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
wlr_xdg_surface* xdg;
|
wlr_xdg_surface* xdg;
|
||||||
wlr_xwayland_surface* xwayland;
|
wlr_xwayland_surface* xwayland;
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
class CSignal {
|
class CSignal {
|
||||||
public:
|
public:
|
||||||
void emit(std::any data);
|
void emit(std::any data = {});
|
||||||
|
|
||||||
//
|
//
|
||||||
[[nodiscard("Listener is unregistered when the ptr is lost")]] CHyprSignalListener registerListener(std::function<void(std::any)> handler);
|
[[nodiscard("Listener is unregistered when the ptr is lost")]] CHyprSignalListener registerListener(std::function<void(std::any)> handler);
|
||||||
|
Reference in New Issue
Block a user