summaryrefslogtreecommitdiff
path: root/src/desktop
diff options
context:
space:
mode:
authorIkalco <73481042+ikalco@users.noreply.github.com>2026-02-22 06:30:11 -0600
committerGitHub <noreply@github.com>2026-02-22 12:30:11 +0000
commitb4ee4674f9a74e3d602c7fb17bc09f79d221583c (patch)
tree294bbb207c44e778dd78afda65cbd79181f04124 /src/desktop
parent93dbf884261efcb387e920b1cd0e4ed5b288bc3a (diff)
protocols: implement image-capture-source-v1 and image-copy-capture-v1 (#11709)
Implements the new screencopy protocols
Diffstat (limited to 'src/desktop')
-rw-r--r--src/desktop/view/Window.cpp16
-rw-r--r--src/desktop/view/Window.hpp6
2 files changed, 21 insertions, 1 deletions
diff --git a/src/desktop/view/Window.cpp b/src/desktop/view/Window.cpp
index d94ee79a..b43e181c 100644
--- a/src/desktop/view/Window.cpp
+++ b/src/desktop/view/Window.cpp
@@ -653,6 +653,18 @@ void CWindow::onMap() {
},
false);
+ m_realSize->setUpdateCallback([this](auto) {
+ if (m_isMapped)
+ m_events.resize.emit();
+ });
+
+ m_realPosition->setUpdateCallback([this](auto) {
+ if (m_isMapped && m_monitor != m_prevMonitor) {
+ m_prevMonitor = m_monitor;
+ m_events.monitorChanged.emit();
+ }
+ });
+
m_movingFromWorkspaceAlpha->setValueAndWarp(1.F);
m_reportedSize = m_pendingReportedSize;
@@ -687,6 +699,9 @@ void CWindow::onBorderAngleAnimEnd(WP<CBaseAnimatedVariable> pav) {
void CWindow::setHidden(bool hidden) {
m_hidden = hidden;
+ if (hidden)
+ m_events.hide.emit();
+
if (hidden && Desktop::focusState()->window() == m_self)
Desktop::focusState()->window().reset();
@@ -2119,6 +2134,7 @@ void CWindow::unmapWindow() {
m_originalClosedExtents = getFullWindowExtents();
}
+ m_events.unmap.emit();
g_pEventManager->postEvent(SHyprIPCEvent{"closewindow", std::format("{:x}", m_self.lock())});
EMIT_HOOK_EVENT("closeWindow", m_self.lock());
diff --git a/src/desktop/view/Window.hpp b/src/desktop/view/Window.hpp
index a986a63b..d689ae3f 100644
--- a/src/desktop/view/Window.hpp
+++ b/src/desktop/view/Window.hpp
@@ -109,6 +109,10 @@ namespace Desktop::View {
struct {
CSignalT<> destroy;
+ CSignalT<> unmap;
+ CSignalT<> hide;
+ CSignalT<> resize;
+ CSignalT<> monitorChanged;
} m_events;
WP<CXDGSurfaceResource> m_xdgSurface;
@@ -145,7 +149,7 @@ namespace Desktop::View {
std::string m_initialTitle = "";
std::string m_initialClass = "";
PHLWORKSPACE m_workspace;
- PHLMONITORREF m_monitor;
+ PHLMONITORREF m_monitor, m_prevMonitor;
bool m_isMapped = false;