From 8370a7fcc4627e6f21395cc8b81298369be5cdaf Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:30:28 +0200 Subject: internal: Protocol C++ Wraps + XDGOutput impl (#2733) move to our own xdgoutput impl instead of wlr's --- src/managers/XWaylandManager.cpp | 71 +--------------------------------------- 1 file changed, 1 insertion(+), 70 deletions(-) (limited to 'src/managers/XWaylandManager.cpp') diff --git a/src/managers/XWaylandManager.cpp b/src/managers/XWaylandManager.cpp index 9ef02f71..556b40b7 100644 --- a/src/managers/XWaylandManager.cpp +++ b/src/managers/XWaylandManager.cpp @@ -295,73 +295,4 @@ Vector2D CHyprXWaylandManager::getMaxSizeForWindow(CWindow* pWindow) { MAXSIZE.y = 99999; return MAXSIZE; -} - -void CHyprXWaylandManager::updateXWaylandScale() { - static auto* const PXWLFORCESCALEZERO = &g_pConfigManager->getConfigValuePtr("xwayland:force_zero_scaling")->intValue; - - setXWaylandScale(*PXWLFORCESCALEZERO ? std::optional{1.0} : std::optional{}); -} - -void CHyprXWaylandManager::setXWaylandScale(std::optional scale) { - Debug::log(LOG, "Overriding XWayland scale with %.2f", (float)scale.value_or(0.0)); - -#ifndef NO_XWAYLAND - wl_resource* res = nullptr; - for (auto& m : g_pCompositor->m_vMonitors) { - - if (!m->output || !m->m_bEnabled) - continue; - - const Vector2D LOGICALSIZE = m->vecTransformedSize / scale.value_or(m->scale); - - wl_resource* outputResource = nullptr; - bool needsDone = false; - - wl_list_for_each(res, &m->output->resources, link) { - const auto PCLIENT = wl_resource_get_client(res); - - if (PCLIENT == m_sWLRXWayland->server->client) { - const auto VERSION = wl_resource_get_version(res); - - wl_output_send_mode(res, WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED, (int32_t)LOGICALSIZE.x, (int32_t)LOGICALSIZE.y, m->output->refresh); - - if (VERSION >= WL_OUTPUT_SCALE_SINCE_VERSION) - wl_output_send_scale(res, (uint32_t)ceil(scale.value_or(m->scale))); - - wl_output_send_name(res, getFormat("HL-X11-%d", m->ID).c_str()); - - outputResource = res; - needsDone = true; - - break; - } - } - - wlr_xdg_output_v1* output; - wl_list_for_each(output, &g_pCompositor->m_sWLRXDGOutputMgr->outputs, link) { - if (output->layout_output->output == m->output) { - wl_list_for_each(res, &output->resources, link) { - const auto PCLIENT = wl_resource_get_client(res); - - if (PCLIENT == m_sWLRXWayland->server->client) { - zxdg_output_v1_send_logical_size(res, LOGICALSIZE.x, LOGICALSIZE.y); - - if (wl_resource_get_version(res) < OUTPUT_DONE_DEPRECATED_SINCE_VERSION) - zxdg_output_v1_send_done(res); - - needsDone = true; - - break; - } - } - - break; - } - } - - if (needsDone && outputResource) - wl_output_send_done(outputResource); - } -#endif -} +} \ No newline at end of file -- cgit v1.2.3