Code

fix pasting style after copying a text span
[inkscape.git] / src / select-context.cpp
index c7b305dd201aee4fd63487469a607cfefa216d8c..0e35c6546fedb1accef8f3cd36ffdfc1125efd8b 100644 (file)
@@ -360,14 +360,17 @@ sp_select_context_item_handler(SPEventContext *event_context, SPItem *item, GdkE
 
         case GDK_ENTER_NOTIFY:
         {
-            GdkCursor *cursor = gdk_cursor_new(GDK_FLEUR);
-            gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, cursor);
-            gdk_cursor_destroy(cursor);
+            if (!desktop->isWaitingCursor()) {
+                GdkCursor *cursor = gdk_cursor_new(GDK_FLEUR);
+                gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, cursor);
+                gdk_cursor_destroy(cursor);
+            }
             break;
         }
 
         case GDK_LEAVE_NOTIFY:
-            gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, event_context->cursor);
+            if (!desktop->isWaitingCursor())
+                gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, event_context->cursor);
             break;
 
         case GDK_KEY_PRESS:
@@ -427,7 +430,9 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
 
                         sp_canvas_end_forced_full_redraws(desktop->canvas);
                     } else { // switch tool
-                        tools_switch_by_item (desktop, clicked_item);
+                        Geom::Point const button_pt(event->button.x, event->button.y);
+                        Geom::Point const p(desktop->w2d(button_pt));
+                        tools_switch_by_item (desktop, clicked_item, p);
                     }
                 } else {
                     sp_select_context_up_one_layer(desktop);
@@ -713,7 +718,7 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
                                                 _("<b>Shift</b>: click to toggle select; drag for rubberband selection"),
                                                 _("<b>Alt</b>: click to select under; drag to move selected or select by touch"));
                     // if Alt and nonempty selection, show moving cursor ("move selected"):
-                    if (alt && !selection->isEmpty()) {
+                    if (alt && !selection->isEmpty() && !desktop->isWaitingCursor()) {
                         GdkCursor *cursor = gdk_cursor_new(GDK_FLEUR);
                         gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, cursor);
                         gdk_cursor_destroy(cursor);
@@ -935,7 +940,8 @@ sp_select_context_root_handler(SPEventContext *event_context, GdkEvent *event)
             }
             }
             // set cursor to default.
-            gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, event_context->cursor);
+            if (!desktop->isWaitingCursor())
+                gdk_window_set_cursor(GTK_WIDGET(sp_desktop_canvas(desktop))->window, event_context->cursor);
             break;
         default:
             break;