예제 #1
0
파일: gui.py 프로젝트: svn2github/Xpra
def _get_randr_dpi():
    try:
        from xpra.x11.bindings.randr_bindings import RandRBindings  #@UnresolvedImport
        randr_bindings = RandRBindings()
        wmm, hmm = randr_bindings.get_screen_size_mm()
        w, h =  randr_bindings.get_screen_size()
        dpix = iround(w * 25.4 / wmm)
        dpiy = iround(h * 25.4 / hmm)
        screenlog("xdpi=%s, ydpi=%s - size-mm=%ix%i, size=%ix%i", dpix, dpiy, wmm, hmm, w, h)
        return dpix, dpiy
    except Exception as e:
        screenlog.warn("failed to get dpi: %s", e)
    return -1, -1
예제 #2
0
파일: gui.py 프로젝트: rudresh2319/Xpra
def _get_randr_dpi():
    try:
        from xpra.x11.bindings.randr_bindings import RandRBindings  #@UnresolvedImport
        randr_bindings = RandRBindings()
        wmm, hmm = randr_bindings.get_screen_size_mm()
        w, h =  randr_bindings.get_screen_size()
        dpix = iround(w * 25.4 / wmm)
        dpiy = iround(h * 25.4 / hmm)
        screenlog("dpix=%s, dpiy=%s", dpix, dpiy)
        return dpix, dpiy
    except Exception as e:
        screenlog.warn("failed to get dpi: %s", e)
    return -1, -1
예제 #3
0
파일: gui.py 프로젝트: svn2github/Xpra
def _get_randr_dpi():
    try:
        from xpra.x11.bindings.randr_bindings import RandRBindings  #@UnresolvedImport
        randr_bindings = RandRBindings()
        wmm, hmm = randr_bindings.get_screen_size_mm()
        w, h =  randr_bindings.get_screen_size()
        dpix = int(w * 25.4 / wmm + 0.5)
        dpiy = int(h * 25.4 / hmm + 0.5)
        screenlog("dpix=%s, dpiy=%s", dpix, dpiy)
        return dpix, dpiy
    except Exception as e:
        screenlog.warn("failed to get dpi: %s", e)
    return -1, -1
예제 #4
0
def _get_randr_dpi():
    if RANDR_DPI and not is_Wayland():
        from xpra.gtk_common.error import xlog
        from xpra.x11.bindings.randr_bindings import RandRBindings  #@UnresolvedImport
        with xlog:
            randr_bindings = RandRBindings()
            wmm, hmm = randr_bindings.get_screen_size_mm()
            w, h = randr_bindings.get_screen_size()
            dpix = iround(w * 25.4 / wmm)
            dpiy = iround(h * 25.4 / hmm)
            screenlog("xdpi=%s, ydpi=%s - size-mm=%ix%i, size=%ix%i", dpix,
                      dpiy, wmm, hmm, w, h)
            return dpix, dpiy
    return -1, -1
예제 #5
0
파일: gui.py 프로젝트: rudresh2319/Xpra
def _get_randr_dpi():
    try:
        from xpra.gtk_common.error import xsync
        from xpra.x11.bindings.randr_bindings import RandRBindings  #@UnresolvedImport
        with xsync:
            randr_bindings = RandRBindings()
            wmm, hmm = randr_bindings.get_screen_size_mm()
            w, h = randr_bindings.get_screen_size()
            dpix = iround(w * 25.4 / wmm)
            dpiy = iround(h * 25.4 / hmm)
            screenlog("xdpi=%s, ydpi=%s - size-mm=%ix%i, size=%ix%i", dpix,
                      dpiy, wmm, hmm, w, h)
            return dpix, dpiy
    except Exception as e:
        screenlog.warn("failed to get dpi: %s", e)
    return -1, -1