main
朱子楚\zhuzi 2023-03-28 22:41:43 +08:00
parent 2e31ab902d
commit 38f4ae92db
1 changed files with 11 additions and 0 deletions

View File

@ -11,6 +11,14 @@
#pragma comment(lib, "Dwmapi.lib") #pragma comment(lib, "Dwmapi.lib")
#pragma comment(lib, "User32.lib") #pragma comment(lib, "User32.lib")
static bool isCompositionEnabled()
{
BOOL composition_enabled = FALSE;
bool success = ::DwmIsCompositionEnabled(&composition_enabled) == S_OK;
return composition_enabled && success;
}
static bool isMaxWin(QWindow* win) static bool isMaxWin(QWindow* win)
{ {
return win->windowState() == Qt::WindowMaximized; return win->windowState() == Qt::WindowMaximized;
@ -75,6 +83,9 @@ public:
FramelessView::FramelessView(QWindow *parent) : Super(parent), d(new FramelessViewPrivate) FramelessView::FramelessView(QWindow *parent) : Super(parent), d(new FramelessViewPrivate)
{ {
if(!isCompositionEnabled()){
FluTheme::getInstance()->frameless(false);
}
if(FluTheme::getInstance()->frameless()){ if(FluTheme::getInstance()->frameless()){
setFlag(Qt::FramelessWindowHint,true); setFlag(Qt::FramelessWindowHint,true);
} }