xwayland: guard monitor validity in xwayland scale overriding

This commit is contained in:
vaxerski 2023-07-15 23:10:05 +02:00
parent 06563d7034
commit 3229862dd4

View file

@ -309,6 +309,10 @@ void CHyprXWaylandManager::setXWaylandScale(std::optional<double> scale) {
#ifndef NO_XWAYLAND #ifndef NO_XWAYLAND
wl_resource* res = nullptr; wl_resource* res = nullptr;
for (auto& m : g_pCompositor->m_vMonitors) { for (auto& m : g_pCompositor->m_vMonitors) {
if (!m->output || !m->m_bEnabled)
continue;
const Vector2D LOGICALSIZE = m->vecTransformedSize / scale.value_or(m->scale); const Vector2D LOGICALSIZE = m->vecTransformedSize / scale.value_or(m->scale);
wl_resource* outputResource = nullptr; wl_resource* outputResource = nullptr;