X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxboard.c;h=7abd7cefc35eb7209072a74dbb42242da9c4fdf5;hb=51e9503489f2cee28a076bf52c56185a5283b069;hp=ecf36dd044159235ee7dee6701eb6ec912f9fabe;hpb=c24634958b7f2bbfdbe2b1bbc88703fead251204;p=xboard.git diff --git a/gtk/xboard.c b/gtk/xboard.c index ecf36dd..7abd7ce 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -523,6 +523,12 @@ GetActualPlacement (GtkWidget *shell, WindowPlacement *wp) } void +GetPlacement (DialogClass dlg, WindowPlacement *wp) +{ // wrapper to shield back-end from widget type + if(shellUp[dlg]) GetActualPlacement(shells[dlg], wp); +} + +void GetWindowCoords () { // wrapper to shield use of window handles from back-end (make addressible by number?) // In XBoard this will have to wait until awareness of window parameters is implemented @@ -533,6 +539,7 @@ GetWindowCoords () if(shellUp[GameListDlg]) GetActualPlacement(shells[GameListDlg], &wpGameList); if(shellUp[CommentDlg]) GetActualPlacement(shells[CommentDlg], &wpComment); if(shellUp[TagsDlg]) GetActualPlacement(shells[TagsDlg], &wpTags); + GetPlacement(ChatDlg, &wpConsole); if(appData.icsActive) wpConsole.visible = shellUp[ChatDlg]; } void @@ -752,7 +759,7 @@ int main (int argc, char **argv) { int i, clockFontPxlSize, coordFontPxlSize, fontPxlSize; - int boardWidth, boardHeight, w, h; + int boardWidth, w, h; //, boardHeight; char *p; int forceMono = False; @@ -779,7 +786,7 @@ main (int argc, char **argv) GtkosxApplication *theApp = g_object_new(GTKOSX_TYPE_APPLICATION, NULL); char *path = gtkosx_application_get_bundle_path(); strncpy(dataDir, path, MSG_SIZ); - snprintf(masterSettings, MSG_SIZ, "%s/../Resources/etc/xboard.conf", path); + snprintf(masterSettings, MSG_SIZ, "%s/Contents/Resources/etc/xboard.conf", path); g_signal_connect(theApp, "NSApplicationOpenFile", G_CALLBACK(StartNewXBoard), NULL); // we must call application ready before we can get the signal, // and supply a (dummy) menu bar before that, to avoid problems with dual apples in it @@ -848,6 +855,8 @@ main (int argc, char **argv) { // [HGM] initstring: kludge to fix bad bug. expand '\n' characters in init string and computer string. static char buf[MSG_SIZ]; + snprintf(buf, MSG_SIZ, appData.sysOpen, DATADIR); + ASSIGN(appData.sysOpen, buf); // expand %s in -openCommand to DATADIR (usefull for OS X configuring) EscapeExpand(buf, appData.firstInitString); appData.firstInitString = strdup(buf); EscapeExpand(buf, appData.secondInitString); @@ -965,7 +974,7 @@ main (int argc, char **argv) /* [HR] height treated separately (hacked) */ boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap); - boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap); +// boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap); /* * Determine what fonts to use. @@ -1119,6 +1128,11 @@ main (int argc, char **argv) EngineOutputPopUp(); } + if( wpConsole.visible && appData.icsActive ) { + ChatProc(); + BoardToTop(); + } + InitBackEnd2(); if (errorExitStatus == -1) { @@ -1357,7 +1371,7 @@ EnableNamedMenuItem (char *menuRef, int state) { MenuItem *item = MenuNameToItem(menuRef); - if(item) gtk_widget_set_sensitive(item->handle, state); + if(item && item->handle) gtk_widget_set_sensitive(item->handle, state); } void @@ -1558,6 +1572,7 @@ DragProc () if(shellUp[HistoryDlg]) CoDrag(shells[HistoryDlg], &wpMoveHistory); if(shellUp[EvalGraphDlg]) CoDrag(shells[EvalGraphDlg], &wpEvalGraph); if(shellUp[GameListDlg]) CoDrag(shells[GameListDlg], &wpGameList); + if(shellUp[ChatDlg]) CoDrag(shells[ChatDlg], &wpConsole); } wpMain = wpNew; DrawPosition(True, NULL);