xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #2162: reinit-toggle.patch

File reinit-toggle.patch, 1.6 KB (added by totaamwin32, 3 years ago)

adds env vars to be able to skip window re-init

  • xpra/client/mixins/display.py

     
    1414from xpra.scripts.config import FALSE_OPTIONS
    1515from xpra.os_util import monotonic_time
    1616from xpra.util import (
    17     iround, envint, envfloat, log_screen_sizes, engs, flatten_dict,
     17    iround, envint, envbool, envfloat, log_screen_sizes, engs, flatten_dict,
    1818    XPRA_SCALING_NOTIFICATION_ID,
    1919    )
    2020from xpra.client.mixins.stub_client_mixin import StubClientMixin
     
    2525scalinglog = Logger("scaling")
    2626
    2727MONITOR_CHANGE_REINIT = envint("XPRA_MONITOR_CHANGE_REINIT")
     28SCALE_REINIT_WINDOWS = envbool("XPRA_SCALE_REINIT_WINDOWS", True)
     29SCALE_REINIT_WINDOW_ICONS = envbool("XPRA_SCALE_REINIT_WINDOW_ICONS", True)
    2830
    29 
    3031MIN_SCALING = envfloat("XPRA_MIN_SCALING", "0.1")
    3132MAX_SCALING = envfloat("XPRA_MAX_SCALING", "8")
    3233SCALING_OPTIONS = [float(x) for x in os.environ.get("XPRA_TRAY_SCALING_OPTIONS", "0.25,0.5,0.666,1,1.25,1.5,2.0,3.0,4.0,5.0").split(",") if float(x)>=MIN_SCALING and float(x)<=MAX_SCALING]
     
    567568            if self.max_window_size!=(0, 0):
    568569                minx, miny = self.max_window_size
    569570            return max(1, min(minx, int(w*xchange))), max(1, min(miny, int(h*ychange)))
    570         self.reinit_windows(new_size_fn)
    571         self.reinit_window_icons()
     571        if SCALE_REINIT_WINDOWS:
     572            self.reinit_windows(new_size_fn)
     573        if SCALE_REINIT_WINDOW_ICONS:
     574            self.reinit_window_icons()
    572575        self.emit("scaling-changed")
    573576
    574577