Index: trunk/doc/TODO =================================================================== --- trunk/doc/TODO (revision 8785) +++ trunk/doc/TODO (revision 8786) @@ -12,7 +12,6 @@ - plugins: - turn gpmi into a conventional plugin - png export: rotated square pad bug, see RTT/padrot.pcb [report: Larry] - - r8406 breaks the gtk cursor somehow: hovering above line endpoints stop showing the endpoint shape correctly [report: miloh] - layer rewrite: - gtk layersel bugs: - png export: check mask/paste drawing, make new options? mask on in photo more? Index: trunk/src_plugins/lib_gtk_common/in_mouse.c =================================================================== --- trunk/src_plugins/lib_gtk_common/in_mouse.c (revision 8785) +++ trunk/src_plugins/lib_gtk_common/in_mouse.c (revision 8786) @@ -38,6 +38,7 @@ #include "board.h" #include "action_helper.h" #include "crosshair.h" +#include "conf_core.h" #include "in_keyboard.h" #include "bu_status_line.h" @@ -52,7 +53,7 @@ return (PCB_MB_LEFT << (ev_button - 1)); } -static GdkCursorType old_cursor; +static GdkCursorType old_cursor, cursor_override; #define CUSTOM_CURSOR_CLOCKWISE (GDK_LAST_CURSOR + 10) #define CUSTOM_CURSOR_DRAG (GDK_LAST_CURSOR + 11) @@ -97,14 +98,22 @@ return old_shape; } -void ghid_point_cursor(pcb_gtk_mouse_t *ctx) +void ghid_point_cursor(pcb_gtk_mouse_t *ctx, pcb_bool grabbed) { - old_cursor = gport_set_cursor(ctx, GDK_DRAPED_BOX); + if (grabbed) { + old_cursor = gport_set_cursor(ctx, GDK_DRAPED_BOX); + cursor_override = GDK_DRAPED_BOX; + } + else { + cursor_override = 0; + ghid_mode_cursor(ctx, -1); + } } void ghid_hand_cursor(pcb_gtk_mouse_t *ctx) { old_cursor = gport_set_cursor(ctx, GDK_HAND2); + cursor_override = GDK_HAND2; } void ghid_watch_cursor(pcb_gtk_mouse_t *ctx) @@ -118,6 +127,14 @@ void ghid_mode_cursor(pcb_gtk_mouse_t *ctx, int mode) { + if (cursor_override != 0) { + gport_set_cursor(ctx, cursor_override); + return; + } + + if (mode < 0) /* automatic */ + mode = conf_core.editor.mode; + switch (mode) { case PCB_MODE_NO: gport_set_cursor(ctx, (GdkCursorType) CUSTOM_CURSOR_DRAG); @@ -199,6 +216,7 @@ void ghid_restore_cursor(pcb_gtk_mouse_t *ctx) { + cursor_override = 0; gport_set_cursor(ctx, old_cursor); } Index: trunk/src_plugins/lib_gtk_common/in_mouse.h =================================================================== --- trunk/src_plugins/lib_gtk_common/in_mouse.h (revision 8785) +++ trunk/src_plugins/lib_gtk_common/in_mouse.h (revision 8786) @@ -20,7 +20,7 @@ pcb_hid_cfg_mod_t ghid_mouse_button(int ev_button); void ghid_hand_cursor(pcb_gtk_mouse_t *ctx); -void ghid_point_cursor(pcb_gtk_mouse_t *ctx); +void ghid_point_cursor(pcb_gtk_mouse_t *ctx, pcb_bool grabbed); /** Changes the cursor appearance to signifies a wait state */ void ghid_watch_cursor(pcb_gtk_mouse_t *ctx); /** Changes the cursor appearance according to @mode */ Index: trunk/src_plugins/lib_gtk_common/util_timer.c =================================================================== --- trunk/src_plugins/lib_gtk_common/util_timer.c (revision 8785) +++ trunk/src_plugins/lib_gtk_common/util_timer.c (revision 8786) @@ -39,7 +39,7 @@ static gboolean ghid_timer(GuiTimer * timer) { (*timer->func) (timer->user_data); - timer->com->mode_cursor_main(conf_core.editor.mode); + timer->com->mode_cursor_main(-1); return FALSE; /* Turns timer off */ } Index: trunk/src_plugins/lib_gtk_common/util_watch.c =================================================================== --- trunk/src_plugins/lib_gtk_common/util_watch.c (revision 8785) +++ trunk/src_plugins/lib_gtk_common/util_watch.c (revision 8786) @@ -55,7 +55,7 @@ x.ptr = (void *) watch; watch->func(x, watch->fd, pcb_condition, watch->user_data); - watch->com->mode_cursor_main(conf_core.editor.mode); + watch->com->mode_cursor_main(-1); return TRUE; /* Leave watch on */ } Index: trunk/src_plugins/lib_gtk_hid/glue_common.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_common.c (revision 8785) +++ trunk/src_plugins/lib_gtk_hid/glue_common.c (revision 8786) @@ -158,6 +158,8 @@ static void ghid_mode_cursor_main(int mode) { + if (mode >= 0) + ghid_point_cursor(&gport->mouse, 0); /* undo any override (e.g. left over from arrow cursor poitning to the end of a line) first */ ghid_mode_cursor(&gport->mouse, mode); } Index: trunk/src_plugins/lib_gtk_hid/glue_hid.c =================================================================== --- trunk/src_plugins/lib_gtk_hid/glue_hid.c (revision 8785) +++ trunk/src_plugins/lib_gtk_hid/glue_hid.c (revision 8786) @@ -403,10 +403,7 @@ if (!ghidgui) return; - if (grabbed > 0) - ghid_point_cursor(&gport->mouse); - else - ghid_mode_cursor(&gport->mouse, conf_core.editor.mode); + ghid_point_cursor(&gport->mouse, grabbed); } static void ghid_notify_save_pcb(const char *filename, pcb_bool done)