mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-29 00:51:53 +08:00
minor vnc fixes
This commit is contained in:
1
PKGBUILD
1
PKGBUILD
@@ -41,6 +41,7 @@ depends=(
|
||||
python-pam
|
||||
python-pillow
|
||||
python-xlib
|
||||
freetype2
|
||||
v4l-utils
|
||||
nginx-mainline
|
||||
openssl
|
||||
|
||||
@@ -352,12 +352,12 @@ class RfbClient: # pylint: disable=too-many-instance-attributes
|
||||
"middle": bool(buttons & 0x2),
|
||||
},
|
||||
wheel={
|
||||
"x": (32 if buttons & 0x40 else (-32 if buttons & 0x20 else 0)),
|
||||
"y": (32 if buttons & 0x10 else (-32 if buttons & 0x8 else 0)),
|
||||
"x": (-4 if buttons & 0x40 else (4 if buttons & 0x20 else 0)),
|
||||
"y": (-4 if buttons & 0x10 else (4 if buttons & 0x8 else 0)),
|
||||
},
|
||||
move={
|
||||
"x": round(to_x / self._width * 65535 + -32768),
|
||||
"y": round(to_y / self._width * 65535 + -32768),
|
||||
"y": round(to_y / self._height * 65535 + -32768),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import asyncio
|
||||
import asyncio.queues
|
||||
import socket
|
||||
import dataclasses
|
||||
import contextlib
|
||||
import json
|
||||
|
||||
from typing import Dict
|
||||
@@ -281,7 +282,7 @@ class VncServer:
|
||||
logger = get_logger(0)
|
||||
logger.info("Listening VNC on TCP [%s]:%d ...", self.__host, self.__port)
|
||||
|
||||
sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
|
||||
with contextlib.closing(socket.socket(socket.AF_INET6, socket.SOCK_STREAM)) as sock:
|
||||
sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, False)
|
||||
sock.bind((self.__host, self.__port))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user