X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xoptions.c;h=087ee5fb985e20c54eda96df038e7da98869abd6;hb=08a38fdd71f1fae28fb213d4c5f6fb0834967412;hp=d936f06e72ea37ab94a892ec717c031f406fb303;hpb=0cae88bcd346990eea568d27df9efc719fc63d2b;p=xboard.git diff --git a/xoptions.c b/xoptions.c index d936f06..087ee5f 100644 --- a/xoptions.c +++ b/xoptions.c @@ -783,6 +783,7 @@ Option boardOptions[] = { //{ 0, 0, 0, NULL, (void*) &appData.allWhite, "", NULL, CheckBox, N_("Use Outline Pieces for Black") }, { 0, 0, 0, NULL, (void*) &appData.monoMode, "", NULL, CheckBox, N_("Mono Mode") }, { 0,-1, 5, NULL, (void*) &appData.overrideLineGap, "", NULL, Spin, N_("Line Gap ( -1 = default for board size):") }, +{ 0, 0, 0, NULL, (void*) &appData.useBitmaps, "", NULL, CheckBox, N_("Use Board Textures") }, { 0, 0, 0, NULL, (void*) &appData.liteBackTextureFile, ".xpm", NULL, FileName, N_("Light-Squares Texture File:") }, { 0, 0, 0, NULL, (void*) &appData.darkBackTextureFile, ".xpm", NULL, FileName, N_("Dark-Squares Texture File:") }, { 0, 0, 0, NULL, (void*) &appData.bitmapDirectory, "", NULL, PathName, N_("Directory with Bitmap Pieces:") }, @@ -1571,9 +1572,18 @@ void MoveTypeInProc(Widget widget, caddr_t unused, XEvent *event) XQueryKeymap(xDisplay,keys); metaL = XKeysymToKeycode(xDisplay, XK_Meta_L); metaR = XKeysymToKeycode(xDisplay, XK_Meta_R); - if ( n == 1 && *buf > 32 && !(keys[metaL>>3]&1<<(metaL&7)) && !(keys[metaR>>3]&1<<(metaR&7))) // printable, no alt - PopUpMoveDialog(*buf); - + if ( n == 1 && *buf >= 32 && !(keys[metaL>>3]&1<<(metaL&7)) && !(keys[metaR>>3]&1<<(metaR&7))) { // printable, no alt + if(appData.icsActive) { // text typed to board in ICS mode: divert to ICS input box + if(shells[4]) { // box already exists: append to current contents + char *p, newText[MSG_SIZ]; + GetWidgetText(&boxOptions[0], &p); + snprintf(newText, MSG_SIZ, "%s%c", p, *buf); + SetWidgetText(&boxOptions[0], newText, 4); + if(shellUp[4]) XSetInputFocus(xDisplay, XtWindow(boxOptions[0].handle), RevertToPointerRoot, CurrentTime); //why??? + } else icsText = buf; // box did not exist: make sure it pops up with char in it + InputBoxPopup(); + } else PopUpMoveDialog(*buf); + } } void @@ -1669,7 +1679,7 @@ Option shuffleOptions[] = { void SetRandom(int n) { - int r = n==2 ? -1 : rand() & (1<<30)-1; + int r = n==2 ? -1 : random() & (1<<30)-1; char buf[MSG_SIZ]; snprintf(buf, MSG_SIZ, "%d", r); SetWidgetText(&shuffleOptions[1], buf, 0);