@@ -1604,6 +1604,13 @@ static void ReplaceDocumentInCurrentTab(LoadArgs* args, DocController* ctrl, Fil
16041604 }
16051605 if (args->showWin ) {
16061606 ShowWindow (win->hwndFrame , showType);
1607+ if (IsRunningOnWine ()) {
1608+ Rect wr = WindowRect (win->hwndFrame );
1609+ Rect cr = ClientRect (win->hwndFrame );
1610+ logf (" LoadDocument: showWin windowRect=(%d,%d,%d,%d) clientRect=(%d,%d,%d,%d) captionRect=(%d,%d,%d,%d)\n " ,
1611+ wr.x , wr.y , wr.dx , wr.dy , cr.x , cr.y , cr.dx , cr.dy , win->captionRect .x , win->captionRect .y ,
1612+ win->captionRect .dx , win->captionRect .dy );
1613+ }
16071614 }
16081615
16091616#if 0
@@ -2007,6 +2014,14 @@ void ShowMainWindow(MainWindow* win, int windowState) {
20072014 UpdateToolbarFindText (win);
20082015 HwndEnsureVisible (win->hwndFrame );
20092016
2017+ if (IsRunningOnWine ()) {
2018+ Rect wr = WindowRect (win->hwndFrame );
2019+ Rect cr = ClientRect (win->hwndFrame );
2020+ logf (" ShowMainWindow: windowRect=(%d,%d,%d,%d) clientRect=(%d,%d,%d,%d) captionRect=(%d,%d,%d,%d)\n " , wr.x ,
2021+ wr.y , wr.dx , wr.dy , cr.x , cr.y , cr.dx , cr.dy , win->captionRect .x , win->captionRect .y , win->captionRect .dx ,
2022+ win->captionRect .dy );
2023+ }
2024+
20102025 if (gWindows .Size () == 1 && (true || IsDebuggerPresent ())) {
20112026 HwndToForeground (win->hwndFrame );
20122027 }
@@ -4410,13 +4425,22 @@ static void RelayoutFrame(MainWindow* win, bool updateToolbars, int sidebarDx) {
44104425 captionHeight = menuBarDy + (hasFileTabs ? tabHeight : 0 );
44114426 }
44124427 win->captionRect = {rc.x , rc.y , rc.dx , captionHeight};
4428+ if (IsRunningOnWine ()) {
4429+ logf (" RelayoutFrame: tabsInTitlebar tabHeight=%d captionHeight=%d captionRect=(%d,%d,%d,%d) "
4430+ " showingMenuBar=%d\n " ,
4431+ tabHeight, captionHeight, win->captionRect .x , win->captionRect .y , win->captionRect .dx ,
4432+ win->captionRect .dy , (int )showingMenuBar);
4433+ }
44134434 if (updateToolbars) {
44144435 RelayoutCaption (win);
44154436 }
44164437 rc.y += captionHeight;
44174438 rc.dy -= captionHeight;
44184439 } else if (win->tabsVisible ) {
44194440 int tabHeight = GetTabbarHeight (win->hwndFrame );
4441+ if (IsRunningOnWine ()) {
4442+ logf (" RelayoutFrame: tabsVisible tabHeight=%d\n " , tabHeight);
4443+ }
44204444 if (updateToolbars) {
44214445 int tabX = MapChildXForRtlParent (win->hwndFrame , rc.x , rc.dx );
44224446 dh.SetWindowPos (win->tabsCtrl ->hwnd , nullptr , tabX, rc.y , rc.dx , tabHeight, SWP_NOZORDER );
@@ -8049,6 +8073,10 @@ void RelayoutCaption(MainWindow* win) {
80498073 bool showingMenuBar = IsShowingMenuBarRebar (win);
80508074 int tabHeight = GetTabbarHeight (win->hwndFrame );
80518075 bool isRtl = IsUIRtl ();
8076+ if (IsRunningOnWine ()) {
8077+ logf (" RelayoutCaption: captionRect=(%d,%d,%d,%d) tabHeight=%d showingMenuBar=%d maximized=%d\n " , rc.x , rc.y ,
8078+ rc.dx , rc.dy , tabHeight, (int )showingMenuBar, (int )maximized);
8079+ }
80528080
80538081 if (showingMenuBar) {
80548082 // Two-row layout:
@@ -8249,6 +8277,9 @@ void RelayoutCaption(MainWindow* win) {
82498277 int tabBarX = MapChildXForRtlParent (win->hwndFrame , tabsX, tabsDx);
82508278 dh.SetWindowPos (win->tabsCtrl ->hwnd , nullptr , tabBarX, tabY, tabsDx, tabDy, SWP_NOZORDER );
82518279 dh.End ();
8280+ if (IsRunningOnWine ()) {
8281+ logf (" RelayoutCaption: singleRow btnDy=%d tabY=%d tabDy=%d tabsDx=%d\n " , btnDy, tabY, tabDy, tabsDx);
8282+ }
82528283 }
82538284
82548285 UpdateTabWidth (win);
@@ -8510,6 +8541,10 @@ static LRESULT CustomCaptionFrameProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
85108541
85118542 case WM_NCCALCSIZE : {
85128543 RECT * r = wp == TRUE ? &((NCCALCSIZE_PARAMS *)lp)->rgrc [0 ] : (RECT *)lp;
8544+ if (IsRunningOnWine ()) {
8545+ logf (" WM_NCCALCSIZE: before=(%ld,%ld,%ld,%ld) zoomed=%d\n " , r->left , r->top , r->right , r->bottom ,
8546+ (int )IsZoomed (hwnd));
8547+ }
85138548 bool isFullScreen = win->isFullScreen || win->presentation ;
85148549 if (IsZoomed (hwnd) && !isFullScreen) {
85158550 int frameX = GetSystemMetrics (SM_CXFRAME ) + GetSystemMetrics (SM_CXPADDEDBORDER );
@@ -8524,6 +8559,11 @@ static LRESULT CustomCaptionFrameProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
85248559 // during resize (returning 0 makes DWM clear the surface)
85258560 r->top += 1 ;
85268561 }
8562+ if (IsRunningOnWine ()) {
8563+ logf (" WM_NCCALCSIZE: after=(%ld,%ld,%ld,%ld) clientDy=%ld cyFrame=%d cyCaption=%d\n " , r->left , r->top ,
8564+ r->right , r->bottom , r->bottom - r->top , GetSystemMetrics (SM_CYFRAME ),
8565+ GetSystemMetrics (SM_CYCAPTION ));
8566+ }
85278567 *callDef = false ;
85288568 return 0 ;
85298569 }
0 commit comments