Index: trunk/config.h.in =================================================================== --- trunk/config.h.in (revision 3366) +++ trunk/config.h.in (revision 3367) @@ -190,6 +190,8 @@ as ~/DOT_PCB_RND/ */ #define DOT_PCB_RND "@/local/pcb/dot_pcb_rnd@" +/* ./configure --workaround requests: */ +@?/local/pcb/workaround_defs@ #endif @] Index: trunk/scconfig/hooks.c =================================================================== --- trunk/scconfig/hooks.c (revision 3366) +++ trunk/scconfig/hooks.c (revision 3367) @@ -49,6 +49,7 @@ printf(" --debug configure for building a debug version (-g -O0)\n"); printf(" --coord=32|64 set coordinate integer type's width in bits\n"); printf(" --dot_pcb_pcb=path .pcb-rnd config path under $HOME/\n"); + printf(" --workaround-gtk-ctrl enable GTK control key query workaround\n"); } static void help2(void) @@ -97,6 +98,15 @@ } if (strcmp(key, "coord") == 0) put("/local/pcb/dot_pcb_rnd", value); + if (strncmp(key, "workaround-", 11) == 0) { + const char *what = key+11; + if (strcmp(what, "gtk-ctrl") == 0) append("/local/pcb/workaround_defs", "\n#define PCB_WORKAROUND_GTK_CTRL 1"); + else { + report("ERROR: unknown workaround '%s'\n", what); + exit(1); + } + return 1; + } if ((strcmp(key, "with-intl") == 0) || (strcmp(key, "enable-intl") == 0)) { want_intl = 1; return 1; Index: trunk/src_plugins/hid_gtk/gtkhid-main.c =================================================================== --- trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 3366) +++ trunk/src_plugins/hid_gtk/gtkhid-main.c (revision 3367) @@ -270,11 +270,12 @@ pcb_trace("ghid_control_is_pressed() d3 %x %x %x %s\n", mask, GDK_CONTROL_MASK, ghid_glob_mask, (ghid_glob_mask & GDK_CONTROL_MASK) ? "ctrl pressed" : "ctrl not pressed"); -/* James, please uncomment this: -return ghid_glob_mask & GDK_CONTROL_MASK; -*/ - +#ifdef PCB_WORKAROUND_GTK_CTRL + /* On some systems the above query fails and we need to return the last known state instead */ + return ghid_glob_mask & GDK_CONTROL_MASK; +#else return (mask & GDK_CONTROL_MASK) ? TRUE : FALSE; +#endif } int ghid_mod1_is_pressed()