[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - vcl/inc vcl/unx

Caolán McNamara caolanm at redhat.com
Fri Jul 24 06:06:35 PDT 2015


 vcl/inc/unx/gtk/gtkframe.hxx       |    2 +-
 vcl/unx/gtk/window/gtksalframe.cxx |   35 +++++++++++++++++------------------
 2 files changed, 18 insertions(+), 19 deletions(-)

New commits:
commit b882eef32392b6ac027063135476ec8eec3fd2a2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Jul 24 14:05:39 2015 +0100

    Revert "gtk3: draw/paint to the fixed container"
    
    bah, didn't mean to push directly without review
    
    This reverts commit c19e079bc1a2cce977bd0e2bbba5901108180615.

diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 4977a7c..6797ea82 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -173,7 +173,6 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider
 
     SalX11Screen                    m_nXScreen;
     GtkWidget*                      m_pWindow;
-    GtkFixed*                       m_pFixedContainer;
     GdkWindow*                      m_pForeignParent;
     GdkNativeWindow                 m_aForeignParentWindow;
     GdkWindow*                      m_pForeignTopLevel;
@@ -181,6 +180,7 @@ class GtkSalFrame : public SalFrame, public X11WindowProvider
     Pixmap                          m_hBackgroundPixmap;
     sal_uLong                       m_nStyle;
     SalExtStyle                     m_nExtStyle;
+    GtkFixed*                       m_pFixedContainer;
     GtkSalFrame*                    m_pParent;
     std::list< GtkSalFrame* >       m_aChildren;
     GdkWindowState                  m_nState;
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index b99d48d..ba2f79b 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -414,7 +414,7 @@ void GtkSalFrame::doKeyCallback( guint state,
     if (keyval == GDK_0)
     {
         fprintf( stderr, "force widget_queue_draw\n");
-        gtk_widget_queue_draw (m_pFixedContainer);
+        gtk_widget_queue_draw (m_pWindow);
         return;
     }
     else if (keyval == GDK_1)
@@ -1034,25 +1034,12 @@ void GtkSalFrame::updateScreenNumber()
 
 void GtkSalFrame::InitCommon()
 {
-    // add the fixed container child,
-    // fixed is needed since we have to position plugin windows
-    m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL ));
-    gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pFixedContainer) );
-
-    gtk_widget_set_app_paintable(GTK_WIDGET(m_pFixedContainer), true);
-    /*non-X11 displays won't show anything at all without double-buffering
-      enabled*/
-    if (GDK_IS_X11_DISPLAY(getGdkDisplay()))
-        gtk_widget_set_double_buffered(GTK_WIDGET(m_pFixedContainer), false);
-    gtk_widget_set_redraw_on_allocate(GTK_WIDGET(m_pFixedContainer), false);
-
-
     // connect signals
     g_signal_connect( G_OBJECT(m_pWindow), "style-set", G_CALLBACK(signalStyleSet), this );
     g_signal_connect( G_OBJECT(m_pWindow), "button-press-event", G_CALLBACK(signalButton), this );
     g_signal_connect( G_OBJECT(m_pWindow), "button-release-event", G_CALLBACK(signalButton), this );
 #if GTK_CHECK_VERSION(3,0,0)
-    g_signal_connect( G_OBJECT(m_pFixedContainer), "draw", G_CALLBACK(signalDraw), this );
+    g_signal_connect( G_OBJECT(m_pWindow), "draw", G_CALLBACK(signalDraw), this );
 //    g_signal_connect( G_OBJECT(m_pWindow), "state-flags-changed", G_CALLBACK(signalFlagsChanged), this );
 #if GTK_CHECK_VERSION(3,14,0)
     GtkGesture *pSwipe = gtk_gesture_swipe_new(m_pWindow);
@@ -1068,7 +1055,7 @@ void GtkSalFrame::InitCommon()
 #endif
 
 #else
-    g_signal_connect( G_OBJECT(m_pFixedContainer), "expose-event", G_CALLBACK(signalExpose), this );
+    g_signal_connect( G_OBJECT(m_pWindow), "expose-event", G_CALLBACK(signalExpose), this );
 #endif
     g_signal_connect( G_OBJECT(m_pWindow), "focus-in-event", G_CALLBACK(signalFocus), this );
     g_signal_connect( G_OBJECT(m_pWindow), "focus-out-event", G_CALLBACK(signalFocus), this );
@@ -1110,12 +1097,24 @@ void GtkSalFrame::InitCommon()
     m_nAppActionGroupExportId = 0;
     m_nHudAwarenessId   = 0;
 
+    gtk_widget_set_app_paintable( m_pWindow, TRUE );
+    /*non-X11 displays won't show anything at all without double-buffering
+      enabled*/
+    if (GDK_IS_X11_DISPLAY(getGdkDisplay()))
+        gtk_widget_set_double_buffered( m_pWindow, FALSE );
+    gtk_widget_set_redraw_on_allocate( m_pWindow, FALSE );
+
     gtk_widget_add_events( m_pWindow,
                            GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
                            GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
                            GDK_VISIBILITY_NOTIFY_MASK | GDK_SCROLL_MASK
                            );
 
+    // add the fixed container child,
+    // fixed is needed since we have to position plugin windows
+    m_pFixedContainer = GTK_FIXED(g_object_new( ooo_fixed_get_type(), NULL ));
+    gtk_container_add( GTK_CONTAINER(m_pWindow), GTK_WIDGET(m_pFixedContainer) );
+
     // show the widgets
     gtk_widget_show( GTK_WIDGET(m_pFixedContainer) );
 
@@ -3640,7 +3639,7 @@ void GtkSalFrame::damaged (const basegfx::B2IBox& rDamageRect)
         cairo_destroy(cr);
     }
 
-    gtk_widget_queue_draw_area(GTK_WIDGET(m_pFixedContainer),
+    gtk_widget_queue_draw_area(m_pWindow,
                                rDamageRect.getMinX(),
                                rDamageRect.getMinY(),
                                rDamageRect.getWidth(),
@@ -3703,7 +3702,7 @@ void GtkSalFrame::TriggerPaintEvent()
     SAL_INFO("vcl.gtk3", "force painting" << 0 << "," << 0 << " " << maGeometry.nWidth << "x" << maGeometry.nHeight);
     SalPaintEvent aPaintEvt(0, 0, maGeometry.nWidth, maGeometry.nHeight, true);
     CallCallback(SALEVENT_PAINT, &aPaintEvt);
-    gtk_widget_queue_draw(GTK_WIDGET(m_pFixedContainer));
+    gtk_widget_queue_draw(m_pWindow);
 #endif
 }
 


More information about the Libreoffice-commits mailing list