https://bugs.documentfoundation.org/show_bug.cgi?id=136512

--- Comment #5 from Tom <mbox....@posteo.org> ---
I have two news, a good one and a bad one.

First the bad news
------------------
I have done the following modification: Commented out 2nd
"GtkSalFrame::getDisplay()->SendInternalEvent"

void GtkSalFrame::signalStyleUpdated(GtkWidget*, gpointer frame)
{
    GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);

    // note: settings changed for multiple frames is avoided in winproc.cxx
ImplHandleSettings
    GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr,
SalEvent::SettingsChanged );

    // fire off font-changed when the system cairo font hints change
    GtkInstance *pInstance =
static_cast<GtkInstance*>(GetSalData()->m_pInstance);
    const cairo_font_options_t* pLastCairoFontOptions =
pInstance->GetLastSeenCairoFontOptions();
    const cairo_font_options_t* pCurrentCairoFontOptions =
gdk_screen_get_font_options(gdk_screen_get_default());
    bool bFontSettingsChanged = true;
    if (pLastCairoFontOptions && pCurrentCairoFontOptions)
        bFontSettingsChanged = !cairo_font_options_equal(pLastCairoFontOptions,
pCurrentCairoFontOptions);
    else if (!pLastCairoFontOptions && !pCurrentCairoFontOptions)
        bFontSettingsChanged = false;
    if (bFontSettingsChanged)
    {
        pInstance->ResetLastSeenCairoFontOptions(pCurrentCairoFontOptions);
/*        GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr,
SalEvent::FontChanged );*/
    }
}

Unfortunately, it did not help. I still see the same behavior as reported in my
first post.


Now the good news
-----------------
With the following modification, the loop is broken and the cpu load has
returned to reasonable values: Commented out 1st
"GtkSalFrame::getDisplay()->SendInternalEvent"

void GtkSalFrame::signalStyleUpdated(GtkWidget*, gpointer frame)
{
    GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);

    // note: settings changed for multiple frames is avoided in winproc.cxx
ImplHandleSettings
/*    GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr,
SalEvent::SettingsChanged ); */

    // fire off font-changed when the system cairo font hints change
    GtkInstance *pInstance =
static_cast<GtkInstance*>(GetSalData()->m_pInstance);
    const cairo_font_options_t* pLastCairoFontOptions =
pInstance->GetLastSeenCairoFontOptions();
    const cairo_font_options_t* pCurrentCairoFontOptions =
gdk_screen_get_font_options(gdk_screen_get_default());
    bool bFontSettingsChanged = true;
    if (pLastCairoFontOptions && pCurrentCairoFontOptions)
        bFontSettingsChanged = !cairo_font_options_equal(pLastCairoFontOptions,
pCurrentCairoFontOptions);
    else if (!pLastCairoFontOptions && !pCurrentCairoFontOptions)
        bFontSettingsChanged = false;
    if (bFontSettingsChanged)
    {
        pInstance->ResetLastSeenCairoFontOptions(pCurrentCairoFontOptions);
        GtkSalFrame::getDisplay()->SendInternalEvent( pThis, nullptr,
SalEvent::FontChanged );
    }
}

I played a little bit around with the menus and opened a new writer document
afterwards to see, if there is any obvious side-effect. In my 2 minutes check,
I did not find one.

What do you think? This change is probably too simple to both fix the issue and
maintain the entire functionality of LO, isn't it?

Regards
Tom

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to