Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

send preferred_buffer_scale event after entering an output #2331

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

lilydjwg
Copy link
Contributor

@lilydjwg lilydjwg commented Apr 13, 2024

Qt 6.7.0+ requires this to correctly scale when fractional scale is not enabled.

A simple PyQt6 program to demostrate:

#!/usr/bin/python3

import sys

from PyQt6 import QtWidgets, QtCore

def main():
  QtWidgets.QApplication.setHighDpiScaleFactorRoundingPolicy(
    QtCore.Qt.HighDpiScaleFactorRoundingPolicy.RoundPreferFloor)

  app = QtWidgets.QApplication(sys.argv)
  test = QtWidgets.QLabel("测试 Qt")
  test.show()
  sys.exit(app.exec())

if __name__ == '__main__':
  main()

Setting QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor for Qt6 apps should also reproduce it but not tested. This happens with Telegram (with "presice High DPI scaling" disabled) + Qt6 6.7.0.

Fixes #2253

Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general maybe we should iterate over all the visible outputs and select the highest scale?

@lilydjwg
Copy link
Contributor Author

We may select the highest one among the outputs the surface in on.

src/view/wlr-surface-node.cpp Outdated Show resolved Hide resolved
src/view/wlr-surface-node.cpp Outdated Show resolved Hide resolved
Qt 6.7.0+ requires this to correctly scale when fractional scale is not
enabled.

Also use max scale of all outputs the surface is on.
Copy link
Member

@ammen99 ammen99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thanks!

@ammen99 ammen99 merged commit e93aebf into WayfireWM:master Jun 11, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set fractional and preferred surface scale
2 participants