aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoroutfoxxed <[email protected]>2024-06-10 03:16:38 -0700
committerGitHub <[email protected]>2024-06-10 12:16:38 +0200
commit89a3c9061367bb19c105a651280b3f3f17c66d22 (patch)
tree92b321b98f56264545e9bc4c1829ef1e1ba01aee
parentb16af45c4ac22d4a49de4e2f11e96132c8718844 (diff)
downloadHyprland-89a3c9061367bb19c105a651280b3f3f17c66d22.tar.gz
Hyprland-89a3c9061367bb19c105a651280b3f3f17c66d22.zip
wlr-foreign-toplevel: fix fullscreen failing and add output support (#6360)
* wlr-foreign-toplevel: fix fullscreen failing and add output support * fix for core protocol rewrite
-rw-r--r--src/protocols/ForeignToplevelWlr.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/protocols/ForeignToplevelWlr.cpp b/src/protocols/ForeignToplevelWlr.cpp
index 782fbc0e..8224f495 100644
--- a/src/protocols/ForeignToplevelWlr.cpp
+++ b/src/protocols/ForeignToplevelWlr.cpp
@@ -1,6 +1,8 @@
#include "ForeignToplevelWlr.hpp"
#include <algorithm>
#include "../Compositor.hpp"
+#include "protocols/core/Output.hpp"
+#include "render/Renderer.hpp"
#define LOGM PROTO::foreignToplevelWlr->protoLog
@@ -36,7 +38,21 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
return;
}
- g_pCompositor->setWindowFullscreen(PWINDOW, true);
+ if (output) {
+ const auto wpMonitor = CWLOutputResource::fromResource(output)->monitor;
+
+ if (!wpMonitor.expired()) {
+ const auto monitor = wpMonitor.lock();
+
+ if (PWINDOW->m_pWorkspace != monitor->activeWorkspace) {
+ g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, monitor->activeWorkspace);
+ g_pCompositor->setActiveMonitor(monitor.get());
+ }
+ }
+ }
+
+ g_pCompositor->setWindowFullscreen(PWINDOW, true, FULLSCREEN_FULL);
+ g_pHyprRenderer->damageWindow(PWINDOW);
});
resource->setUnsetFullscreen([this](CZwlrForeignToplevelHandleV1* p) {
@@ -372,4 +388,4 @@ PHLWINDOW CForeignToplevelWlrProtocol::windowFromHandleResource(wl_resource* res
}
return nullptr;
-} \ No newline at end of file
+}