From bccf36d665845579f8429221bb1f2f7926c987e9 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 11 Nov 2024 21:01:11 -0700 Subject: [PATCH] catch pushing identical cursors to the cursor stack --- gtk2_ardour/editing_context.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editing_context.cc b/gtk2_ardour/editing_context.cc index 95abbd1539..880387cc2e 100644 --- a/gtk2_ardour/editing_context.cc +++ b/gtk2_ardour/editing_context.cc @@ -2036,6 +2036,7 @@ EditingContext::set_canvas_cursor (Gdk::Cursor* cursor) For now, drop down and use C API */ gdk_window_set_cursor (win->gobj(), cursor ? cursor->gobj() : 0); + gdk_flush (); } } @@ -2043,6 +2044,12 @@ size_t EditingContext::push_canvas_cursor (Gdk::Cursor* cursor) { if (!_cursors->is_invalid (cursor)) { + if (!_cursor_stack.empty()) { + if (cursor == _cursor_stack.back()) { + return _cursor_stack.size() - 1; + } + } + _cursor_stack.push_back (cursor); set_canvas_cursor (cursor); } @@ -2059,7 +2066,7 @@ EditingContext::pop_canvas_cursor () } _cursor_stack.pop_back(); - if (_cursor_stack.back()) { + if (!_cursor_stack.empty()) { /* Popped to an existing cursor, we're done. Otherwise, the context that created this cursor has been destroyed, so we need to skip to the next down the stack. */