1
# $Id: lesstif-0.82.patch,v 1.2 1999/08/19 11:30:11 andreas Exp $
3
This file contains a variety of patches for lesstif-0.82. We suggest
4
that these patches be applied (using `patch -l < lesstif-0.82.patch')
5
before building LessTif and running DDD with LessTif.
8
From zeller Fri Nov 21 19:33:36 1997
9
Subject: Modifier mapping trouble in LessTif 0.82, and a patch
10
To: lesstif@hungry.com (LessTif Mailing List)
11
Date: Fri, 21 Nov 1997 19:33:36 +0100 (MET)
12
Cc: bug-ddd@gnu.org (DDD Maintainers)
13
X-Organization: TU Braunschweig, Abt. Softwaretechnologie
14
X-Postal-Address: Bueltenweg 88, D-38092 Braunschweig, Germany
15
X-Telephone: +49 531 391-7580
16
X-Fax: +49 531 391-8140
17
X-URL: http://www.cs.tu-bs.de/~zeller/
18
X-FTP: ftp://ftp.ips.cs.tu-bs.de/pub/local/softech/
19
X-Mailer: ELM [version 2.4 PL25]
26
Here's a bug report for LessTif 0.82.
32
I run an application (DDD) with accelerators bound to `Meta<Key>X'.
33
With OSF/Motif, Alt+X invokes the `Meta<Key>X' accelerator, and `X'
34
without modifiers acts like `X'. With LessTif, this is reversed: I
35
was astonished to find that pressing `X' alone already invokes the
36
accelerator and pressing Alt+X acts like `X' alone.
42
LessTif implements a modifier mapping different from OSF/Motif.
43
The LessTif model is superior to the OSF/Motif model because it allows
44
applications to distinguish between `Alt' and `Meta' modifiers, and it
45
allows people to bind `Alt' and `Meta' to individual Keysyms. In
46
OSF/Motif, at least `Alt' is hard-wired to the Mod1 modifier; I don't
47
know about `Meta' treatment, but it might be hard-wired too.
49
The problem in my case was that the `Meta' modifier is not bound to
50
*any* particular keysym (no `Meta' on my keyboard, only `Alt'), and
51
LessTif fails to recognize this.
57
In `MapEvent.c', the function `_XmMapKeyEvent' determines accelerator
58
events. Here, we find a line that binds modifier keysyms to modifier masks.
61
if (evs->event.lateModifiers)
63
switch (evs->event.lateModifiers->keysym)
67
evs->event.modifiers |= GET_MODIFIER(METAModifier);
71
The problem is that GET_MODIFIER(METAmodifier) returns `0' for a
72
non-existing modifier binding, and this special situation is not
73
handled by LessTif. This results in an accelerator being installed
74
for a key with _no_ modifiers, instead of no accelerator being
81
The LessTif code should be changed such that:
83
1. If a modifier is not bound to a particular keysym, the appropriate
84
accelerator should not be installed. A diagnostic might be issued.
85
2. If `Alt' or `Meta' are not bound to a particular keysym, LessTif
86
should use `Mod1' as default, to simulate the OSF/Motif behaviour.
92
Here's a patch that realizes the consequences.
94
--- lesstif-0.82/lib/Xm/MapEvent.c.orig Fri Nov 21 18:35:52 1997
95
+++ lesstif-0.82/lib/Xm/MapEvent.c Fri Nov 21 19:07:40 1997
96
@@ -1819,7 +1819,72 @@
97
CompileNameValueTable( mappingNotify );
100
-#define GET_MODIFIER(m_idx) mods[m_idx]
103
+ * SetLateModifier -- set up the modifier masks for ALT, META, SUPER,
104
+ * and HYPER modifier keys. If the modifier is not bound to a
105
+ * particular KeySym, return False; upon success, return True.
107
+ * For compatibility with the closed software foundation, we treat META
108
+ * and ALT as synonyms of Mod1 if not bound to a particular keysym.
111
+SetLateModifier(Display *display, EventSeqPtr evs)
113
+ if (evs->event.lateModifiers)
115
+ unsigned long mask = 0;
116
+ XmModifierMaskSetReference mods;
118
+ mods = _XmGetModifierMappingsForDisplay(display);
120
+ switch (evs->event.lateModifiers->keysym)
124
+ mask = mods[METAModifier];
131
+ mask = mods[ALTModifier];
138
+ mask = mods[SUPERModifier];
143
+ mask = mods[HYPERModifier];
147
+ _XmWarning(NULL, "Unknown modifier.\n");
153
+ /* There is no keysym associated with this modifier. */
154
+ /* Should we issue a warning here? -- FIXME */
159
+ evs->event.modifiers |= mask;
169
_XmMapBtnEvent(String str, int *eventType,
170
@@ -1827,8 +1892,6 @@
172
EventSeqPtr evs = NULL;
174
- XmModifierMaskSetReference mods =
175
- _XmGetModifierMappingsForDisplay(_XmGetDefaultDisplay());
179
@@ -1848,29 +1911,12 @@
180
_XmWarning(NULL, "Multiple event sequence ignored.\n");
183
- if (evs->event.lateModifiers)
184
+ err = SetLateModifier(_XmGetDefaultDisplay(), evs);
187
- switch (evs->event.lateModifiers->keysym)
191
- evs->event.modifiers |= GET_MODIFIER(METAModifier);
196
- evs->event.modifiers |= GET_MODIFIER(ALTModifier);
201
- evs->event.modifiers |= GET_MODIFIER(SUPERModifier);
207
- evs->event.modifiers |= GET_MODIFIER(HYPERModifier);
213
@@ -1899,8 +1945,6 @@
215
EventSeqPtr evs = NULL;
217
- XmModifierMaskSetReference mods =
218
- _XmGetModifierMappingsForDisplay(_XmGetDefaultDisplay());
222
@@ -1920,29 +1964,12 @@
223
_XmWarning(NULL, "Multiple event sequence ignored.\n");
226
- if (evs->event.lateModifiers)
227
+ err = SetLateModifier(_XmGetDefaultDisplay(), evs);
230
- switch (evs->event.lateModifiers->keysym)
234
- evs->event.modifiers |= GET_MODIFIER(METAModifier);
239
- evs->event.modifiers |= GET_MODIFIER(ALTModifier);
244
- evs->event.modifiers |= GET_MODIFIER(SUPERModifier);
250
- evs->event.modifiers |= GET_MODIFIER(HYPERModifier);
257
Andreas Zeller Technische Universitaet Braunschweig, Germany
258
mailto:zeller@acm.org http://www.cs.tu-bs.de/~zeller/
260
From zeller Fri Nov 21 19:42:35 1997
261
Date: Fri, 21 Nov 97 19:42:35 XXX
262
From: Andreas Zeller <zeller@gnu.org>
264
Content-Type: multipart/mixed; boundary="D0Fi1SCUe6"
265
Content-Transfer-Encoding: 7bit
266
To: DDD Maintainers <bug-ddd@gnu.org>
267
Subject: RE: Modifier mapping trouble in LessTif 0.82, and a patch
268
X-Mailer: VM 6.34 under 20.3 "Chisinau" XEmacs Lucid
273
Content-Type: text/plain; charset=us-ascii
274
Content-Transfer-Encoding: 7bit
276
Miers, Mitch <mlm@dsc.com> says:
280
Content-Type: message/rfc822
281
Content-Transfer-Encoding: 7bit
283
Received: from gypsum.dsc.com (gypsum.dsc.com [192.146.147.185]) by infbssys.ips.cs.tu-bs.de with SMTP id UAA03525
284
(8.8.7/IDA-1.6 for <zeller@gnu.org>); Fri, 21 Nov 1997 20:39:12 +0100
285
Received: by gypsum.dsc.com with SMTP (Microsoft Exchange Server Internet Mail Connector Version 4.0.995.52)
286
id <01BCF672.1EDA7830@gypsum.dsc.com>; Fri, 21 Nov 1997 11:39:26 -0800
287
Message-ID: <c=US%a=_%p=DSC%l=GYPSUM-971121193924Z-41804@gypsum.dsc.com>
288
X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.995.52
290
Content-Type: text/plain; charset="us-ascii"
291
From: "Miers, Mitch" <mlm@dsc.com>
292
To: "'lesstif@Hungry.COM'" <lesstif@Hungry.COM>,
295
Subject: RE: Modifier mapping trouble in LessTif 0.82, and a patch
296
Date: Fri, 21 Nov 1997 11:39:24 -0800
299
Nice patch. It never occurred to me that this would be a problem:(
304
>I run an application (DDD) with accelerators bound to `Meta<Key>X'.
305
>With OSF/Motif, Alt+X invokes the `Meta<Key>X' accelerator, and `X'
306
>without modifiers acts like `X'. With LessTif, this is reversed: I
307
>was astonished to find that pressing `X' alone already invokes the
308
>accelerator and pressing Alt+X acts like `X' alone.
310
>Andreas Zeller Technische Universitaet Braunschweig, Germany
311
> mailto:zeller@acm.org http://www.cs.tu-bs.de/~zeller/
314
Thanks, the patch has been installed. This might also address
315
jdassen@wi.leidenuniv.nl's problem (or maybe not):
317
Unlike DDD [*] 2.1.1, DDD 2.2 (recently released) isn't useable with
319
0.81 and 0.82 under Linux currently: it builds, but its debugger console
320
doesn't respond to keyboard input or menu clicks.
326
Content-Type: text/plain; charset=us-ascii
327
Content-Transfer-Encoding: 7bit
334
From zeller Fri Nov 21 22:53:02 1997
335
Subject: TextOut.c:DrawAll draws too much
336
To: lesstif@hungry.com (LessTif Mailing List)
337
Date: Fri, 21 Nov 1997 22:53:02 +0100 (MET)
338
X-Organization: TU Braunschweig, Abt. Softwaretechnologie
339
X-Postal-Address: Bueltenweg 88, D-38092 Braunschweig, Germany
340
X-Telephone: +49 531 391-7580
341
X-Fax: +49 531 391-8140
342
X-URL: http://www.cs.tu-bs.de/~zeller/
343
X-FTP: ftp://ftp.ips.cs.tu-bs.de/pub/local/softech/
344
X-Mailer: ELM [version 2.4 PL25]
351
The function `TextOut.c::DrawAll' in LessTif 0.82 draws too many
352
lines. The main loop goes from 0 to Out_Rows(o), which is the number
353
of lines shown; the actual text may have less lines. When accessing
354
the non-existent bogus lines, various effects can be observed.
358
--- lesstif-0.82/lib/Xm/TextOut.c.orig Fri Nov 21 22:42:33 1997
359
+++ lesstif-0.82/lib/Xm/TextOut.c Fri Nov 21 22:43:19 1997
364
- for (i = 0; i < Out_Rows(o) /*Text_LineCount(w)*/; i++)
365
+ for (i = 0; i < (Text_LineCount(w) < Out_Rows(o) ?
366
+ Text_LineCount(w) : Out_Rows(o)); i++)
368
Line line = &Text_Line(w)[i];
369
Line next = &Text_Line(w)[i + 1];
372
Andreas Zeller Technische Universitaet Braunschweig, Germany
373
mailto:zeller@acm.org http://www.cs.tu-bs.de/~zeller/
375
From zeller Sat Nov 22 01:18:57 1997
376
Subject: XmTextXYToPos() is broken in LessTif 0.82, and a patch
377
To: lesstif@hungry.com (LessTif Mailing List)
378
Date: Sat, 22 Nov 1997 01:18:57 +0100 (MET)
379
X-Organization: TU Braunschweig, Abt. Softwaretechnologie
380
X-Postal-Address: Bueltenweg 88, D-38092 Braunschweig, Germany
381
X-Telephone: +49 531 391-7580
382
X-Fax: +49 531 391-8140
383
X-URL: http://www.cs.tu-bs.de/~zeller/
384
X-FTP: ftp://ftp.ips.cs.tu-bs.de/pub/local/softech/
385
X-Mailer: ELM [version 2.4 PL25]
395
In LessTif 0.82, the function XmTextXYToPos() frequently returns bogus
396
positions - the positions returned is the position of the first
397
character in the line.
402
The problem is due to an incomplete implementation in
403
TextOut.c:XToPos(). The function references a `Line' member
404
`past_end'; if `past_end' is non-zero, the function always returns the
405
first position of the line. However, `past_end' member are never
406
initialized in the current LessTif version.
411
The following patch fixes the problem.
413
--- lesstif-0.82/lib/Xm/TextOut.c.orig Fri Nov 21 22:42:33 1997
414
+++ lesstif-0.82/lib/Xm/TextOut.c Sat Nov 22 01:06:47 1997
417
end = Text_LastPos(w); /* Avoid PASTENDPOS */
419
- else if (next->past_end) /* There's nothing there ... */
421
- end = start; /* FIXME - this is probably wrong */
425
end = next->start - 1;
428
ALTERNATIVE SOLUTION:
430
Initialize `past_end' values to something meaningful.
433
Andreas Zeller Technische Universitaet Braunschweig, Germany
434
mailto:zeller@acm.org http://www.cs.tu-bs.de/~zeller/
436
From zeller Wed Dec 3 10:05:25 1997
437
Date: Wed, 3 Dec 97 10:05:25 XXX
438
From: Andreas Zeller <zeller@gnu.org>
440
Content-Type: text/plain; charset=us-ascii
441
Content-Transfer-Encoding: 7bit
442
To: LessTif Mailing List <lesstif@hungry.com>
443
Subject: XmStringGetNextComponent returns bad values, and a fix
444
X-Mailer: VM 6.34 under 20.3 "Vatican City" XEmacs Lucid
449
In LessTif 0.82, XmStringGetNextComponent() returns TAG values in the
450
TEXT parameter, and vice versa. Here's a patch:
452
--- lesstif-0.82/lib/Xm/XmString.c.orig Wed Dec 3 10:50:46 1997
453
+++ lesstif-0.82/lib/Xm/XmString.c Wed Dec 3 10:54:34 1997
454
@@ -3567,7 +3567,7 @@
455
case XmSTRING_COMPONENT_CHARSET:
458
- *text = XtNewString(r->data);
459
+ *tag = XtNewString(r->data);
463
@@ -3575,7 +3575,7 @@
464
case XmSTRING_COMPONENT_LOCALE_TEXT:
467
- *tag = XtNewString(r->data);
468
+ *text = XtNewString(r->data);
478
From zeller Wed Dec 3 11:36:36 1997
479
Date: Wed, 3 Dec 97 11:36:36 XXX
480
From: Andreas Zeller <zeller@gnu.org>
482
Content-Type: text/plain; charset=us-ascii
483
Content-Transfer-Encoding: 7bit
484
To: LessTif Mailing List <lesstif@hungry.com>
485
Subject: XmStringPeekNextComponent returns bad value, and a fix
486
X-Mailer: VM 6.34 under 20.3 "Vatican City" XEmacs Lucid
491
In LessTif 0.82, XmStringPeekNextComponent() returns
492
XmSTRING_COMPONENT_UNKNOWN when reading beyond the end of an XmString;
493
however, in this case, XmStringGetNextComponent() returns
494
XmSTRING_COMPONENT_END, and so should XmStringPeekNextComponent().
497
--- lesstif-0.82/lib/Xm/XmString.c.orig Wed Dec 3 10:50:46 1997
498
+++ lesstif-0.82/lib/Xm/XmString.c Wed Dec 3 12:32:18 1997
499
@@ -3619,7 +3619,7 @@
503
- return XmSTRING_COMPONENT_UNKNOWN;
504
+ return XmSTRING_COMPONENT_END;
510
From zeller Wed Dec 3 13:56:53 1997
511
Subject: XmTextInsert does not invoke ValueChanged callback, and a fix
512
To: lesstif@hungry.com (LessTif Mailing List)
513
Date: Wed, 3 Dec 1997 13:56:53 +0100 (MET)
514
X-Organization: TU Braunschweig, Abt. Softwaretechnologie
515
X-Postal-Address: Bueltenweg 88, D-38092 Braunschweig, Germany
516
X-Telephone: +49 531 391-7580
517
X-Fax: +49 531 391-8140
518
X-URL: http://www.cs.tu-bs.de/~zeller/
519
X-FTP: ftp://ftp.ips.cs.tu-bs.de/pub/local/softech/
520
X-Mailer: ELM [version 2.4 PL25]
527
In LessTif 0.82, XmTextInsert() does not invoke
528
XmNvalueChangedCallback, although Motif doc says it does so.
532
--- lesstif-0.82/lib/Xm/Text.c.orig Wed Dec 3 13:53:31 1997
533
+++ lesstif-0.82/lib/Xm/Text.c Wed Dec 3 13:53:36 1997
534
@@ -1459,7 +1459,7 @@
537
st = (*Text_Source(w)->Replace) (tw, evp, &startret, &endret,
545
Andreas Zeller Technische Universitaet Braunschweig, Germany
546
mailto:zeller@acm.org http://www.cs.tu-bs.de/~zeller/
548
From zeller Wed Dec 3 16:02:23 1997
549
Subject: _XmTextNextX() does not handle 8-bit characters, and a patch
550
To: lesstif@hungry.com (LessTif Mailing List)
551
Date: Wed, 3 Dec 1997 16:02:23 +0100 (MET)
552
Cc: bug-ddd@gnu.org (DDD Maintainers)
553
X-Organization: TU Braunschweig, Abt. Softwaretechnologie
554
X-Postal-Address: Bueltenweg 88, D-38092 Braunschweig, Germany
555
X-Telephone: +49 531 391-7580
556
X-Fax: +49 531 391-8140
557
X-URL: http://www.cs.tu-bs.de/~zeller/
558
X-FTP: ftp://ftp.ips.cs.tu-bs.de/pub/local/softech/
559
X-Mailer: ELM [version 2.4 PL25]
566
In LessTif 0.82, the function _XmTextNextX() in TextOut.c returns bad
567
values for characters outside the range 0..127. In the Text widget,
568
this results in forced line wraps at non-ASCII characters.
572
--- lesstif-0.82/lib/Xm/TextOut.c.orig Fri Nov 21 22:42:33 1997
573
+++ lesstif-0.82/lib/Xm/TextOut.c Wed Dec 3 15:56:55 1997
582
+ c = (unsigned char)*ptr;
585
x = Out_NextTabStop(o, x);
590
Andreas Zeller Technische Universitaet Braunschweig, Germany
591
mailto:zeller@acm.org http://www.cs.tu-bs.de/~zeller/