Skip to content

Commit

Permalink
wlr-foreign-toplevel: fix fullscreen failing and add output support
Browse files Browse the repository at this point in the history
  • Loading branch information
outfoxxed committed Jun 8, 2024
1 parent 6967a31 commit 4e547d8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/protocols/ForeignToplevelWlr.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "ForeignToplevelWlr.hpp"
#include <algorithm>
#include "../Compositor.hpp"
#include "render/Renderer.hpp"

#define LOGM PROTO::foreignToplevelWlr->protoLog

Expand Down Expand Up @@ -36,7 +37,15 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
return;
}

g_pCompositor->setWindowFullscreen(PWINDOW, true);
const auto PMONITOR = output ? g_pCompositor->getMonitorFromOutput(wlr_output_from_resource(output)) : nullptr;

if (PMONITOR && PWINDOW->m_pWorkspace != PMONITOR->activeWorkspace) {
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, PMONITOR->activeWorkspace);
g_pCompositor->setActiveMonitor(PMONITOR);
}

g_pCompositor->setWindowFullscreen(PWINDOW, true, FULLSCREEN_FULL);
g_pHyprRenderer->damageWindow(PWINDOW);
});

resource->setUnsetFullscreen([this](CZwlrForeignToplevelHandleV1* p) {
Expand Down

0 comments on commit 4e547d8

Please sign in to comment.