summaryrefslogtreecommitdiff
path: root/src/Compositor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Compositor.cpp')
-rw-r--r--src/Compositor.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Compositor.cpp b/src/Compositor.cpp
index 62903cf9..cbdcd6b8 100644
--- a/src/Compositor.cpp
+++ b/src/Compositor.cpp
@@ -2797,10 +2797,27 @@ void CCompositor::leaveUnsafeState() {
void CCompositor::setPreferredScaleForSurface(wlr_surface* pSurface, double scale) {
g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(pSurface, scale);
wlr_surface_set_preferred_buffer_scale(pSurface, static_cast<int32_t>(std::ceil(scale)));
+
+ const auto PSURFACE = CWLSurface::surfaceFromWlr(pSurface);
+ if (!PSURFACE) {
+ Debug::log(WARN, "Orphaned wlr_surface {:x} in setPreferredScaleForSurface", (uintptr_t)pSurface);
+ return;
+ }
+
+ PSURFACE->m_fLastScale = scale;
+ PSURFACE->m_iLastScale = static_cast<int32_t>(std::ceil(scale));
}
void CCompositor::setPreferredTransformForSurface(wlr_surface* pSurface, wl_output_transform transform) {
wlr_surface_set_preferred_buffer_transform(pSurface, transform);
+
+ const auto PSURFACE = CWLSurface::surfaceFromWlr(pSurface);
+ if (!PSURFACE) {
+ Debug::log(WARN, "Orphaned wlr_surface {:x} in setPreferredTransformForSurface", (uintptr_t)pSurface);
+ return;
+ }
+
+ PSURFACE->m_eLastTransform = transform;
}
void CCompositor::updateSuspendedStates() {