mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-12-19 22:09:09 +08:00
Compare commits
6 Commits
757ca330b8
...
v1.1.2-202
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
07c7c7f179 | ||
|
|
c5ceeb0d80 | ||
|
|
5ce0a891df | ||
|
|
f94ef49210 | ||
|
|
5d0a4d1385 | ||
|
|
dd482cee60 |
12
.github/workflows/build.yml
vendored
12
.github/workflows/build.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
|||||||
id: set_deb_version
|
id: set_deb_version
|
||||||
run: |
|
run: |
|
||||||
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
|
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
|
||||||
BUILD_DATE=$(date +%Y%m%d)
|
BUILD_DATE=$(TZ=Asia/Shanghai date +%Y%m%d)
|
||||||
if [[ ! "${VERSION_NUM}" =~ ^[0-9] ]]; then
|
if [[ ! "${VERSION_NUM}" =~ ^[0-9] ]]; then
|
||||||
LEGAL_VERSION="v0.0.0-${VERSION_NUM}-${BUILD_DATE}-${SHORT_SHA}"
|
LEGAL_VERSION="v0.0.0-${VERSION_NUM}-${BUILD_DATE}-${SHORT_SHA}"
|
||||||
else
|
else
|
||||||
@@ -101,7 +101,7 @@ jobs:
|
|||||||
id: set_deb_version
|
id: set_deb_version
|
||||||
run: |
|
run: |
|
||||||
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
|
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
|
||||||
BUILD_DATE=$(date +%Y%m%d)
|
BUILD_DATE=$(TZ=Asia/Shanghai date +%Y%m%d)
|
||||||
if [[ ! "${VERSION_NUM}" =~ ^[0-9] ]]; then
|
if [[ ! "${VERSION_NUM}" =~ ^[0-9] ]]; then
|
||||||
LEGAL_VERSION="v0.0.0-${VERSION_NUM}-${BUILD_DATE}-${SHORT_SHA}"
|
LEGAL_VERSION="v0.0.0-${VERSION_NUM}-${BUILD_DATE}-${SHORT_SHA}"
|
||||||
else
|
else
|
||||||
@@ -164,7 +164,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
VERSION="${GITHUB_REF##*/}"
|
VERSION="${GITHUB_REF##*/}"
|
||||||
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
|
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
|
||||||
BUILD_DATE=$(date +%Y%m%d)
|
BUILD_DATE=$(TZ=Asia/Shanghai date +%Y%m%d)
|
||||||
VERSION_NUM="v${VERSION#v}-${BUILD_DATE}-${SHORT_SHA}"
|
VERSION_NUM="v${VERSION#v}-${BUILD_DATE}-${SHORT_SHA}"
|
||||||
echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_ENV
|
echo "VERSION_NUM=${VERSION_NUM}" >> $GITHUB_ENV
|
||||||
echo "VERSION_NUM=${VERSION_NUM}"
|
echo "VERSION_NUM=${VERSION_NUM}"
|
||||||
@@ -229,7 +229,7 @@ jobs:
|
|||||||
$version = $version -replace '^v', ''
|
$version = $version -replace '^v', ''
|
||||||
$version = $version -replace '/', '-'
|
$version = $version -replace '/', '-'
|
||||||
$SHORT_SHA = $env:GITHUB_SHA.Substring(0,7)
|
$SHORT_SHA = $env:GITHUB_SHA.Substring(0,7)
|
||||||
$BUILD_DATE = Get-Date -Format "yyyyMMdd"
|
$BUILD_DATE = ([System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId((Get-Date), "China Standard Time")).ToString("yyyyMMdd")
|
||||||
echo "VERSION_NUM=v$version-$BUILD_DATE-$SHORT_SHA" >> $env:GITHUB_ENV
|
echo "VERSION_NUM=v$version-$BUILD_DATE-$SHORT_SHA" >> $env:GITHUB_ENV
|
||||||
echo "BUILD_DATE=$BUILD_DATE" >> $env:GITHUB_ENV
|
echo "BUILD_DATE=$BUILD_DATE" >> $env:GITHUB_ENV
|
||||||
|
|
||||||
@@ -340,8 +340,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
VERSION="${GITHUB_REF##*/}"
|
VERSION="${GITHUB_REF##*/}"
|
||||||
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
|
SHORT_SHA=$(echo "${GITHUB_SHA}" | cut -c1-7)
|
||||||
BUILD_DATE=$(date +%Y%m%d)
|
BUILD_DATE=$(TZ=Asia/Shanghai date +%Y%m%d)
|
||||||
BUILD_DATE_ISO=$(date +%Y-%m-%d)
|
BUILD_DATE_ISO=$(TZ=Asia/Shanghai date +%Y-%m-%d)
|
||||||
VERSION_NUM="${VERSION#v}-${BUILD_DATE}-${SHORT_SHA}"
|
VERSION_NUM="${VERSION#v}-${BUILD_DATE}-${SHORT_SHA}"
|
||||||
VERSION_WITH_V="v${VERSION_NUM}"
|
VERSION_WITH_V="v${VERSION_NUM}"
|
||||||
VERSION_ONLY="${VERSION#v}"
|
VERSION_ONLY="${VERSION#v}"
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ sudo docker run -d \
|
|||||||
-v /path/to/your/certs:/crossdesk-server/certs \
|
-v /path/to/your/certs:/crossdesk-server/certs \
|
||||||
-v /path/to/your/db:/crossdesk-server/db \
|
-v /path/to/your/db:/crossdesk-server/db \
|
||||||
-v /path/to/your/logs:/crossdesk-server/logs \
|
-v /path/to/your/logs:/crossdesk-server/logs \
|
||||||
crossdesk/crossdesk-server:latest
|
crossdesk/crossdesk-server:v1.1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
上述命令中,用户需注意的参数如下:
|
上述命令中,用户需注意的参数如下:
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ sudo docker run -d \
|
|||||||
-v /path/to/your/certs:/crossdesk-server/certs \
|
-v /path/to/your/certs:/crossdesk-server/certs \
|
||||||
-v /path/to/your/db:/crossdesk-server/db \
|
-v /path/to/your/db:/crossdesk-server/db \
|
||||||
-v /path/to/your/logs:/crossdesk-server/logs \
|
-v /path/to/your/logs:/crossdesk-server/logs \
|
||||||
crossdesk/crossdesk-server:v1.1.0
|
crossdesk/crossdesk-server:v1.1.1
|
||||||
```
|
```
|
||||||
|
|
||||||
The parameters you need to pay attention to are as follows:
|
The parameters you need to pay attention to are as follows:
|
||||||
|
|||||||
@@ -51,7 +51,16 @@ int KeyboardCapturer::Hook(OnKeyAction on_key_action, void* user_ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int KeyboardCapturer::Unhook() {
|
int KeyboardCapturer::Unhook() {
|
||||||
|
g_on_key_action = nullptr;
|
||||||
|
g_user_ptr = nullptr;
|
||||||
|
|
||||||
running_ = false;
|
running_ = false;
|
||||||
|
|
||||||
|
if (display_) {
|
||||||
|
XSelectInput(display_, DefaultRootWindow(display_), 0);
|
||||||
|
XFlush(display_);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,10 @@ static void* g_user_ptr = nullptr;
|
|||||||
|
|
||||||
CGEventRef eventCallback(CGEventTapProxy proxy, CGEventType type,
|
CGEventRef eventCallback(CGEventTapProxy proxy, CGEventType type,
|
||||||
CGEventRef event, void* userInfo) {
|
CGEventRef event, void* userInfo) {
|
||||||
|
if (!g_on_key_action) {
|
||||||
|
return event;
|
||||||
|
}
|
||||||
|
|
||||||
KeyboardCapturer* keyboard_capturer = (KeyboardCapturer*)userInfo;
|
KeyboardCapturer* keyboard_capturer = (KeyboardCapturer*)userInfo;
|
||||||
if (!keyboard_capturer) {
|
if (!keyboard_capturer) {
|
||||||
LOG_ERROR("keyboard_capturer is nullptr");
|
LOG_ERROR("keyboard_capturer is nullptr");
|
||||||
@@ -120,12 +124,23 @@ int KeyboardCapturer::Hook(OnKeyAction on_key_action, void* user_ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int KeyboardCapturer::Unhook() {
|
int KeyboardCapturer::Unhook() {
|
||||||
|
g_on_key_action = nullptr;
|
||||||
|
g_user_ptr = nullptr;
|
||||||
|
|
||||||
|
if (event_tap_) {
|
||||||
|
CGEventTapEnable(event_tap_, false);
|
||||||
|
}
|
||||||
|
|
||||||
if (run_loop_source_) {
|
if (run_loop_source_) {
|
||||||
|
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), run_loop_source_,
|
||||||
|
kCFRunLoopCommonModes);
|
||||||
CFRelease(run_loop_source_);
|
CFRelease(run_loop_source_);
|
||||||
|
run_loop_source_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event_tap_) {
|
if (event_tap_) {
|
||||||
CFRelease(event_tap_);
|
CFRelease(event_tap_);
|
||||||
|
event_tap_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -39,7 +39,12 @@ int KeyboardCapturer::Hook(OnKeyAction on_key_action, void* user_ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int KeyboardCapturer::Unhook() {
|
int KeyboardCapturer::Unhook() {
|
||||||
|
if (keyboard_hook_) {
|
||||||
|
g_on_key_action = nullptr;
|
||||||
|
g_user_ptr = nullptr;
|
||||||
UnhookWindowsHookEx(keyboard_hook_);
|
UnhookWindowsHookEx(keyboard_hook_);
|
||||||
|
keyboard_hook_ = nullptr;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1340,6 +1340,7 @@ void Render::ProcessSdlEvent(const SDL_Event& event) {
|
|||||||
is_client_mode_ = false;
|
is_client_mode_ = false;
|
||||||
reload_recent_connections_ = true;
|
reload_recent_connections_ = true;
|
||||||
fullscreen_button_pressed_ = false;
|
fullscreen_button_pressed_ = false;
|
||||||
|
start_keyboard_capturer_ = false;
|
||||||
just_created_ = false;
|
just_created_ = false;
|
||||||
recent_connection_image_save_time_ = SDL_GetTicks();
|
recent_connection_image_save_time_ = SDL_GetTicks();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#include <cmath>
|
||||||
|
|
||||||
#include "device_controller.h"
|
#include "device_controller.h"
|
||||||
#include "localization.h"
|
#include "localization.h"
|
||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
@@ -101,28 +103,39 @@ int Render::ProcessMouseEvent(const SDL_Event& event) {
|
|||||||
last_mouse_event.button.y >= props->stream_render_rect_.y &&
|
last_mouse_event.button.y >= props->stream_render_rect_.y &&
|
||||||
last_mouse_event.button.y <= props->stream_render_rect_.y +
|
last_mouse_event.button.y <= props->stream_render_rect_.y +
|
||||||
props->stream_render_rect_.h) {
|
props->stream_render_rect_.h) {
|
||||||
int scroll_x = event.wheel.x;
|
float scroll_x = event.wheel.x;
|
||||||
int scroll_y = event.wheel.y;
|
float scroll_y = event.wheel.y;
|
||||||
if (event.wheel.direction == SDL_MOUSEWHEEL_FLIPPED) {
|
if (event.wheel.direction == SDL_MOUSEWHEEL_FLIPPED) {
|
||||||
scroll_x = -scroll_x;
|
scroll_x = -scroll_x;
|
||||||
scroll_y = -scroll_y;
|
scroll_y = -scroll_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
remote_action.type = ControlType::mouse;
|
remote_action.type = ControlType::mouse;
|
||||||
if (scroll_x == 0) {
|
|
||||||
|
auto roundUp = [](float value) -> int {
|
||||||
|
if (value > 0) {
|
||||||
|
return static_cast<int>(std::ceil(value));
|
||||||
|
} else if (value < 0) {
|
||||||
|
return static_cast<int>(std::floor(value));
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
if (std::abs(scroll_y) >= std::abs(scroll_x)) {
|
||||||
remote_action.m.flag = MouseFlag::wheel_vertical;
|
remote_action.m.flag = MouseFlag::wheel_vertical;
|
||||||
remote_action.m.s = scroll_y;
|
remote_action.m.s = roundUp(scroll_y);
|
||||||
} else if (scroll_y == 0) {
|
} else {
|
||||||
remote_action.m.flag = MouseFlag::wheel_horizontal;
|
remote_action.m.flag = MouseFlag::wheel_horizontal;
|
||||||
remote_action.m.s = scroll_x;
|
remote_action.m.s = roundUp(scroll_x);
|
||||||
}
|
}
|
||||||
|
|
||||||
render_width = props->stream_render_rect_.w;
|
render_width = props->stream_render_rect_.w;
|
||||||
render_height = props->stream_render_rect_.h;
|
render_height = props->stream_render_rect_.h;
|
||||||
remote_action.m.x =
|
remote_action.m.x =
|
||||||
(float)(event.button.x - props->stream_render_rect_.x) / render_width;
|
(float)(last_mouse_event.button.x - props->stream_render_rect_.x) /
|
||||||
|
render_width;
|
||||||
remote_action.m.y =
|
remote_action.m.y =
|
||||||
(float)(event.button.y - props->stream_render_rect_.y) /
|
(float)(last_mouse_event.button.y - props->stream_render_rect_.y) /
|
||||||
render_height;
|
render_height;
|
||||||
|
|
||||||
std::string msg = remote_action.to_json();
|
std::string msg = remote_action.to_json();
|
||||||
@@ -225,8 +238,6 @@ void Render::OnReceiveVideoBufferCb(const XVideoFrame* video_frame,
|
|||||||
props->video_height_ = video_frame->height;
|
props->video_height_ = video_frame->height;
|
||||||
props->video_size_ = video_frame->size;
|
props->video_size_ = video_frame->size;
|
||||||
|
|
||||||
LOG_ERROR("receive: {}x{}", props->video_width_, props->video_height_);
|
|
||||||
|
|
||||||
if (need_to_update_render_rect) {
|
if (need_to_update_render_rect) {
|
||||||
render->UpdateRenderRect();
|
render->UpdateRenderRect();
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule submodules/minirtc updated: bb892a1f9d...8bcad95896
Reference in New Issue
Block a user