XBoard for Mac: Zippy problems

Discussion of chess software programming and technical issues.

Moderator: Ras

JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: MacPorts and XQuartz

Post by JoshPettus »

Yup that fixed it! And now it seems to work great. I messed up the line to add the macports libraries/includes in the configure line to enable NLS. Good thing I did that then... Although that was the reason why the app failed to bundle afterward. apparently the app script depends on it... I'll need to fix that.
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: MacPorts and XQuartz

Post by JoshPettus »

I made it so the script will check if gettext is active before installing the localization files. Arun will look at it when he gets back from his vacation.
User avatar
hgm
Posts: 28464
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: MacPorts and XQuartz

Post by hgm »

JoshPettus wrote:Yup that fixed it! And now it seems to work great
Good!

Then we are left with the problem that the regular text selection and copying / pasting in auxiliary dialogs apparently does not work, because the OSX standard keystrokes for this are also in use as main-menu accelerators for Copy Game / Paste Game etc. I guess this is a difference with the Linux version caused by the menu bar being at the top of the screen, and remaining there even when a dialog has focus.

We sort of brought this on ourselves, by adding the code in xoptions.c

Code: Select all

#ifdef OSXAPP
            if(accelerator_mods & GDK_CONTROL_MASK) {  // in OSX use Meta where Linux uses Ctrl
	            accelerator_mods &= ~GDK_CONTROL_MASK;  // clear Ctrl flag
	            accelerator_mods |= GDK_META_MASK;      // set Meta flag
            }
#endif
This replaces accelerators listed in XBoard menu-description tables as Ctrl+KEY by Meta+KEY before logging them with Gtkosx, to make the keystrokes more 'Apple-like'. This is apparently unwise, as some of keystrokes we thus assign collide with, and as a consequence eclipse some important standard keystrokes such as copy/paste selection to/from clipboard.

Possible solutions are to delete this code alltogether, and accept 'Apple-unlike' Ctrl keystokes for the main menus to be sure we won't collide with any native Apple keystroke in the main menus.

The alternative is to make it more selective, and only keep the Ctrl in accelerators that would eclipse an essential native keystroke. This could be done by replacing the if-condition by a more selective one

Code: Select all

   	    if(accelerator_mods & GDK_CONTROL_MASK &&
                      accelerator_key != 'v' &&          // don't use Cmd+V
                      accelerator_key != 'c'             // and Cmd+C
                                                    ) {  // in OSX use Meta (Cmd) where Linux uses Ctrl
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: MacPorts and XQuartz

Post by JoshPettus »

Hey harm! sorry i've been away all day. Yup that works fine. Shame the copy/paste game can't be done through the OS command. It is strange to have multiple commands though, both come from the clipboard don't they? What does the xboard copy/paste game commands do differently?
User avatar
hgm
Posts: 28464
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: MacPorts and XQuartz

Post by hgm »

The problem is not so much that they do something differently, but who gets the command. If you are editing text in a dialog (such as Edit EngineList, Edit Comment,or copying from Engine Output) you want the command to go to that dialog, and act on the selected text. When it goes to the main window, it will copy a PGN or FEN for the current game or position to the clipboard.

In Linux this is not a problem, because it always goes to the dialog that has focus. So even if every dialog has text selected in it, it is always clear which text must go to the clipboard.

But in OSX the always-present menu bar of the main window apparently superceded the dialog that has focus in grabbing the command, so that it is always the PGN game that ends up on the clipboard, even when you intended to copy the text you selected in Engine Output.

Which solution would you prefer? Go back to using Ctrl in all menu items, or just select those that you really need to have available for editing text in the dialogs. And if the latter, which keystrokes are those?
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: MacPorts and XQuartz

Post by JoshPettus »

personally just the the text edit ones which are meta-x meta-c and meta-v for cut, copy paste respectively. So that means retract move as well should be ctrl.
User avatar
hgm
Posts: 28464
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: MacPorts and XQuartz

Post by hgm »

And how about keystrokes for selecting stuff? In Windows these are typically Ctrl-A, and Shift+Arrows. Or are these not so important?
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: MacPorts and XQuartz

Post by JoshPettus »

well shift arrows works just fine. select all is meta-a. I suppose analysis engine can become ctrl a,

Should we add a sub-menu under the edit menu for just OSX with these common text edit commands?
User avatar
hgm
Posts: 28464
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: MacPorts and XQuartz

Post by hgm »

I don't think so; the main window would not need them.

If analyze mode becomes Ctrl-A, wouldn't it be more logical to have all modes use Crtl?
JoshPettus
Posts: 730
Joined: Fri Oct 19, 2012 2:23 am

Re: MacPorts and XQuartz

Post by JoshPettus »

to be honest, I'd still rather leave them as meta... select all isn't all that useful or needed if you want to leave them all as meta.