Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* support "*" as dimensions separator
* is nothing matches, use 1,1 rather than the first entry

git-svn-id: https://xpra.org/svn/Xpra/trunk@11850 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 4, 2016
1 parent 76059de commit 1832392
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def parse_scaling(self, desktop_scaling):
dims = ldef[0].split("x")
assert len(dims)==2, "could not find 2 dimensions separated by 'x' in '%s'" % ldef[0]
x, y = int(dims[0]), int(dims[1])
scaleparts = ldef[1].replace("/", "x").split("x")
scaleparts = ldef[1].replace("*", "x").replace("/", "x").split("x")
assert len(scaleparts)<=2, "found more than 2 scaling dimensions!"
if len(scaleparts)==1:
sx = sy = float(scaleparts[0])
Expand All @@ -491,10 +491,13 @@ def parse_scaling(self, desktop_scaling):
else:
scalinglog.warn("Warning: invalid auto attributes '%s'", desktop_scaling[5:])
sx, sy = 1, 1
for mx, my, sx, sy in limits:
if root_w<=mx and root_h<=my:
matched = False
for mx, my, tsx, tsy in limits:
if root_w*root_h<=mx*my:
sx, sy = tsx, tsy
matched = True
break
scalinglog("matched %sx%s with limits %s: %sx%s", root_w, root_h, limits, sx, sy)
scalinglog("matched=%s : %sx%s with limits %s: %sx%s", matched, root_w, root_h, limits, sx, sy)
return sx,sy
def parse_item(v):
div = 1
Expand Down

0 comments on commit 1832392

Please sign in to comment.