[PATCH v2] wineconsole: Don't allow resizing while computing positions.

Roman Pišl rpisl at seznam.cz
Sat Mar 14 18:33:10 CDT 2020


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48747
Signed-off-by: Roman Pišl <rpisl at seznam.cz>
---
 programs/wineconsole/user.c         | 5 +++++
 programs/wineconsole/winecon_user.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/programs/wineconsole/user.c b/programs/wineconsole/user.c
index de3f4ae98c..05bb924518 100644
--- a/programs/wineconsole/user.c
+++ b/programs/wineconsole/user.c
@@ -216,6 +216,8 @@ static void	WCUSER_ComputePositions(struct inner_data* data)
     RECT		r;
     int			dx, dy;
 
+    PRIVATE(data)->computing_pos = TRUE;
+
     /* compute window size from desired client size */
     r.left = r.top = 0;
     r.right = data->curcfg.win_width * data->curcfg.cell_width;
@@ -256,6 +258,8 @@ static void	WCUSER_ComputePositions(struct inner_data* data)
                  SWP_NOMOVE|SWP_NOZORDER|SWP_NOACTIVATE);
     WCUSER_ShapeCursor(data, data->curcfg.cursor_size, data->curcfg.cursor_visible, TRUE);
     WCUSER_PosCursor(data);
+
+    PRIVATE(data)->computing_pos = FALSE;
 }
 
 /******************************************************************
@@ -1328,6 +1332,7 @@ static LRESULT CALLBACK WCUSER_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
 	WCUSER_SetMenuDetails(data, GetSystemMenu(data->hWnd, FALSE));
 	break;
     case WM_SIZE:
+        if (PRIVATE(data)->computing_pos) break;
         WINECON_ResizeWithContainer(data, LOWORD(lParam) / data->curcfg.cell_width,
                                     HIWORD(lParam) / data->curcfg.cell_height);
         break;
diff --git a/programs/wineconsole/winecon_user.h b/programs/wineconsole/winecon_user.h
index bd026ef771..cc63a4fd96 100644
--- a/programs/wineconsole/winecon_user.h
+++ b/programs/wineconsole/winecon_user.h
@@ -38,6 +38,7 @@ struct inner_data_user {
     BOOL                has_selection;  /* an area is being selected (selectPt[12] are edges of the rect) */
     COORD		selectPt1;	/* start (and end) point of a mouse selection */
     COORD		selectPt2;
+    BOOL                computing_pos;  /* barrier to avoid resizing while computing positions */
 };
 
 #define PRIVATE(data)   ((struct inner_data_user*)((data)->private))
-- 
2.20.1




More information about the wine-devel mailing list