From eab8f70a9c4d1e271f6524f8b417ba0c0928d24d Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 1 Jan 1997 10:13:19 +0000 Subject: [PATCH] Simplify code that changes a window's size. Both the old and new code produces incorrect results on my machine. This seems to be an OS/2 bug, as it consistently adds too much padding to the frame window's header height. --- v7/src/microcode/os2pm.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/v7/src/microcode/os2pm.c b/v7/src/microcode/os2pm.c index 2d7235728..c1367449e 100644 --- a/v7/src/microcode/os2pm.c +++ b/v7/src/microcode/os2pm.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: os2pm.c,v 1.28 1996/03/20 23:50:18 cph Exp $ +$Id: os2pm.c,v 1.29 1997/01/01 10:13:19 cph Exp $ -Copyright (c) 1994-96 Massachusetts Institute of Technology +Copyright (c) 1994-97 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -1320,19 +1320,14 @@ static void window_set_size (window_t * window, unsigned short width, unsigned short height) { - SWP swp; - POINTL ptl; RECTL rcl; - if (!WinQueryWindowPos ((WINDOW_CLIENT (window)), (& swp))) - window_error (WinQueryWindowPos); - (ptl . x) = (swp . x); - (ptl . y) = (swp . y); - if (!WinMapWindowPoints ((WINDOW_FRAME (window)), HWND_DESKTOP, (& ptl), 1)) + (rcl . xLeft) = 0; + (rcl . xRight) = width; + (rcl . yBottom) = 0; + (rcl . yTop) = height; + if (!WinMapWindowPoints ((WINDOW_CLIENT (window)), HWND_DESKTOP, + ((PPOINTL) (& rcl)), 2)) window_error (WinMapWindowPoints); - (rcl . xLeft) = (ptl . x); - (rcl . xRight) = ((ptl . x) + width); - (rcl . yBottom) = (ptl . y); - (rcl . yTop) = ((ptl . y) + height); if (!WinCalcFrameRect ((WINDOW_FRAME (window)), (& rcl), FALSE)) window_error (WinCalcFrameRect); if (!WinSetWindowPos ((WINDOW_FRAME (window)), -- 2.25.1