[Libreoffice-commits] core.git: vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 19 11:22:42 UTC 2019


 vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 34daa253f323cb8b80d6d10a8cdac85e2fa9378d
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Sep 19 11:10:40 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 19 13:21:53 2019 +0200

    when mpWindow is an eventbox we want the toplevel it is in
    
    usually it is already a toplevel, so this only arises
    in the unusual WB_SYSTEMCHILDWINDOW case
    
    Change-Id: Ie0c7ffad87c75fb4e1443b9ab22e1f226782ac3a
    Reviewed-on: https://gerrit.libreoffice.org/79117
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 689e19da83da..d5ac0a5ab475 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -2442,7 +2442,7 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co
         renderType = RenderType::TabItem;
         break;
     case ControlType::WindowBackground:
-        context = gtk_widget_get_style_context(mpWindow);
+        context = gtk_widget_get_style_context(gtk_widget_get_toplevel(mpWindow));
         break;
     case ControlType::Frame:
     {
@@ -2936,10 +2936,11 @@ vcl::Font pango_to_vcl(const PangoFontDescription* font, const css::lang::Locale
 
 bool GtkSalGraphics::updateSettings(AllSettings& rSettings)
 {
-    GtkStyleContext* pStyle = gtk_widget_get_style_context( mpWindow );
+    GtkWidget* pTopLevel = gtk_widget_get_toplevel(mpWindow);
+    GtkStyleContext* pStyle = gtk_widget_get_style_context(pTopLevel);
     StyleContextSave aContextState;
     aContextState.save(pStyle);
-    GtkSettings* pSettings = gtk_widget_get_settings( mpWindow );
+    GtkSettings* pSettings = gtk_widget_get_settings(pTopLevel);
     StyleSettings aStyleSet = rSettings.GetStyleSettings();
     GdkRGBA color;
 


More information about the Libreoffice-commits mailing list