惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
人人都是产品经理
人人都是产品经理
C
Check Point Blog
宝玉的分享
宝玉的分享
B
Blog RSS Feed
博客园 - 三生石上(FineUI控件)
量子位
Martin Fowler
Martin Fowler
酷 壳 – CoolShell
酷 壳 – CoolShell
Jina AI
Jina AI
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
博客园 - 叶小钗
J
Java Code Geeks
The Cloudflare Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
P
Proofpoint News Feed
美团技术团队
H
Help Net Security
B
Blog
博客园_首页

inkscape:windows_ci_14x commits

Update WIndows dependencies to r180 (995a0ec3) · Commits · René de Hesselle / inkscape · GitLab Fix Welcome dialog stacking up when run more than once (eab9c6d5) · Commits · René de Hesselle / inkscape · GitLab Edit label and tooltip for Preserve Shape setting (4c992ff3) · Commits · René de Hesselle / inkscape · GitLab Fix keyboard navigation in Objects dialog (38acd49e) · Commits · René de Hesselle / inkscape · GitLab update translations (9f8f2fec) · Commits · René de Hesselle / inkscape · GitLab Fix missing signal blocking in page toolbar (d5533a4b) · Commits · René de Hesselle / inkscape · GitLab Convert libuemf to a git submodule (22344d42) · Commits · René de Hesselle / inkscape · GitLab update translations (f5993d7c) · Commits · René de Hesselle / inkscape · GitLab update translations (fcd03438) · Commits · René de Hesselle / inkscape · GitLab Fix: request display update when removing child from group (6908c07a) · Commits · René de Hesselle / inkscape · GitLab Make po submodule shallow (90eced57) · Commits · René de Hesselle / inkscape · GitLab 1.4.3 (0d15f750) · Commits · René de Hesselle / inkscape · GitLab update translations (4d3a6d61) · Commits · René de Hesselle / inkscape · GitLab Update tutorials and man page for Inkscape 1.4.3 (excluding French) (bec26502) · Commits · René de Hesselle / inkscape · GitLab Add GioWin32-2.0.typelib to Windows (eb2146c6) · Commits · René de Hesselle / inkscape · GitLab Revert the backport of a fix causing regressions in textPath (7d1c0165) · Commits · René de Hesselle / inkscape · GitLab update translations (8a1e7745) · Commits · René de Hesselle / inkscape · GitLab Update Windows dependencies to r168 (9500139e) · Commits · René de Hesselle / inkscape · GitLab Build GraphicsMagick on Windows ourselves again (2ea69ea8) · Commits · René de Hesselle / inkscape · GitLab Prepare 1.4.3 (e2afff01) · Commits · René de Hesselle / inkscape · GitLab Update docs for 1.4.3rc (ea3d7619) · Commits · René de Hesselle / inkscape · GitLab Fix crash on MacOS when opening file by right clicking on file. (fe96d51c) · Commits · René de Hesselle / inkscape · GitLab Update macOS build pipeline to v0.82-2-g21f3e2d (56605ae7) · Commits · René de Hesselle / inkscape · GitLab Fix commands toolbar glitching at exact size (b8376295) · Commits · René de Hesselle / inkscape · GitLab Add commands toolbar to automatic toolbar policy (c37cea70) · Commits · René de Hesselle / inkscape · GitLab update translations (dfc0fde0) · Commits · René de Hesselle / inkscape · GitLab Fix welcome dialog graphics (8d76d570) · Commits · René de Hesselle / inkscape · GitLab Fix code getting items under cursor (441f5bfb) · Commits · René de Hesselle / inkscape · GitLab Make libdepixelize a submodule (09a2712d) · Commits · René de Hesselle / inkscape · GitLab Handle `xml:lang`/`lang` attribute updates (7fa5d668) · Commits · René de Hesselle / inkscape · GitLab
Batch updates to layer selector (5433ba34) · Commits · Re...
PBS · 2025-12-04 · via inkscape:windows_ci_14x commits
Commit 5433ba34 authored by PBS's avatar PBS Committed by Willy (Wen-Wei) Kao
Browse files

Batch updates to layer selector

The layer selector can receive a lot of unbatched updates from ObjectSet
during an ungroup. Coupled with Gtk::CssProvider::load_from_data()
usage, this is very slow. Limit updates to one per frame.

Robustify the lifecycle management of LayerSelector, by stopping _layer
dangling and detaching _observer properly.

Fixes inkscape/inkscape#5988
Original line number Diff line number Diff line
@@ -115,19 +115,25 @@ LayerSelector::LayerSelector(SPDesktop *desktop)
    Gtk::StyleContext::add_provider_for_screen(_layer_label.get_screen(), _label_style,
                                               GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);

    _observer->signal_changed().connect(sigc::mem_fun(*this, &LayerSelector::_layerModified));
    _observer->signal_changed().connect([this] { _queueUpdate(); });
    setDesktop(desktop);
}

LayerSelector::~LayerSelector() {
    setDesktop(nullptr);
}
LayerSelector::~LayerSelector() = default;

void LayerSelector::setDesktop(SPDesktop *desktop) {
    if ( desktop == _desktop )
void LayerSelector::setDesktop(SPDesktop *desktop)
{
    if (desktop == _desktop) {
        return;
    }

    if (_desktop) {
        _cancelUpdate();
        _layer_changed.disconnect();
        _layer = nullptr;
        _observer->set(nullptr);
    }

    _desktop = desktop;

    if (_desktop) {
@@ -143,7 +149,30 @@ void LayerSelector::_layerChanged(SPGroup *layer)
{
    _layer = layer;
    _observer->set(layer);
    _queueUpdate();
}

void LayerSelector::_queueUpdate()
{
    if (_tick_callback) {
        return;
    }

    _tick_callback = add_tick_callback([this] (Glib::RefPtr<Gdk::FrameClock> const &) {
        _layerModified();
        _tick_callback = 0;
        return false;
    });
}

void LayerSelector::_cancelUpdate()
{
    if (!_tick_callback) {
        return;
    }

    remove_tick_callback(_tick_callback);
    _tick_callback = 0;
}

/**
Original line number Diff line number Diff line
@@ -65,12 +65,16 @@ private:
    std::unique_ptr<Inkscape::XML::SignalObserver> _observer;

    void _layerChanged(SPGroup *layer);
    void _queueUpdate();
    void _cancelUpdate();
    void _layerModified();
    void _selectLayer();
    void _hideLayer();
    void _lockLayer();
    void _layerChoose();
    Glib::ustring getThisCssClass() const;

    unsigned _tick_callback = 0;
};

} // namespace Inkscape::UI::Widget