Code

Stop overrun.
[inkscape.git] / src / desktop.cpp
index 52f1725779a2b0a00fd89c704b04bf6a8995920c..1fdad010fb331493e16c679f42ac5c7affae8de7 100644 (file)
@@ -462,9 +462,9 @@ void SPDesktop::displayModeToggle() {
         _setDisplayMode(Inkscape::RENDERMODE_OUTLINE);
         break;
     case Inkscape::RENDERMODE_OUTLINE:
-        _setDisplayMode(Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW);
+        _setDisplayMode(Inkscape::RENDERMODE_NORMAL);
         break;
-    case Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW:
+//    case Inkscape::RENDERMODE_PRINT_COLORS_PREVIEW:
     default:
         _setDisplayMode(Inkscape::RENDERMODE_NORMAL);
     }
@@ -636,9 +636,15 @@ SPDesktop::set_event_context (GtkType type, const gchar *config)
         event_context = next;
     }
 
+    // The event_context will be null. This means that it will be impossible
+    // to process any event invoked by the lines below. See for example bug
+    // LP #622350. Cutting and undoing again in the node tool resets the event
+    // context to the node tool. In this bug the line bellow invokes GDK_LEAVE_NOTIFY
+    // events which cannot be handled and must be discarded.
     ec = sp_event_context_new (type, this, config, SP_EVENT_CONTEXT_STATIC);
     ec->next = event_context;
     event_context = ec;
+    // Now the event_context has been set again and we can process all events again
     sp_event_context_activate (ec);
     _event_context_changed_signal.emit (this, ec);
 }
@@ -1367,7 +1373,7 @@ SPDesktop::emitToolSubselectionChanged(gpointer data)
 void
 SPDesktop::updateNow()
 {
-  sp_canvas_update_now(canvas);
+    sp_canvas_update_now(canvas);
 }
 
 void