diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-05-24 12:51:41 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-05-24 16:30:54 +0200 |
commit | 7da5a688f47574f2e55c57d8efba5640bbc4e14f (patch) | |
tree | dd7e085a208b015cbf3b004db445c399f42d86f0 | |
parent | 7f6f57fe93cef0482e1e8b352987f185c56e2d64 (diff) |
gtk[3|4] add a queue_draw to avoid GtkFixed cast
Change-Id: I093b62f9530b28ae932338163606e78fca5752d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116057
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/inc/unx/gtk/gtkframe.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtkframe.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/gtk3/salnativewidgets-gtk.cxx | 3 |
3 files changed, 9 insertions, 3 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index a9d3173f27a1..55b306827350 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -585,6 +585,8 @@ public: //which triggers the gsignals. bool CallCallbackExc(SalEvent nEvent, const void* pEvent) const; + // call gtk_widget_queue_draw on the drawing widget + void queue_draw(); static void KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode, guint* pGdkKeyCode, GdkModifierType *pGdkModifiers); diff --git a/vcl/unx/gtk3/gtkframe.cxx b/vcl/unx/gtk3/gtkframe.cxx index ba35080c9641..4ddbc637c51b 100644 --- a/vcl/unx/gtk3/gtkframe.cxx +++ b/vcl/unx/gtk3/gtkframe.cxx @@ -3536,6 +3536,11 @@ gboolean GtkSalFrame::signalConfigure(GtkWidget*, GdkEventConfigure* pEvent, gpo } #endif +void GtkSalFrame::queue_draw() +{ + gtk_widget_queue_draw(GTK_WIDGET(m_pFixedContainer)); +} + void GtkSalFrame::TriggerPaintEvent() { //Under gtk2 we can basically paint directly into the XWindow and on @@ -3553,7 +3558,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); CallCallbackExc(SalEvent::Paint, &aPaintEvt); - gtk_widget_queue_draw(GTK_WIDGET(m_pFixedContainer)); + queue_draw(); } void GtkSalFrame::DrawingAreaFocusInOut(SalEvent nEventType) diff --git a/vcl/unx/gtk3/salnativewidgets-gtk.cxx b/vcl/unx/gtk3/salnativewidgets-gtk.cxx index 68bf184673e9..fc4ddb0617e0 100644 --- a/vcl/unx/gtk3/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk3/salnativewidgets-gtk.cxx @@ -2783,8 +2783,7 @@ cairo::SurfaceSharedPtr GtkSalGraphics::CreateSurface(const OutputDevice& /*rRef void GtkSalGraphics::WidgetQueueDraw() const { //request gtk to sync the entire contents - GtkWidget *pWidget = GTK_WIDGET(mpFrame->getFixedContainer()); - gtk_widget_queue_draw(pWidget); + mpFrame->queue_draw(); } namespace { |