diff options
Diffstat (limited to 'src/display/sp-canvas.cpp')
| -rw-r--r-- | src/display/sp-canvas.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/display/sp-canvas.cpp b/src/display/sp-canvas.cpp index cb42f2daf..71478eaeb 100644 --- a/src/display/sp-canvas.cpp +++ b/src/display/sp-canvas.cpp @@ -1012,6 +1012,7 @@ static void sp_canvas_init(SPCanvas *canvas) canvas->_xray = false; canvas->_xray_orig = Geom::Point(); canvas->_changecursor = 0; + canvas->_inside = false; // this could be wrong on start but we update it as far we bo to the other side. bool _is_dragging; #if defined(HAVE_LIBLCMS2) @@ -1167,7 +1168,7 @@ void SPCanvas::handle_size_allocate(GtkWidget *widget, GtkAllocation *allocation // Allocation does not depend on device scale. GtkAllocation old_allocation; gtk_widget_get_allocation(widget, &old_allocation); - + // For HiDPI monitors. canvas->_device_scale = gtk_widget_get_scale_factor( widget ); @@ -2318,7 +2319,11 @@ gint SPCanvas::handle_crossing(GtkWidget *widget, GdkEventCrossing *event) if (event->window != getWindow(canvas)) { return FALSE; } - + if (event->type == GDK_LEAVE_NOTIFY) { + canvas->_inside = false; + } else { + canvas->_inside = true; + } canvas->_state = event->state; return canvas->pickCurrentItem(reinterpret_cast<GdkEvent *>(event)); } |
