mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-02 19:25:58 +01:00
Window: add destroy signal
This commit is contained in:
parent
e69bc5b870
commit
e823b5d693
3 changed files with 8 additions and 1 deletions
|
@ -26,6 +26,8 @@ CWindow::~CWindow() {
|
|||
g_pCompositor->m_pLastWindow = nullptr;
|
||||
}
|
||||
|
||||
events.destroy.emit();
|
||||
|
||||
if (!g_pHyprOpenGL)
|
||||
return;
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "../macros.hpp"
|
||||
#include "../managers/XWaylandManager.hpp"
|
||||
#include "DesktopTypes.hpp"
|
||||
#include "../helpers/signal/Signal.hpp"
|
||||
|
||||
enum eIdleInhibitMode {
|
||||
IDLEINHIBIT_NONE = 0,
|
||||
|
@ -216,6 +217,10 @@ class CWindow {
|
|||
|
||||
CWLSurface m_pWLSurface;
|
||||
|
||||
struct {
|
||||
CSignal destroy;
|
||||
} events;
|
||||
|
||||
union {
|
||||
wlr_xdg_surface* xdg;
|
||||
wlr_xwayland_surface* xwayland;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
class CSignal {
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue