projects
/
xboard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
9a638d9
)
Fix vscrolling in XBoard Engine-Output window
author
H.G. Muller
<h.g.muller@hccnet.nl>
Sun, 8 May 2011 11:53:09 +0000 (13:53 +0200)
committer
H.G. Muller
<h.g.muller@hccnet.nl>
Mon, 9 May 2011 10:27:33 +0000 (12:27 +0200)
After clicking the memos they scrolled to the bottom, because SetFocus
put the insertion point at the very end of the text. This behavior is
now reserved for text-edits containing less than 100 characters.
xoptions.c
patch
|
blob
|
history
diff --git
a/xoptions.c
b/xoptions.c
index
055d804
..
e66e4bc
100644
(file)
--- a/
xoptions.c
+++ b/
xoptions.c
@@
-88,6
+88,7
@@
void SetFocus(Widget w, XtPointer data, XEvent *event, Boolean *b)
{
Arg args[2];
char *s;
+ int j;
if(previous) {
XtSetArg(args[0], XtNdisplayCaret, False);
@@
-95,9
+96,10
@@
void SetFocus(Widget w, XtPointer data, XEvent *event, Boolean *b)
}
XtSetArg(args[0], XtNstring, &s);
XtGetValues(w, args, 1);
+ j = 1;
XtSetArg(args[0], XtNdisplayCaret, True);
- XtSetArg(args[1], XtNinsertPosition, strlen(s));
- XtSetValues(w, args, 2);
+ if(!strchr(s, '\n')) XtSetArg(args[1], XtNinsertPosition, strlen(s)), j++;
+ XtSetValues(w, args, j);
XtSetKeyboardFocus((Widget) data, w);
previous = w;
}