surface: avoid spam of window surfaces with scale and transform events
fixes #4408
This commit is contained in:
parent
8d31c84483
commit
6b92144f15
6 changed files with 40 additions and 7 deletions
|
|
@ -1997,6 +1997,7 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
|
|||
Vector2D logicalZero = pMonitor->vecPixelSize / scaleZero;
|
||||
if (logicalZero == logicalZero.round()) {
|
||||
pMonitor->scale = scaleZero;
|
||||
wlr_output_set_scale(pMonitor->output, pMonitor->scale);
|
||||
} else {
|
||||
for (size_t i = 1; i < 90; ++i) {
|
||||
double scaleUp = (searchScale + i) / 120.0;
|
||||
|
|
@ -2034,11 +2035,15 @@ bool CHyprRenderer::applyMonitorRule(CMonitor* pMonitor, SMonitorRule* pMonitorR
|
|||
} else
|
||||
pMonitor->scale = searchScale;
|
||||
}
|
||||
|
||||
// for wlroots, that likes flooring, we have to do this.
|
||||
double logicalX = std::round(pMonitor->vecPixelSize.x / pMonitor->scale);
|
||||
logicalX += 0.1;
|
||||
|
||||
wlr_output_set_scale(pMonitor->output, pMonitor->vecPixelSize.x / logicalX);
|
||||
}
|
||||
}
|
||||
|
||||
wlr_output_set_scale(pMonitor->output, pMonitor->scale);
|
||||
|
||||
// clang-format off
|
||||
static const std::array<std::vector<std::pair<std::string, uint32_t>>, 2> formats{
|
||||
std::vector<std::pair<std::string, uint32_t>>{ /* 10-bit */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue