Sway fixes that avoid weird window resizing

fsp_feeds
Tyler Goodlet 2021-09-05 13:19:27 -04:00
parent e95589e5b0
commit 709288d034
2 changed files with 13 additions and 2 deletions

View File

@ -102,6 +102,12 @@ class DpiAwareFont:
# take the max since scaling can make things ugly in some cases # take the max since scaling can make things ugly in some cases
pdpi = screen.physicalDotsPerInch() pdpi = screen.physicalDotsPerInch()
ldpi = screen.logicalDotsPerInch() ldpi = screen.logicalDotsPerInch()
# XXX: this is needed on sway/wayland where you set
# ``QT_WAYLAND_FORCE_DPI=physical``
if ldpi == 0:
ldpi = pdpi
mx_dpi = max(pdpi, ldpi) mx_dpi = max(pdpi, ldpi)
mn_dpi = min(pdpi, ldpi) mn_dpi = min(pdpi, ldpi)
scale = round(ldpi/pdpi) scale = round(ldpi/pdpi)

View File

@ -148,12 +148,17 @@ class MultiStatus:
class MainWindow(QtGui.QMainWindow): class MainWindow(QtGui.QMainWindow):
size = (800, 500) # XXX: for tiling wms this should scale
# with the alloted window size.
# TODO: detect for tiling and if untrue set some size?
# size = (300, 500)
size = (0, 0)
title = 'piker chart (ur symbol is loading bby)' title = 'piker chart (ur symbol is loading bby)'
def __init__(self, parent=None): def __init__(self, parent=None):
super().__init__(parent) super().__init__(parent)
self.setMinimumSize(*self.size) # self.setMinimumSize(*self.size)
self.setWindowTitle(self.title) self.setWindowTitle(self.title)
self._status_bar: QStatusBar = None self._status_bar: QStatusBar = None