mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 21:49:49 +01:00
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
This commit is contained in:
parent
b16af45c4a
commit
89a3c90613
1 changed files with 18 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue