void ComputeAnchors(Anchor anchor, SizeAnchor sizeAnchor, int *ox, int *oy, int *ow, int *oh)
{
Window parent = this.parent ? this.parent : guiApp.desktop;
+ int xOffset = 0, yOffset = 0;
int vpw = parent ? parent.clientSize.w : 0;
int vph = parent ? parent.clientSize.h : 0;
int pw = parent ? parent.clientSize.w : 0;
}
// This is required to get proper initial decoration size using native decorations on Windows
+#if defined(__WIN32__)
if(nativeDecorations && windowHandle && guiApp && guiApp.interfaceDriver && !visible)
guiApp.interfaceDriver.PositionRootWindow(this, x, y, Max(1, size.w), Max(1, size.h), true, true);
+#endif
GetDecorationsSize(&ew, &eh);
if(anchor.left.type >= cascade && (state == normal /*|| state == Hidden*/))
{
+ // Leave room for non client windows (eventually dockable panels)
+ Window win;
+ int loX = 0, loY = 0, hiX = pw, hiY = ph;
+ for(win = parent.children.first; win; win = win.next)
+ {
+ if(!win.isActiveClient && win.visible)
+ {
+ Size size = win.size;
+ Point pos = win.position;
+ int left = pos.x, top = pos.y;
+ int right = pos.x + size.w, bottom = pos.y + size.h;
+ if(win.size.w > win.size.h)
+ {
+ if(bottom < ph / 4)
+ loY = Max(loY, bottom);
+ else if(top > ph - ph / 4)
+ hiY = Min(hiY, top);
+ }
+ else
+ {
+ if(right < pw / 4)
+ loX = Max(loX, right);
+ else if(left > pw - pw / 4)
+ hiX = Min(hiX, left);
+ }
+ }
+ }
+ xOffset = loX;
+ yOffset = loY;
+ pw = hiX - loX;
+ ph = hiY - loY;
+
if(parent.sbv && !parent.sbv.style.hidden)
pw += guiApp.currentSkin.VerticalSBW();
if(parent.sbh && !parent.sbh.style.hidden)
if(positionID >= tilingSplit)
{
- x = pw * (tilingSplit / tilingH + (positionID - tilingSplit) / tilingLastH)/tilingW;
- y = ph * ((positionID - tilingSplit) % tilingLastH) / tilingLastH;
- x2 = pw * (tilingSplit/tilingH + (positionID - tilingSplit) / tilingLastH + 1)/tilingW;
- y2 = ph * (((positionID - tilingSplit) % tilingLastH) + 1) / tilingLastH;
+ x = xOffset + pw * (tilingSplit / tilingH + (positionID - tilingSplit) / tilingLastH)/tilingW;
+ y = yOffset + ph * ((positionID - tilingSplit) % tilingLastH) / tilingLastH;
+ x2 = xOffset + pw * (tilingSplit/tilingH + (positionID - tilingSplit) / tilingLastH + 1)/tilingW;
+ y2 = yOffset + ph * (((positionID - tilingSplit) % tilingLastH) + 1) / tilingLastH;
}
else
{
- x = pw * (positionID / tilingH) / tilingW;
- y = ph * (positionID % tilingH) / tilingH;
- x2 = pw * (positionID / tilingH + 1) / tilingW;
- y2 = ph * ((positionID % tilingH) + 1) / tilingH;
+ x = xOffset + pw * (positionID / tilingH) / tilingW;
+ y = yOffset + ph * (positionID % tilingH) / tilingH;
+ x2 = xOffset + pw * (positionID / tilingH + 1) / tilingW;
+ y2 = yOffset + ph * ((positionID % tilingH) + 1) / tilingH;
}
if(guiApp.textMode)
{
cascadeH = (float)(ph - h) / (numCascade-1);
}
- x = (int)((positionID % numCascade) * cascadeW);
- y = (int)((positionID % numCascade) * cascadeH);
+ x = (int)((positionID % numCascade) * cascadeW) + xOffset;
+ y = (int)((positionID % numCascade) * cascadeH) + yOffset;
}
else if(anchor.left.type < vTiled)
{
Point scroll = this.scroll;
if(state == maximized)
+ {
parent = GetParentMenuBar();
+ if(!parent && nativeDecorations)
+ parent = rootWindow;
+ }
if(parent)
{
if(!opaque)
{
// Adjust renderArea to the root window level
- Extent * renderArea = &rootWindow.tempExtents[1];
+ Extent * renderArea = &rootWindow.tempExtents[3];
- int offsetX = child.absPosition.x - rootWindow.absPosition.x, offsetY = child.absPosition.y - rootWindow.absPosition.y;
+ int offsetX = child.absPosition.x - rootWindow.absPosition.x;
+ int offsetY = child.absPosition.y - rootWindow.absPosition.y;
if(child.rootWindow.nativeDecorations && rootWindow.windowHandle)
{
offsetX -= child.rootWindow.clientStart.x;
*/
renderArea->Copy(child.dirtyArea /*childRenderArea*/);
+
+ // This intersection with child clip extent was missing and causing #708 (Installer components list scrolling bug):
+ renderArea->Intersection(child.clipExtent, rootWindow.tempExtents[0], rootWindow.tempExtents[1], rootWindow.tempExtents[2]);
+
renderArea->Offset(offsetX, offsetY);
+
dirtyExtent.Union(renderArea, rootWindow.tempExtents[0]);
// overDirtyExtent.Union(renderArea);
renderArea->Empty();
}
}
}
+
+ if(last && last != this && this.IsDescendantOf(last)) // Fix for installer lockup
+ result = null;
}
}
}
guiApp.prevWindow = null;
// Eventually fix this not to include captured?
- if(!prevWindow.OnMouseLeave(*mods))
+ if(!trueWindow.IsDescendantOf(prevWindow) && !prevWindow.OnMouseLeave(*mods))
result = false;
}
if(result && trueWindow && !trueWindow.destroyed/* && trueWindow == window*/)
if(prevActiveWindow) incref prevActiveWindow;
incref hotKeyWindow;
- if(method == __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyDown && !hotKeyWindow.style.nonClient)
+ if(method == __ecereVMethodID___ecereNameSpace__ecere__gui__Window_OnKeyDown && !hotKeyWindow.style.nonClient && !hotKeyWindow.inactive)
if(!hotKeyWindow.ActivateEx(true, true, false, true, null, null))
{
status = false;
return false;
}
virtual void UpdateNonClient();
- virtual void SetBox(Box box);
+ virtual void SetBox(Box box); // This isn't used anywhere at this time
virtual bool IsInside(int x, int y)
{
return box.IsPointInside({x, y});