xpra icon
Bug tracker and wiki

Ticket #2714: max.patch

File max.patch, 3.3 KB (added by Antoine Martin, 9 months ago)

alternative fix

  • xpra/client/client_window_base.py

     
    11# This file is part of Xpra.
    22# Copyright (C) 2011 Serviware (Arthur Huillet, <ahuillet@serviware.com>)
    3 # Copyright (C) 2010-2019 Antoine Martin <antoine@xpra.org>
     3# Copyright (C) 2010-2020 Antoine Martin <antoine@xpra.org>
    44# Copyright (C) 2008, 2010 Nathaniel Smith <njs@pobox.com>
    55# Xpra is released under the terms of the GNU GPL v2, or, at your option, any
    66# later version. See the file COPYING for details.
     
    99import re
    1010
    1111from xpra.client.client_widget_base import ClientWidgetBase
     12from xpra.common import MAX_WINDOW_SIZE
    1213from xpra.os_util import bytestostr, OSX, WIN32, is_Wayland
    1314from xpra.util import typedict, envbool, envint, WORKSPACE_UNSET, WORKSPACE_NAMES
    1415from xpra.log import Logger
     
    472473            geomlog("intpair(%s)=%s", a, v)
    473474            if v:
    474475                v1, v2 = v
    475                 if a==b"maximum-size" and v1>=32000 and v2>=32000 and WIN32:
    476                     #causes problems, see #2714
    477                     continue
    478476                sv1 = client.sx(v1)
    479477                sv2 = client.sy(v2)
    480                 if a in (b"base-size", b"increment"):
     478                if WIN32 and a==b"maximum-size":
     479                    from xpra.platform.win32.gui import get_virtualscreenmetrics
     480                    w, h = get_virtualscreenmetrics()[2:4]
     481                    if sv1>MAX_WINDOW_SIZE>w:
     482                        geomlog("clamped max-width from %i to %i", sv1, w)
     483                        sv1 = w
     484                    if sv2>MAX_WINDOW_SIZE>h:
     485                        geomlog("clamped max-height from %i to %i", sv2, h)
     486                        sv2 = h
     487                elif a in (b"base-size", b"increment"):
    481488                    #rounding is not allowed for these values
    482489                    fsv1 = client.fsx(v1)
    483490                    fsv2 = client.fsy(v2)
  • xpra/client/gtk3/gtk3_client_window.py

     
    7373        return (x, y, w, h)
    7474
    7575    def apply_geometry_hints(self, hints):
     76        return
    7677        """ we convert the hints as a dict into a gdk.Geometry + gdk.WindowHints """
    7778        wh = Gdk.WindowHints
    7879        name_to_hint = {"maximum-size"  : wh.MAX_SIZE,
  • xpra/platform/win32/gui.py

     
    8686GROUP_LEADER = WINDOW_HOOKS and envbool("XPRA_WIN32_GROUP_LEADER", True)
    8787UNDECORATED_STYLE = WINDOW_HOOKS and envbool("XPRA_WIN32_UNDECORATED_STYLE", True)
    8888CLIP_CURSOR = WINDOW_HOOKS and envbool("XPRA_WIN32_CLIP_CURSOR", True)
    89 #GTK3 is fixed, so we don't need this hook:
    90 MAX_SIZE_HINT = WINDOW_HOOKS and envbool("XPRA_WIN32_MAX_SIZE_HINT", False)
     89MAX_SIZE_HINT = WINDOW_HOOKS and envbool("XPRA_WIN32_MAX_SIZE_HINT", True)
    9190LANGCHANGE = WINDOW_HOOKS and envbool("XPRA_WIN32_LANGCHANGE", True)
    9291
    9392DPI_AWARE = envbool("XPRA_DPI_AWARE", True)