|
Here is reliable way Jeff Nelson discovered that shows, what we believe
is, the icon bug.
Marshall
From: TLE::JNELSON "Jeff E. Nelson 19-Jul-1990 1325" 19-JUL-1990 13:31:48.14
To: wrksys::woods
CC: JNELSON
Subj: SoftPC X protocol error and another way to reproduce non-repeating keys
Platform: RISC/Ultrix V4.0, DECwindows session manager
SoftPC: dka300:[apps.ultrix.version2risc]spc_july3.40 (For Ultrix 4.0)
Invoking: Either from an entry in the Session Manager Applications menu or from
a DECterm
~/.SoftPC:
HARD_DISK_FILENAME /usr/lib/SoftPC/hard_disk
HARD_DISK_FILENAME2
FLOPPY_DEVICE /dev/PC_floppy
GRAPHICS_ADAPTOR VGA
FILE_DEFAULT_VALUE /tmp/dosprt
PRINTER_DEFAULT_VALUE /dev/doslp
PLOTTER_DEFAULT_VALUE /dev/dosplt
PIPE_DEFAULT_VALUE |lp -or
DATACOMM_DEFAULT_VALUE /dev/dostty
COM_PORT_1_TYPE
COM_PORT_2_TYPE
COM_PORT_1
COM_PORT_2
LPT_PORT_1
LPT_PORT_2
LPT_PORT_1_TYPE
LPT_PORT_2_TYPE
FSA_DIRECTORY /usr/users/jnelson/softpc
EXPANDED_MEMORY_SIZE 0
MEMORY_LIMIT 640
SLAVEPC_PORT /dev/slavepc
AUTO_FREEZE 0
---------------
Note that, in an attempt to search for hidden, unsupported features, I modified
the GRAPHICS_ADAPTOR value to VGA. :-) That's the only change I made to the
otherwise default .SoftPC file. This must be done in order to reproduce the
error.
Reproduce by:
Start SoftPC.
A dialog box appears informing you that the value for the graphics
adaptor is bad and that SoftPC is changing the value to CGA.
Click on "Continue" and then shrink the SoftPC window to an icon.
(If you don't shrink to an icon, the error does not occur and SoftPC
starts normally.)
The following X protocol error occurs:
X Protocol error detected by server: BadMatch - parameter mismatch
Failed request major op code 42 (X_SetInputFocus)
Failed request minor op code 0 (if applicable)
ResourceID 0xd0000c in failed request (if applicable)
Serial number of failed request 656
Current serial number in output stream 659
SoftPC terminates.
Keys no longer repeat! Earlier I reported that I experienced no repeat
in just a text widget, but that it worked OK in a DECterm window. Now,
keys don't repeat *anywhere*, including DECterms.
Key repeatability is restored by fixing the error in the ~/.SoftPC file,
then starting and exiting SoftPC normally.
-Jeff
|
| The proper fix for this is to install an X error handler (XSetErrorHandler)
that ignores the FOCUS match error. Sample code has been posted before,
I don't remember exactly when. It might be in DECWINDOWS_PROGRAMMING.NOTE.
Looks something like:
#include <stdio.h>
#include "decw$xlibmsg.h"
#include <decw$include/DECwDwtWidgetProg.h>
#include <decw$include/XProto.h>
#define BUFSIZ 256
static void ErrorHandler(dpy, event)
Display *dpy;
XErrorEvent *event;
{
char bufA[BUFSIZ];
char msgA[BUFSIZ];
char numberA[32];
char *mtype = "XlibMessage";
/* Ignore soft errors. */
if (
/* Attempted to assign input focus to a window, but that window was
* iconified at the time the server processed the request. */
((event->error_code == BadMatch) &&
(event->request_code == X_SetInputFocus)) ||
/* Attempted to select for ButtonPress on the root window, but
* another application already has selected for it. */
((event->error_code == BadAccess) &&
(event->request_code == X_ChangeWindowAttributes))) return;
XGetErrorText (dpy, event->error_code, bufA, BUFSIZ);
XGetErrorDatabaseText (dpy, mtype, "XError", "X Error", msgA, BUFSIZ);
fprintf (stderr, "%s: %s\n ", msgA, bufA);
XGetErrorDatabaseText (dpy, mtype, "MajorCode", "Request Major code %d",
msgA, BUFSIZ);
fprintf (stderr, msgA, event->request_code);
sprintf (numberA, "%d", event->request_code);
XGetErrorDatabaseText (dpy, "XRequest", numberA, "", bufA, BUFSIZ);
fprintf (stderr, " (%s)", bufA);
fputs ("\n ", stderr);
XGetErrorDatabaseText (dpy, mtype, "MinorCode", "Request Minor code",
msgA, BUFSIZ);
fprintf (stderr, msgA, event->minor_code);
fputs ("\n ", stderr);
XGetErrorDatabaseText (dpy, mtype, "ResourceID", "ResourceID 0x%x",
msgA, BUFSIZ);
fprintf (stderr, msgA, event->resourceid);
fputs ("\n ", stderr);
XGetErrorDatabaseText (dpy, mtype, "ErrorSerial", "Error Serial #%d",
msgA, BUFSIZ);
fprintf (stderr, msgA, event->serial);
fputs ("\n ", stderr);
XGetErrorDatabaseText (dpy, mtype, "CurrentSerial", "Current Serial #%d",
msgA, BUFSIZ);
fprintf (stderr, msgA, dpy->request);
fputs ("\n", stderr);
}
void SpecialSetErrorHandler()
{
XSetErrorHandler (ErrorHandler);
}
|