mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 08:45:58 +01:00
Fix fractional scale updates in some cases (#2447)
* fix fractional scale update in moveWorkspaceToMonitor * fix fractional scale update in moveToWorkspace * Revert "fix fractional scale update in moveWorkspaceToMonitor" This reverts commit6612197a38
. * Revert "fix fractional scale update in moveToWorkspace" This reverts commit75d9795a06
. * move fractional scale code to updateSurfaceOutputs * remove duplicate check * remove superfluous setPreferredScale()
This commit is contained in:
parent
10db5a4fdb
commit
4afeedbd56
1 changed files with 8 additions and 15 deletions
|
@ -283,6 +283,14 @@ void CWindow::updateSurfaceOutputs() {
|
|||
wlr_surface_for_each_surface(m_pWLSurface.wlr(), sendLeaveIter, PLASTMONITOR->output);
|
||||
|
||||
wlr_surface_for_each_surface(m_pWLSurface.wlr(), sendEnterIter, PNEWMONITOR->output);
|
||||
|
||||
wlr_surface_for_each_surface(
|
||||
m_pWLSurface.wlr(),
|
||||
[](wlr_surface* surf, int x, int y, void* data) {
|
||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(((CWindow*)data)->m_iMonitorID);
|
||||
g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(surf, PMONITOR ? PMONITOR->scale : 1.f);
|
||||
},
|
||||
this);
|
||||
}
|
||||
|
||||
void CWindow::moveToWorkspace(int workspaceID) {
|
||||
|
@ -291,7 +299,6 @@ void CWindow::moveToWorkspace(int workspaceID) {
|
|||
|
||||
m_iWorkspaceID = workspaceID;
|
||||
|
||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(m_iMonitorID);
|
||||
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(m_iWorkspaceID);
|
||||
|
||||
if (PWORKSPACE) {
|
||||
|
@ -303,20 +310,6 @@ void CWindow::moveToWorkspace(int workspaceID) {
|
|||
m_pSwallowed->moveToWorkspace(workspaceID);
|
||||
m_pSwallowed->m_iMonitorID = m_iMonitorID;
|
||||
}
|
||||
|
||||
if (PMONITOR)
|
||||
g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(m_pWLSurface.wlr(), PMONITOR->scale);
|
||||
|
||||
if (!m_bIsMapped)
|
||||
return;
|
||||
|
||||
wlr_surface_for_each_surface(
|
||||
m_pWLSurface.wlr(),
|
||||
[](wlr_surface* surf, int x, int y, void* data) {
|
||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(((CWindow*)data)->m_iMonitorID);
|
||||
g_pProtocolManager->m_pFractionalScaleProtocolManager->setPreferredScaleForSurface(surf, PMONITOR ? PMONITOR->scale : 1.f);
|
||||
},
|
||||
this);
|
||||
}
|
||||
|
||||
CWindow* CWindow::X11TransientFor() {
|
||||
|
|
Loading…
Reference in a new issue