This commit is contained in:
zhuzichu 2023-12-22 18:07:46 +08:00
parent d817782526
commit 2cfc73c00b
3 changed files with 17 additions and 24 deletions

View File

@ -73,22 +73,11 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
return false;
}
const UINT uMsg = msg->message;
const WPARAM wParam = msg->wParam;
const LPARAM lParam = msg->lParam;
if (!msg || !hwnd)
{
return false;
}
if(uMsg == WM_WINDOWPOSCHANGING){
WINDOWPOS* wp = reinterpret_cast<WINDOWPOS*>(lParam);
if (wp != nullptr && (wp->flags & SWP_NOSIZE) == 0)
{
wp->flags |= SWP_NOCOPYBITS;
*result = DefWindowProc(hwnd, uMsg, wParam, lParam);
return true;
}
return false;
}else if(uMsg == WM_NCCALCSIZE){
if(uMsg == WM_NCCALCSIZE){
*result = WVR_REDRAW;
return true;
}else if(uMsg == WM_NCPAINT){

View File

@ -179,7 +179,7 @@ Window {
if(window.visibility === Window.Maximized){
var dx = window.x-Screen.virtualX
if(dx<0){
return Math.abs(dx)
return Math.abs(dx+1)
}
}
return 0
@ -188,7 +188,7 @@ Window {
if(window.visibility === Window.Maximized){
var dy = window.y-Screen.virtualY
if(dy<0){
return Math.abs(dy)
return Math.abs(dy+1)
}
}
return 0
@ -290,10 +290,12 @@ Window {
function moveWindowToDesktopCenter(){
screen = Qt.application.screens[FluTools.cursorScreenIndex()]
window.setGeometry((Screen.width-window.width)/2+Screen.virtualX,(Screen.height-window.height)/2+Screen.virtualY,window.width,window.height)
maximumWidth = fixSize ? width : 16777215
maximumHeight = fixSize ? height : 16777215
minimumWidth = fixSize ? width : 0
minimumHeight = fixSize ? height : 0
if(fixSize){
maximumWidth = width
maximumHeight = height
minimumWidth = width
minimumHeight = height
}
}
function onResult(data){
if(_pageRegister){

View File

@ -178,7 +178,7 @@ Window {
if(window.visibility === Window.Maximized){
var dx = window.x-Screen.virtualX
if(dx<0){
return Math.abs(dx)
return Math.abs(dx+1)
}
}
return 0
@ -187,7 +187,7 @@ Window {
if(window.visibility === Window.Maximized){
var dy = window.y-Screen.virtualY
if(dy<0){
return Math.abs(dy)
return Math.abs(dy+1)
}
}
return 0
@ -289,10 +289,12 @@ Window {
function moveWindowToDesktopCenter(){
screen = Qt.application.screens[FluTools.cursorScreenIndex()]
window.setGeometry((Screen.width-window.width)/2+Screen.virtualX,(Screen.height-window.height)/2+Screen.virtualY,window.width,window.height)
maximumWidth = fixSize ? width : 16777215
maximumHeight = fixSize ? height : 16777215
minimumWidth = fixSize ? width : 0
minimumHeight = fixSize ? height : 0
if(fixSize){
maximumWidth = width
maximumHeight = height
minimumWidth = width
minimumHeight = height
}
}
function onResult(data){
if(_pageRegister){