From 7370d561ecd820bab45ed0f1576e68828cef1512 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Tue, 16 Apr 2024 08:05:23 +0200 Subject: [PATCH] Status bar freze fix Upport from https://gitlab.com/inkscape/inkscape/-/merge_requests/6273/commits --- share/ui/statusbar.ui | 32 +++++++++++++++++++++++--------- src/desktop.cpp | 5 ++++- src/desktop.h | 1 + src/ui/widget/status-bar.cpp | 18 ++++++++---------- 4 files changed, 36 insertions(+), 20 deletions(-) diff --git a/share/ui/statusbar.ui b/share/ui/statusbar.ui index 19e23db139..524a6d693a 100644 --- a/share/ui/statusbar.ui +++ b/share/ui/statusbar.ui @@ -59,16 +59,30 @@ - + + + True True - StatusbarSelection - start - 0 - <b>Welcome to Inkscape!</b> Use shape or freehand tools to create objects; use selector (arrow) to move or transform them. - True - True - end - 2 + True + external + external + + + True + StatusbarSelection + True + start + 0 + <b>Welcome to Inkscape!</b> Use shape or freehand tools to create objects; use selector (arrow) to move or transform them. + True + + False + end + 2 + + diff --git a/src/desktop.cpp b/src/desktop.cpp index a51218a275..7508bc7c74 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -111,7 +111,10 @@ SPDesktop::SPDesktop() _tips_message_context = std::make_unique(_message_stack); _message_changed_connection = _message_stack->connectChanged([this](auto const type, auto const message) { - onStatusMessage(type, message); + _message_idle_connection = Glib::signal_idle().connect([=, this](){ + onStatusMessage(type, message); + return false; + }, Glib::PRIORITY_HIGH); }); } diff --git a/src/desktop.h b/src/desktop.h index 807785d646..6ab2e24af6 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -170,6 +170,7 @@ private: std::unique_ptr _tips_message_context; Inkscape::auto_connection _message_changed_connection; + Inkscape::auto_connection _message_idle_connection; Inkscape::auto_connection _document_uri_set_connection; // End Formerly in View::View ^^^^^^^^^^^^^^^^^^ diff --git a/src/ui/widget/status-bar.cpp b/src/ui/widget/status-bar.cpp index 2980fdd5ae..ca46b06096 100644 --- a/src/ui/widget/status-bar.cpp +++ b/src/ui/widget/status-bar.cpp @@ -171,20 +171,18 @@ StatusBar::set_desktop(SPDesktop* desktop_in) void StatusBar::set_message(const Inkscape::MessageType type, const char* message) { +Glib::ustring msg = message ? message : ""; +#ifndef _WIN32 #if PANGO_VERSION_CHECK(1,50,0) - auto const msg = Glib::ustring::compose("%1", message ? message : ""); - selection->set_markup(msg.c_str()); -#else - selection->set_markup(message ? message : ""); + // line height give delays on windows so better uset, also is not necesary label is well placed without + msg = Glib::ustring("") + msg + ""; #endif - - // Display important messages immediately! - if (type == Inkscape::IMMEDIATE_MESSAGE && selection->is_drawable()) { - selection->queue_draw(); - } - +#endif + + selection->set_markup(msg); // Allow user to view the entire message even if it doesn't fit into label (after removing markup). selection->set_tooltip_text(selection->get_text()); + } void -- GitLab