/* -*-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
#else
#define simple_transaction OS2_send_message
-#define simple_reply(qid)
-
+#define simple_reply(qid) \
+ \
#endif
static void
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
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