[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

X-errors



Hi again,

I fixed some errors in the X-functionality of xwpe. Not on all machined
these errors gave problems, but on my machine xwpe was (and is...)
instable. Examples: when xwpe was started without arguments, the menues
would not listen to the mouse. Just two of the items reacted. Furthermore I
could not get any serious response from the keyboard. Tripple pressing
letter 'a' gave a '@'. These errors are now solved and make xwpe more
stable. Below are the results of a night of hacking the code, which you can
add to your sources. To receive modified sources without having to worry
about where to add which modification, send me an e-mail.

Regards,

Arjan






in file we_xterm.c, function e_x_getch()

the returned key is tested against 127 (ASCII delete), and if so, ENTF is
returned.
This creates havoc on MacX X-server. Probably something with MacX, but not
sure.
Other programs do work correctly. I would expect the X-server to send
backspace, not del.

Note: linenumbers in modified sources are off, we added debug code that is
not included
here. The linenumbers in the original are correct. (This Unix variant has
no gnu diff,
so the output is slightly different than I'm used to. I hope it is enough
information).

in we_xterm.c:

A nasty one. The local variable compose is never initialised, which is not
correct.
That it works anyhow on some platforms is pure coincedence, I think.

 diff -C 2 we_xterm.c org/

*** 576,592 ****
      break;
     case KeyPress:
-      //fprintf(stderr, "KeyPress\n");
- /*
-  MLI: composing characters is non-portable, passing NULL makes it work
for us.
-
-  The main problem is that compose is an in-out parameter but is never
initialised.
-  This does /not/ work on MacX and Compaq OSF-1 (formally Digital OSF1)
- */
      charcount = XLookupString(&report.xkey, buffer, BUFSIZE, &keysym,
- #ifdef NON_PORTABLE_P
        &compose);
- #else
-     NULL);
- #endif
      key_b = report.xkey.state;
      if (charcount == 1)
--- 560,565 ----

bash-2.03$ diff -C 2 WeXterm.c WeXterm.c~
*** WeXterm.c	Fri Dec 14 23:14:26 2001
--- WeXterm.c~	Fri Dec 14 20:34:58 2001
***************
*** 33,38 ****
  #ifdef __linux__			/* a.r. */
  #define DEFAULT_ALTMASK Mod1Mask
- #elif defined(__osf__)
- #define DEFAULT_ALTMASK Mod1Mask
  #else
  #define DEFAULT_ALTMASK Mod4Mask
--- 33,36 ----

diff -C 2 we_menue.c org/
*** 442,456 ****
        if((c = e_getch()) == -1)
          c = e_m1_mouse();
-
  #else
        c = e_getch();
  #endif
!       //fprintf(stderr, "gotta key, %d\n", c);
!       //
!       // MLI: Only toupper when printable. May not be perfect, but works
better
!       //
!       if (isprint(c))
!       c = e_toupper(c);
!       //fprintf(stderr, "na toupper, %d\n", c);
      }
      if(c == CDO || c == CtrlN)        /* down -> submenu open */
--- 429,436 ----
        if((c = e_getch()) == -1)
          c = e_m1_mouse();
  #else
        c = e_getch();
  #endif
!       c = e_toupper(c);
      }
      if(c == CDO || c == CtrlN)        /* down -> submenu open */

Arjan van Dijk
Institute for Marine and Atmospheric Research Utrecht
Faculty of Physics and Astronomy
Utrecht University
Princetonplein 5
NL - 3584 CC  Utrecht
The Netherlands

phone: +31 30 2532815
fax:   +31 30 2543163
e-mail: mailto:A.vanDijk@phys.uu.nl
homepage: http://www.phys.uu.nl/~vndijk