Skip to content

Commit

Permalink
fix for core protocol rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
outfoxxed committed Jun 8, 2024
1 parent 4e547d8 commit a3ff9df
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/protocols/ForeignToplevelWlr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
return;
}

const auto PMONITOR = output ? g_pCompositor->getMonitorFromOutput(wlr_output_from_resource(output)) : nullptr;
if (output) {
const auto wpMonitor = CWLOutputResource::fromResource(output)->monitor;

if (PMONITOR && PWINDOW->m_pWorkspace != PMONITOR->activeWorkspace) {
g_pCompositor->moveWindowToWorkspaceSafe(PWINDOW, PMONITOR->activeWorkspace);
g_pCompositor->setActiveMonitor(PMONITOR);
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);
Expand Down

0 comments on commit a3ff9df

Please sign in to comment.