From: Chris Hanson Date: Wed, 10 May 1995 21:15:57 +0000 (+0000) Subject: Patch to work around bugs in OS/2 PM API cursor procedures. X-Git-Tag: 20090517-FFI~6323 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=827671709372697e182a6ad14489733bc05a47be;p=mit-scheme.git Patch to work around bugs in OS/2 PM API cursor procedures. --- diff --git a/v7/src/microcode/os2pm.c b/v7/src/microcode/os2pm.c index d9e2aa0e1..0be5fffb0 100644 --- a/v7/src/microcode/os2pm.c +++ b/v7/src/microcode/os2pm.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: os2pm.c,v 1.11 1995/05/07 05:52:34 cph Exp $ +$Id: os2pm.c,v 1.12 1995/05/10 21:15:57 cph Exp $ Copyright (c) 1994-95 Massachusetts Institute of Technology @@ -967,8 +967,8 @@ OS2_initialize_pm_thread (void) #else #define simple_transaction OS2_send_message -#define simple_reply(qid) - +#define simple_reply(qid) \ + \ #endif static void @@ -2569,13 +2569,31 @@ show_window (window_t * window, int showp) window_warning (WinShowWindow); } +/* These two procedures are patches to work around bugs in the OS/2 PM + API. There are sporadic error return codes being generated by + these bugs, and IBM tech support suggested these patches as a + temporary solution. */ + +static void +win_create_cursor (HWND client, LONG x, LONG y, LONG cx, LONG cy, ULONG fs, + PRECTL clip_rectl) +{ + while (!WinCreateCursor (client, x, y, cx, cy, fs, clip_rectl)) + ; +} + +static void +win_show_cursor (HWND client, BOOL showp) +{ + while (!WinShowCursor (client, showp)) + ; +} + static void move_cursor (window_t * window, short x, short y) { if (window_focusp (window)) - if (!WinCreateCursor ((WINDOW_CLIENT (window)), - x, y, 0, 0, CURSOR_SETPOS, 0)) - window_warning (WinCreateCursor); + win_create_cursor ((WINDOW_CLIENT (window)), x, y, 0, 0, CURSOR_SETPOS, 0); } static void @@ -2595,41 +2613,36 @@ show_cursor (window_t * window, int showp) if (showp != 0) showp = 1; if ((window_focusp (window)) && (showp != (WINDOW_CURSOR_SHOWNP (window)))) - if (!WinShowCursor ((WINDOW_CLIENT (window)), showp)) - window_warning (WinShowCursor); + win_show_cursor ((WINDOW_CLIENT (window)), showp); (WINDOW_CURSOR_SHOWNP (window)) = showp; } static void recreate_cursor (window_t * window) { - if (!WinCreateCursor ((WINDOW_CLIENT (window)), - (WINDOW_CURSOR_X (window)), - (WINDOW_CURSOR_Y (window)), - (WINDOW_CURSOR_WIDTH (window)), - (WINDOW_CURSOR_HEIGHT (window)), - (WINDOW_CURSOR_STYLE (window)), - 0)) - window_warning (WinCreateCursor); + win_create_cursor ((WINDOW_CLIENT (window)), + (WINDOW_CURSOR_X (window)), + (WINDOW_CURSOR_Y (window)), + (WINDOW_CURSOR_WIDTH (window)), + (WINDOW_CURSOR_HEIGHT (window)), + (WINDOW_CURSOR_STYLE (window)), + 0); if (WINDOW_CURSOR_SHOWNP (window)) - if (!WinShowCursor ((WINDOW_CLIENT (window)), TRUE)) - window_warning (WinShowCursor); + win_show_cursor ((WINDOW_CLIENT (window)), TRUE); } static void activate_cursor (window_t * window) { if ((WINDOW_CURSOR_SHOWNP (window)) && (window_focusp (window))) - if (!WinShowCursor ((WINDOW_CLIENT (window)), TRUE)) - window_warning (WinShowCursor); + win_show_cursor ((WINDOW_CLIENT (window)), TRUE); } static void deactivate_cursor (window_t * window) { if ((WINDOW_CURSOR_SHOWNP (window)) && (window_focusp (window))) - if (!WinShowCursor ((WINDOW_CLIENT (window)), FALSE)) - window_warning (WinShowCursor); + win_show_cursor ((WINDOW_CLIENT (window)), FALSE); } static void