-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #701 from barry-ran/dev
sync dev
- Loading branch information
Showing
7 changed files
with
59 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <QDebug> | ||
#include <Windows.h> | ||
#include <dwmapi.h> | ||
#pragma comment(lib, "dwmapi") | ||
|
||
#include "winutils.h" | ||
|
||
enum : WORD | ||
{ | ||
DwmwaUseImmersiveDarkMode = 20, | ||
DwmwaUseImmersiveDarkModeBefore20h1 = 19 | ||
}; | ||
|
||
WinUtils::WinUtils(){}; | ||
|
||
WinUtils::~WinUtils(){}; | ||
|
||
// Set dark border to window | ||
// Reference: qt/qtbase.git/tree/src/plugins/platforms/windows/qwindowswindow.cpp | ||
bool WinUtils::setDarkBorderToWindow(const HWND &hwnd, const bool &d) | ||
{ | ||
const BOOL darkBorder = d ? TRUE : FALSE; | ||
const bool ok = SUCCEEDED(DwmSetWindowAttribute(hwnd, DwmwaUseImmersiveDarkMode, &darkBorder, sizeof(darkBorder))) | ||
|| SUCCEEDED(DwmSetWindowAttribute(hwnd, DwmwaUseImmersiveDarkModeBefore20h1, &darkBorder, sizeof(darkBorder))); | ||
if (!ok) | ||
qWarning("%s: Unable to set dark window border.", __FUNCTION__); | ||
return ok; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#ifndef WINUTILS_H | ||
#define WINUTILS_H | ||
|
||
#include <QApplication> | ||
#include <Windows.h> | ||
|
||
class WinUtils | ||
{ | ||
public: | ||
WinUtils(); | ||
~WinUtils(); | ||
|
||
static bool setDarkBorderToWindow(const HWND &hwnd, const bool &d); | ||
}; | ||
|
||
#endif // WINUTILS_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -248,14 +248,14 @@ All the dependencies are provided and it is easy to compile. | |
#### Non-Arch Linux Users | ||
1. Set up the Qt development environment with the official Qt installer or third-party tools such as [aqt](https://github.com/miurahr/aqtinstall) on the target platform. | ||
Qt version bigger than 5.12 is required. (use MSVC 2019 on Windows) | ||
2. Clone the project with `git clone --recurse-submodules https://barry-ran/QtScrcpy.git` | ||
2. Clone the project with `git clone --recurse-submodules [email protected]:barry-ran/QtScrcpy.git` | ||
3. For Windows, open CMakeLists.txt with QtCreator and compile Release | ||
4. For Linux, directly run `./ci/linux/build_for_linux.sh "Release"` | ||
Note: compiled artifacts are located at `output/x64/Release` | ||
|
||
#### Arch Linux Users | ||
1. Install packages: `base-devel cmake qt5-base qt5-multimedia qt5-x11extras` (`qtcreator` is recommended) | ||
2. Clone the project with `git clone --recurse-submodules https://barry-ran/QtScrcpy.git` | ||
2. Clone the project with `git clone --recurse-submodules [email protected]:barry-ran/QtScrcpy.git` | ||
3. Run `./ci/linux/build_for_linux.sh "Release"` | ||
|
||
### Scrcpy-Server | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters