Compare commits

..

No commits in common. "4dbb68abf6ec3a5014290f7c3bd2775e701514c0" and "993de241cb91e1b4514f035d3ca1e51ad7ad90c4" have entirely different histories.

3 changed files with 18 additions and 20 deletions

View File

@ -30,7 +30,7 @@ static inline bool isCompositionEnabled(){
} }
return composition_enabled; return composition_enabled;
} }
return false; return true;
} }
#endif #endif
@ -81,25 +81,24 @@ bool FramelessEventFilter::nativeEventFilter(const QByteArray &eventType, void *
return true; return true;
} }
int offsetSize = 0; int offsetSize = 0;
bool isMaximum = IsZoomed(hwnd); bool isMax = IsZoomed(hwnd);
offsetXY = QPoint(abs(clientRect->left - originalLeft),abs(clientRect->top - originalTop)); offsetXY = QPoint(abs(clientRect->left - originalLeft),abs(clientRect->top - originalTop));
if(isMaximum){ if(isCompositionEnabled()){
if(isMax){
_helper->setOriginalPos(QPoint(originalLeft,originalTop)); _helper->setOriginalPos(QPoint(originalLeft,originalTop));
offsetSize = 0; offsetSize = 0;
}else{ }else{
_helper->setOriginalPos({}); _helper->setOriginalPos({});
offsetSize = 1; offsetSize = 1;
} }
if(!isCompositionEnabled()){ }else{
offsetSize = 0; offsetSize = 0;
} }
clientRect->top = originalTop+offsetSize; clientRect->top = originalTop+offsetSize;
#if QT_VERSION < QT_VERSION_CHECK(6,0,0) #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
if(!isMaximum){
clientRect->bottom = originalBottom-offsetSize; clientRect->bottom = originalBottom-offsetSize;
clientRect->left = originalLeft+offsetSize; clientRect->left = originalLeft+offsetSize;
clientRect->right = originalRight-offsetSize; clientRect->right = originalRight-offsetSize;
}
#endif #endif
*result = WVR_REDRAW; *result = WVR_REDRAW;
return true; return true;

View File

@ -91,7 +91,7 @@ Window {
var dx = (_originalPos.x - screen.virtualX)/screen.devicePixelRatio var dx = (_originalPos.x - screen.virtualX)/screen.devicePixelRatio
var dy = (_originalPos.y - screen.virtualY)/screen.devicePixelRatio var dy = (_originalPos.y - screen.virtualY)/screen.devicePixelRatio
if(dx<0 && dy<0){ if(dx<0 && dy<0){
_offsetXY = Qt.point(Math.abs(dx)-1,Math.abs(dy)-1) _offsetXY = Qt.point(Math.abs(dx),Math.abs(dy))
}else{ }else{
_offsetXY = Qt.point(0,0) _offsetXY = Qt.point(0,0)
} }
@ -206,13 +206,12 @@ Window {
} }
Item{ Item{
id:layout_container id:layout_container
property bool isMaximum : window.visibility == Window.Maximized
anchors{ anchors{
fill:parent fill:parent
topMargin: _offsetXY.y topMargin: _offsetXY.y
bottomMargin: isMaximum ? 0 : _offsetXY.y bottomMargin: _offsetXY.y
leftMargin: isMaximum ? 0 :_offsetXY.x leftMargin: _offsetXY.x
rightMargin: isMaximum ? 0 : _offsetXY.x rightMargin: _offsetXY.x
} }
onWidthChanged: { onWidthChanged: {
window.appBar.width = width window.appBar.width = width

View File

@ -90,7 +90,7 @@ Window {
var dx = (_originalPos.x - screen.virtualX)/screen.devicePixelRatio var dx = (_originalPos.x - screen.virtualX)/screen.devicePixelRatio
var dy = (_originalPos.y - screen.virtualY)/screen.devicePixelRatio var dy = (_originalPos.y - screen.virtualY)/screen.devicePixelRatio
if(dx<0 && dy<0){ if(dx<0 && dy<0){
_offsetXY = Qt.point(Math.abs(dx)-1,Math.abs(dy)-1) _offsetXY = Qt.point(Math.abs(dx),Math.abs(dy))
}else{ }else{
_offsetXY = Qt.point(0,0) _offsetXY = Qt.point(0,0)
} }