diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 748be5cd3..5fb9788b6 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -13,10 +13,10 @@ on: jobs: build: name: Build - runs-on: macos-10.15 + runs-on: macos-11 strategy: matrix: - qt-ver: [5.15.1] + qt-ver: [5.15.2] qt-arch-install: [clang_64] clang-arch: [x64] env: diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 86cbbf81e..89c0fa643 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -24,7 +24,7 @@ jobs: # 矩阵配置 https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix strategy: matrix: - qt-ver: [5.15.1] + qt-ver: [5.15.2] qt-arch: [win64_msvc2019_64, win32_msvc2019] # 配置qt-arch的额外设置msvc-arch,qt-arch-install include: diff --git a/QtScrcpy/QtScrcpyCore b/QtScrcpy/QtScrcpyCore index 9b81a312a..0ed6236e0 160000 --- a/QtScrcpy/QtScrcpyCore +++ b/QtScrcpy/QtScrcpyCore @@ -1 +1 @@ -Subproject commit 9b81a312ad2e8157c48dc042e973a81702357509 +Subproject commit 0ed6236e0a43cf27baef51dab7a64cb36fd068c0 diff --git a/QtScrcpy/main.cpp b/QtScrcpy/main.cpp index 629e08bdb..a24ba60b4 100644 --- a/QtScrcpy/main.cpp +++ b/QtScrcpy/main.cpp @@ -113,6 +113,9 @@ int main(int argc, char *argv[]) "following address:"); qInfo() << QString("QtScrcpy %1 ").arg(QCoreApplication::applicationVersion()); + qInfo() << QObject::tr("If you need more professional screen projection control software, you can try the following software:"); + qInfo() << QString(QObject::tr("QuickMirror") + " "); + int ret = a.exec(); delete g_mainDlg; diff --git a/QtScrcpy/res/i18n/en_US.qm b/QtScrcpy/res/i18n/en_US.qm index 854e80499..b73a8391d 100644 Binary files a/QtScrcpy/res/i18n/en_US.qm and b/QtScrcpy/res/i18n/en_US.qm differ diff --git a/QtScrcpy/res/i18n/en_US.ts b/QtScrcpy/res/i18n/en_US.ts index 626a7607c..5a5dcdd98 100644 --- a/QtScrcpy/res/i18n/en_US.ts +++ b/QtScrcpy/res/i18n/en_US.ts @@ -38,6 +38,14 @@ This software is completely open source and free. Use it at your own risk. You can download it at the following address: This software is completely open source and free. Use it at your own risk. You can download it at the following address: + + If you need more professional screen projection control software, you can try the following software: + If you need more professional screen projection control software, you can try the following software: + + + QuickMirror + QuickMirror + ToolForm diff --git a/QtScrcpy/res/i18n/zh_CN.qm b/QtScrcpy/res/i18n/zh_CN.qm index a505d6d00..3664aea87 100644 Binary files a/QtScrcpy/res/i18n/zh_CN.qm and b/QtScrcpy/res/i18n/zh_CN.qm differ diff --git a/QtScrcpy/res/i18n/zh_CN.ts b/QtScrcpy/res/i18n/zh_CN.ts index 093c35d75..6a71c1b6a 100644 --- a/QtScrcpy/res/i18n/zh_CN.ts +++ b/QtScrcpy/res/i18n/zh_CN.ts @@ -38,6 +38,14 @@ This software is completely open source and free. Use it at your own risk. You can download it at the following address: 本软件完全开源免费,作者不对使用该软件产生的一切后果负责。你可以在以下地址下载: + + If you need more professional screen projection control software, you can try the following software: + 如果你需要更加专业的投屏控制软件,可以尝试作者开发的商业版: + + + QuickMirror + 极限投屏 + ToolForm diff --git a/QtScrcpy/ui/dialog.cpp b/QtScrcpy/ui/dialog.cpp index abc143f8d..756837b93 100644 --- a/QtScrcpy/ui/dialog.cpp +++ b/QtScrcpy/ui/dialog.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -272,10 +273,13 @@ void Dialog::slotActivated(QSystemTrayIcon::ActivationReason reason) void Dialog::closeEvent(QCloseEvent *event) { this->hide(); - m_hideIcon->showMessage(tr("Notice"), - tr("Hidden here!"), - QSystemTrayIcon::Information, - 3000); + if (!Config::getInstance().getTrayMessageShown()) { + Config::getInstance().setTrayMessageShown(true); + m_hideIcon->showMessage(tr("Notice"), + tr("Hidden here!"), + QSystemTrayIcon::Information, + 3000); + } event->ignore(); } @@ -317,6 +321,7 @@ void Dialog::on_startServerBtn_clicked() params.logLevel = Config::getInstance().getLogLevel(); params.codecOptions = Config::getInstance().getCodecOptions(); params.codecName = Config::getInstance().getCodecName(); + params.scid = QRandomGenerator::global()->bounded(1, 10000) & 0x7FFFFFFF; qsc::IDeviceManage::getInstance().connectDevice(params); } @@ -454,8 +459,10 @@ void Dialog::onDeviceConnected(bool success, const QString &serial, const QStrin videoForm->staysOnTop(); } +#ifndef Q_OS_WIN32 // must be show before updateShowSize videoForm->show(); +#endif QString name = Config::getInstance().getNickName(serial); if (name.isEmpty()) { name = Config::getInstance().getTitle(); @@ -473,6 +480,11 @@ void Dialog::onDeviceConnected(bool success, const QString &serial, const QStrin videoForm->setGeometry(rc); } +#ifdef Q_OS_WIN32 + // windows是show太早可以看到resize的过程 + QTimer::singleShot(200, videoForm, [videoForm](){videoForm->show();}); +#endif + GroupController::instance().addDevice(serial); } diff --git a/QtScrcpy/ui/videoform.cpp b/QtScrcpy/ui/videoform.cpp index 64772c78f..bbed173aa 100644 --- a/QtScrcpy/ui/videoform.cpp +++ b/QtScrcpy/ui/videoform.cpp @@ -513,6 +513,9 @@ void VideoForm::switchFullScreen() bool VideoForm::isHost() { + if (!m_toolForm) { + return false; + } return m_toolForm->isHost(); } @@ -719,7 +722,9 @@ void VideoForm::showEvent(QShowEvent *event) { Q_UNUSED(event) if (!isFullScreen()) { - showToolForm(); + QTimer::singleShot(500, this, [this](){ + showToolForm(); + }); } } diff --git a/QtScrcpy/util/config.cpp b/QtScrcpy/util/config.cpp index 49eeb2a08..b75f0f79c 100644 --- a/QtScrcpy/util/config.cpp +++ b/QtScrcpy/util/config.cpp @@ -18,7 +18,7 @@ #define COMMON_PUSHFILE_DEF "/sdcard/" #define COMMON_SERVER_VERSION_KEY "ServerVersion" -#define COMMON_SERVER_VERSION_DEF "1.24" +#define COMMON_SERVER_VERSION_DEF "2.1.1" #define COMMON_SERVER_PATH_KEY "ServerPath" #define COMMON_SERVER_PATH_DEF "/data/local/tmp/scrcpy-server.jar" @@ -93,6 +93,9 @@ #define COMMON_AUTO_UPDATE_DEVICE_KEY "AutoUpdateDevice" #define COMMON_AUTO_UPDATE_DEVICE_DEF true +#define COMMON_TRAY_MESSAGE_SHOWN_KEY "TrayMessageShown" +#define COMMON_TRAY_MESSAGE_SHOWN_DEF false + // device config #define SERIAL_WINDOW_RECT_KEY_X "WindowRectX" #define SERIAL_WINDOW_RECT_KEY_Y "WindowRectY" @@ -187,6 +190,23 @@ UserBootConfig Config::getUserBootConfig() return config; } +void Config::setTrayMessageShown(bool shown) +{ + m_userData->beginGroup(GROUP_COMMON); + m_userData->setValue(COMMON_TRAY_MESSAGE_SHOWN_KEY, shown); + m_userData->endGroup(); + m_userData->sync(); +} + +bool Config::getTrayMessageShown() +{ + bool shown; + m_userData->beginGroup(GROUP_COMMON); + shown = m_userData->value(COMMON_TRAY_MESSAGE_SHOWN_KEY, COMMON_TRAY_MESSAGE_SHOWN_DEF).toBool(); + m_userData->endGroup(); + return shown; +} + void Config::setRect(const QString &serial, const QRect &rc) { m_userData->beginGroup(serial); diff --git a/QtScrcpy/util/config.h b/QtScrcpy/util/config.h index 137e3755d..1f551265f 100644 --- a/QtScrcpy/util/config.h +++ b/QtScrcpy/util/config.h @@ -50,6 +50,8 @@ class Config : public QObject // user data:common void setUserBootConfig(const UserBootConfig &config); UserBootConfig getUserBootConfig(); + void setTrayMessageShown(bool shown); + bool getTrayMessageShown(); // user data:device void setNickName(const QString &serial, const QString &name); diff --git a/README_zh.md b/README_zh.md index 79bae22e1..536519abc 100644 --- a/README_zh.md +++ b/README_zh.md @@ -30,6 +30,24 @@ QtScrcpy 可以通过 USB / 网络连接Android设备,并进行显示和控制 ![linux](screenshot/linux-zh.png) +## 作者开发了更加专业的投屏软件`极限投屏` +极限投屏功能&特点: +- 设备投屏&控制:批量投屏、单个控制、批量控制 +- 分组管理 +- wifi投屏/OTG投屏 +- adb shell快捷指令 +- 文件传输、apk安装 +- 投屏数量多:在OTG投屏模式,设置分辨率和流畅度为低的情况下,单台电脑可以同时管理500+台手机 +- 低延迟:usb投屏1080p延迟在30ms以内,在相同分辨率流畅度情况下,比市面上所有投屏软件延迟都低 +- cpu占用率低:纯C++开发,高性能GPU视频渲染 +- 高分辨率:可调节,最大支持安卓终端的原生分辨率 +- 完美中文输入:支持闲鱼app,支持三星手机 +- 免费版最多投屏20台,功能无限制(除了自动重新投屏) +- 极限投屏使用教程:https://lrbnfell4p.feishu.cn/docx/QRMhd9nImorAGgxVLlmczxSdnYf +- 极限投屏qq交流群:822464342 +- 极限投屏界面预览: +![quickmirror](docs/image/quickmirror.png) + ## 自定义按键映射 可以根据需要,自己编写脚本将键盘按键映射为手机的触摸点击,编写规则在[这里](docs/KeyMapDes_zh.md)。 @@ -48,7 +66,7 @@ QtScrcpy 可以通过 USB / 网络连接Android设备,并进行显示和控制 - 再次按~键切换为正常控制模式 - (对于和平精英等游戏)若想使用方向盘控制载具,记得在载具设置中设置为单摇杆模式 -## 群控 +## 批量操作 你可以同时控制所有的手机 ![gc](docs/image/group-control.gif) @@ -176,7 +194,7 @@ Mac OS 平台,你可以直接使用我编译好的可执行程序: - 屏幕录制 - 截图 - 无线连接 -- 多设备连接与群控 +- 多设备连接与批量操作 - 全屏显示 - 窗口置顶 - 安装 apk:拖拽apk到显示窗口即可安装 diff --git a/config/config.ini b/config/config.ini index 87949f4d1..df5b23583 100644 --- a/config/config.ini +++ b/config/config.ini @@ -10,7 +10,7 @@ RenderExpiredFrames=0 # 视频解码方式:-1 自动,0 软解,1 dx硬解,2 opengl硬解 UseDesktopOpenGL=-1 # scrcpy-server的版本号(不要修改) -ServerVersion=1.24 +ServerVersion=2.1.1 # scrcpy-server推送到安卓设备的路径 ServerPath=/data/local/tmp/scrcpy-server.jar # 自定义adb路径,例如D:/android/tools/adb.exe diff --git a/docs/image/quickmirror.png b/docs/image/quickmirror.png new file mode 100644 index 000000000..2e5b5636d Binary files /dev/null and b/docs/image/quickmirror.png differ