diff --git a/.gitignore b/.gitignore index 80269d4..337bb41 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ /libreoffice-5.1.1.3.tar.xz /libreoffice-help-5.1.1.3.tar.xz /libreoffice-translations-5.1.1.3.tar.xz +/libreoffice-5.1.2.1.tar.xz +/libreoffice-help-5.1.2.1.tar.xz +/libreoffice-translations-5.1.2.1.tar.xz diff --git a/0001-Related-rhbz-1281906-set-a-min-size-on-un-resizeable.patch b/0001-Related-rhbz-1281906-set-a-min-size-on-un-resizeable.patch deleted file mode 100644 index d216231..0000000 --- a/0001-Related-rhbz-1281906-set-a-min-size-on-un-resizeable.patch +++ /dev/null @@ -1,35 +0,0 @@ -From afeddaf7e0d11ad9b1df0c80bcc3f50caa87e21a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Wed, 16 Dec 2015 10:46:10 +0000 -Subject: [PATCH] Related: rhbz#1281906 set a min size on un-resizeable - non-layout dialogs - -a min size equates to a size-request which is reliable under gtk3+wayland -as the dialog contents size. - -a default size equates to the size of the dialog, which includes decorations -under wayland - -Change-Id: I20baf00fb5952ab93628f4dd6891779ce682783c ---- - vcl/source/window/syswin.cxx | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx -index 8589db6..3f2cde1 100644 ---- a/vcl/source/window/syswin.cxx -+++ b/vcl/source/window/syswin.cxx -@@ -1135,6 +1135,10 @@ void SystemWindow::DoInitialLayout() - mbIsCalculatingInitialLayoutSize = false; - mbInitialLayoutDone = true; - } -+ else if (!(GetStyle() & WB_SIZEABLE)) -+ { -+ SetMinOutputSizePixel(GetSizePixel()); -+ } - } - - void SystemWindow::doDeferredInit(WinBits /*nBits*/) --- -2.5.0 - diff --git a/0001-Resolves-tdf-98636.patch b/0001-Resolves-tdf-98636.patch index e89c0b5..2e20216 100644 --- a/0001-Resolves-tdf-98636.patch +++ b/0001-Resolves-tdf-98636.patch @@ -109,11 +109,15 @@ index 91b7f35..48520c2 100644 g_lo_menu_set_command_to_item_in_section( pMenu, nSection, nItemPos, aCommand ); gchar* aItemCommand = g_strconcat("win.", aCommand, NULL ); -@@ -865,3 +879,4 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection, +@@ -865,6 +879,8 @@ void GtkSalMenu::NativeSetItemCommand( unsigned nSection, + + if (pTarget) + g_variant_unref(pTarget); ++ + return bSubMenuAddedOrRemoved; } - GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* aCommand, gboolean bGetSubmenu ) + GtkSalMenu* GtkSalMenu::GetMenuForItemCommand(gchar* aCommand, int& rDupsToSkip, gboolean bGetSubmenu) -- 2.7.1 diff --git a/0001-gtk3-adapt-to-3.20-style-changes.patch b/0001-gtk3-adapt-to-3.20-style-changes.patch deleted file mode 100644 index 8c419e7..0000000 --- a/0001-gtk3-adapt-to-3.20-style-changes.patch +++ /dev/null @@ -1,1893 +0,0 @@ -From 498897ff72589eeb7107d59650dccc9b66640679 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Mon, 8 Feb 2016 15:59:22 +0000 -Subject: [PATCH] gtk3: adapt to 3.20 style changes - -todo: get rid of the rest of the getStyleContext foo -in favour of additional createStyleContext entries. - -This appears to now render fine on f23 and f24. - -upstream gtk now has a foreign drawing demo in gtk-demo. Stuff we are trying to -do here can be found in a cleaner single-version state there. And additional -demos can be added to keep a reference of how to do this crap up-to-date. - -(cherry picked from commit 03c33a2521421415c4fcbbe1491dc92a1943269b) - -Change-Id: I5ae1a52a2cacc6d8178ed1af30a12536ba828050 ---- - vcl/inc/unx/gtk/gtkgdi.hxx | 75 +- - vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx | 1085 +++++++++++++++++++---------- - 2 files changed, 792 insertions(+), 368 deletions(-) - -diff --git a/vcl/inc/unx/gtk/gtkgdi.hxx b/vcl/inc/unx/gtk/gtkgdi.hxx -index e559385..13ac198 100644 ---- a/vcl/inc/unx/gtk/gtkgdi.hxx -+++ b/vcl/inc/unx/gtk/gtkgdi.hxx -@@ -33,6 +33,43 @@ - #include - #include "textrender.hxx" - -+enum class GtkControlPart -+{ -+ Button, -+ CheckButton, -+ CheckButtonCheck, -+ RadioButton, -+ RadioButtonRadio, -+ Entry, -+ SpinButton, -+ SpinButtonUpButton, -+ SpinButtonDownButton, -+ ScrollbarVertical, -+ ScrollbarHorizontal, -+ ScrollbarTrough, -+ ScrollbarSlider, -+ ScrollbarButton, -+ ProgressBar, -+ ProgressBarTrough, -+ ProgressBarProgress, -+ MenuBar, -+ MenuItem, -+ MenuItemArrow, -+ Menu, -+ CheckMenuItem, -+ CheckMenuItemCheck, -+ RadioMenuItem, -+ RadioMenuItemRadio, -+ SeparatorMenuItem, -+ SeparatorMenuItemSeparator, -+ Notebook, -+ NotebookHeader, -+ NotebookStack, -+ NotebookHeaderTabs, -+ NotebookHeaderTabsTab, -+ FrameBorder, -+}; -+ - class GtkSalGraphics : public SvpSalGraphics - { - GtkSalFrame *mpFrame; -@@ -66,27 +103,47 @@ private: - static GtkStyleContext *mpEntryStyle; - static GtkStyleContext *mpTextViewStyle; - static GtkStyleContext *mpVScrollbarStyle; -+ static GtkStyleContext *mpVScrollbarTroughStyle; -+ static GtkStyleContext *mpVScrollbarSliderStyle; -+ static GtkStyleContext *mpVScrollbarButtonStyle; - static GtkStyleContext *mpHScrollbarStyle; -+ static GtkStyleContext *mpHScrollbarTroughStyle; -+ static GtkStyleContext *mpHScrollbarSliderStyle; -+ static GtkStyleContext *mpHScrollbarButtonStyle; - static GtkStyleContext *mpToolbarStyle; - static GtkStyleContext *mpToolButtonStyle; - static GtkStyleContext *mpToolbarSeperatorStyle; - static GtkStyleContext *mpCheckButtonStyle; -+ static GtkStyleContext *mpRadioButtonStyle; - static GtkStyleContext *mpMenuBarStyle; - static GtkStyleContext *mpMenuBarItemStyle; - static GtkStyleContext *mpMenuStyle; - static GtkStyleContext *mpSpinStyle; -+ static GtkStyleContext *mpSpinUpStyle; -+ static GtkStyleContext *mpSpinDownStyle; -+ static GtkStyleContext *mpMenuItemStyle; -+ static GtkStyleContext *mpMenuItemArrowStyle; - static GtkStyleContext *mpCheckMenuItemStyle; -+ static GtkStyleContext *mpRadioMenuItemStyle; -+ static GtkStyleContext *mpSeparatorMenuItemStyle; - static GtkStyleContext *mpComboboxStyle; - static GtkStyleContext *mpComboboxButtonStyle; - static GtkStyleContext *mpListboxStyle; - static GtkStyleContext *mpListboxButtonStyle; -- static GtkStyleContext *mpNoteBookStyle; - static GtkStyleContext *mpFrameInStyle; - static GtkStyleContext *mpFrameOutStyle; - static GtkStyleContext *mpFixedHoriLineStyle; - static GtkStyleContext *mpFixedVertLineStyle; - static GtkStyleContext *mpTreeHeaderButtonStyle; - static GtkStyleContext *mpProgressBarStyle; -+ static GtkStyleContext *mpProgressBarTroughStyle; -+ static GtkStyleContext *mpProgressBarProgressStyle; -+ static GtkStyleContext *mpNotebookStyle; -+ static GtkStyleContext *mpNotebookStackStyle; -+ static GtkStyleContext *mpNotebookHeaderStyle; -+ static GtkStyleContext *mpNotebookHeaderTabsStyle; -+ static GtkStyleContext *mpNotebookHeaderTabsTabStyle; -+ static GtkStyleContext *mpNotebookHeaderTabsTabLabelStyle; - - static Rectangle NWGetScrollButtonRect( ControlPart nPart, Rectangle aAreaRect ); - static Rectangle NWGetSpinButtonRect( ControlPart nPart, Rectangle aAreaRect); -@@ -116,10 +173,16 @@ private: - ControlType nType, - ControlPart nPart, - const ImplControlValue& aValue); -- static void PaintCheckOrRadio(GtkStyleContext *context, -- cairo_t *cr, -- const Rectangle& rControlRectangle, -- ControlType nType); -+ static void PaintCheckOrRadio(cairo_t *cr, GtkStyleContext *context, -+ const Rectangle& rControlRectangle, -+ bool bIsCheck, bool bInMenu); -+ -+ static void PaintCheck(cairo_t *cr, GtkStyleContext *context, -+ const Rectangle& rControlRectangle, bool bInMenu); -+ -+ static void PaintRadio(cairo_t *cr, GtkStyleContext *context, -+ const Rectangle& rControlRectangle, bool bInMenu); -+ - - static bool style_loaded; - }; -diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx -index a28938e..a6b235b 100644 ---- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx -+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx -@@ -25,64 +25,86 @@ GtkStyleContext* GtkSalGraphics::mpButtonStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpEntryStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpTextViewStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpVScrollbarStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpVScrollbarTroughStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpVScrollbarSliderStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpVScrollbarButtonStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpHScrollbarStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpHScrollbarTroughStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpHScrollbarSliderStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpHScrollbarButtonStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpToolbarStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpToolButtonStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpToolbarSeperatorStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpCheckButtonStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpRadioButtonStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpMenuBarStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpMenuBarItemStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpMenuStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpMenuItemStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpMenuItemArrowStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpCheckMenuItemStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpRadioMenuItemStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpSeparatorMenuItemStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpSpinStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpSpinUpStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpSpinDownStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpComboboxStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpComboboxButtonStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpListboxStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpListboxButtonStyle = nullptr; --GtkStyleContext* GtkSalGraphics::mpNoteBookStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpFrameInStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpFrameOutStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpFixedHoriLineStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpFixedVertLineStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpTreeHeaderButtonStyle = nullptr; - GtkStyleContext* GtkSalGraphics::mpProgressBarStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpProgressBarTroughStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpProgressBarProgressStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpNotebookStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpNotebookStackStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpNotebookHeaderStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpNotebookHeaderTabsStyle = nullptr; -+GtkStyleContext* GtkSalGraphics::mpNotebookHeaderTabsTabStyle = nullptr; - - bool GtkSalGraphics::style_loaded = false; - /************************************************************************ - * State conversion - ************************************************************************/ --static void NWConvertVCLStateToGTKState( ControlState nVCLState, -- GtkStateFlags* nGTKState, GtkShadowType* nGTKShadow ) -+static GtkStateFlags NWConvertVCLStateToGTKState(ControlState nVCLState) - { -- *nGTKShadow = GTK_SHADOW_OUT; -- *nGTKState = GTK_STATE_FLAG_NORMAL; -+ GtkStateFlags nGTKState = GTK_STATE_FLAG_NORMAL; - - if (!( nVCLState & ControlState::ENABLED )) - { -- *nGTKState = GTK_STATE_FLAG_INSENSITIVE; -+ nGTKState = GTK_STATE_FLAG_INSENSITIVE; - } - - if ( nVCLState & ControlState::PRESSED ) - { -- *nGTKState = (GtkStateFlags) (*nGTKState | GTK_STATE_FLAG_ACTIVE); -- *nGTKShadow = GTK_SHADOW_IN; -+ nGTKState = (GtkStateFlags) (nGTKState | GTK_STATE_FLAG_ACTIVE); - } - - if ( nVCLState & ControlState::ROLLOVER ) - { -- *nGTKState = (GtkStateFlags) (*nGTKState | GTK_STATE_FLAG_PRELIGHT); -+ nGTKState = (GtkStateFlags) (nGTKState | GTK_STATE_FLAG_PRELIGHT); - } - - if ( nVCLState & ControlState::SELECTED ) -- *nGTKState = (GtkStateFlags) (*nGTKState | GTK_STATE_FLAG_SELECTED); -+ nGTKState = (GtkStateFlags) (nGTKState | GTK_STATE_FLAG_SELECTED); - - if ( nVCLState & ControlState::FOCUSED ) -- *nGTKState = (GtkStateFlags) (*nGTKState | GTK_STATE_FLAG_FOCUSED); -+ nGTKState = (GtkStateFlags) (nGTKState | GTK_STATE_FLAG_FOCUSED); - - if (AllSettings::GetLayoutRTL()) - { -- *nGTKState = (GtkStateFlags) (*nGTKState | GTK_STATE_FLAG_DIR_RTL); -+ nGTKState = (GtkStateFlags) (nGTKState | GTK_STATE_FLAG_DIR_RTL); - } -+ else -+ { -+ nGTKState = (GtkStateFlags) (nGTKState | GTK_STATE_FLAG_DIR_LTR); -+ } -+ -+ return nGTKState; - } - - enum { -@@ -117,16 +139,13 @@ static void NWCalcArrowRect( const Rectangle& rButton, Rectangle& rArrow ) - - Rectangle GtkSalGraphics::NWGetSpinButtonRect( ControlPart nPart, Rectangle aAreaRect) - { -- gtk_style_context_save(mpSpinStyle); -- gtk_style_context_add_class(mpSpinStyle, GTK_STYLE_CLASS_BUTTON); -- - gint w, h; - gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &w, &h); - gint icon_size = std::max(w, h); - - GtkBorder padding, border; -- gtk_style_context_get_padding(mpSpinStyle, GTK_STATE_FLAG_NORMAL, &padding); -- gtk_style_context_get_border(mpSpinStyle, GTK_STATE_FLAG_NORMAL, &border); -+ gtk_style_context_get_padding(mpSpinUpStyle, gtk_style_context_get_state(mpSpinUpStyle), &padding); -+ gtk_style_context_get_border(mpSpinUpStyle, gtk_style_context_get_state(mpSpinUpStyle), &border); - - gint buttonWidth = icon_size + padding.left + padding.right + - border.left + border.right; -@@ -169,8 +188,6 @@ Rectangle GtkSalGraphics::NWGetSpinButtonRect( ControlPart nPart, Rectangle aAre - partRect.Bottom() = aAreaRect.Bottom(); - } - -- gtk_style_context_restore(mpSpinStyle); -- - return partRect; - } - -@@ -271,7 +288,6 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, - const ScrollbarValue& rScrollbarVal = static_cast(rValue); - Rectangle scrollbarRect; - GtkStateFlags stateFlags; -- GtkShadowType shadowType; - GtkOrientation scrollbarOrientation; - Rectangle thumbRect = rScrollbarVal.maThumbRect; - Rectangle button11BoundRect = rScrollbarVal.maButton1Rect; // backward -@@ -281,8 +297,6 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, - gdouble arrow1Angle; // backward - gdouble arrow2Angle; // forward - Rectangle arrowRect; -- const gchar* button1StyleClass = nullptr; -- const gchar* button2StyleClass = nullptr; - gint slider_width = 0; - gint stepper_size = 0; - gint stepper_spacing = 0; -@@ -332,8 +346,6 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, - scrollbarOrientation = GTK_ORIENTATION_HORIZONTAL; - arrow1Angle = G_PI * 3 / 2; - arrow2Angle = G_PI / 2; -- button1StyleClass = GTK_STYLE_CLASS_LEFT; -- button2StyleClass = GTK_STYLE_CLASS_RIGHT; - - if ( has_backward ) - { -@@ -374,8 +386,6 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, - scrollbarOrientation = GTK_ORIENTATION_VERTICAL; - arrow1Angle = 0; - arrow2Angle = G_PI; -- button1StyleClass = GTK_STYLE_CLASS_TOP; -- button2StyleClass = GTK_STYLE_CLASS_BOTTOM; - - if ( has_backward ) - { -@@ -409,37 +419,34 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, - bool has_slider = ( thumbRect.GetWidth() > 0 && thumbRect.GetHeight() > 0 ); - - // ----------------- TROUGH -- gtk_style_context_save(context); -- gtk_style_context_add_class(context, GTK_STYLE_CLASS_TROUGH); -- gtk_render_background(context, cr, 0, 0, -+ GtkStyleContext* pScrollbarTroughStyle = scrollbarOrientation == GTK_ORIENTATION_VERTICAL ? -+ mpVScrollbarTroughStyle : mpHScrollbarTroughStyle; -+ gtk_render_background(pScrollbarTroughStyle, cr, 0, 0, - scrollbarRect.GetWidth(), scrollbarRect.GetHeight() ); -- gtk_render_frame(context, cr, 0, 0, -+ gtk_render_frame(pScrollbarTroughStyle, cr, 0, 0, - scrollbarRect.GetWidth(), scrollbarRect.GetHeight() ); - -- gtk_style_context_restore(context); -- - // ----------------- THUMB - if ( has_slider ) - { -- NWConvertVCLStateToGTKState( rScrollbarVal.mnThumbState, &stateFlags, &shadowType ); -+ stateFlags = NWConvertVCLStateToGTKState(rScrollbarVal.mnThumbState); - if ( rScrollbarVal.mnThumbState & ControlState::PRESSED ) - stateFlags = (GtkStateFlags) (stateFlags | GTK_STATE_PRELIGHT); - -- gtk_style_context_save(context); -- gtk_style_context_set_state(context, stateFlags); -- gtk_style_context_add_class(context, GTK_STYLE_CLASS_SLIDER); -+ GtkStyleContext* pScrollbarSliderStyle = scrollbarOrientation == GTK_ORIENTATION_VERTICAL ? -+ mpVScrollbarSliderStyle : mpHScrollbarSliderStyle; -+ -+ gtk_style_context_set_state(pScrollbarSliderStyle, stateFlags); - - GtkBorder margin; -- gtk_style_context_get_margin(context, stateFlags, &margin); -+ gtk_style_context_get_margin(pScrollbarSliderStyle, stateFlags, &margin); - - -- gtk_render_slider(context, cr, -+ gtk_render_slider(pScrollbarSliderStyle, cr, - thumbRect.Left() + margin.left, thumbRect.Top() + margin.top, - thumbRect.GetWidth() - margin.left - margin.right, - thumbRect.GetHeight() - margin.top - margin.bottom, - scrollbarOrientation); -- -- gtk_style_context_restore(context); - } - - bool backwardButtonInsensitive = -@@ -450,112 +457,104 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context, - // ----------------- BUTTON 1 - if ( has_backward ) - { -- NWConvertVCLStateToGTKState( rScrollbarVal.mnButton1State, &stateFlags, &shadowType ); -+ stateFlags = NWConvertVCLStateToGTKState(rScrollbarVal.mnButton1State); - if ( backwardButtonInsensitive ) - stateFlags = GTK_STATE_FLAG_INSENSITIVE; - -- gtk_style_context_save(context); -- gtk_style_context_set_state(context, stateFlags); -- gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON); -- gtk_style_context_add_class(context, button1StyleClass); -+ GtkStyleContext* pScrollbarButtonStyle = scrollbarOrientation == GTK_ORIENTATION_VERTICAL ? -+ mpVScrollbarButtonStyle : mpHScrollbarButtonStyle; - -- gtk_render_background(context, cr, -+ gtk_style_context_set_state(pScrollbarButtonStyle, stateFlags); -+ -+ gtk_render_background(pScrollbarButtonStyle, cr, - button11BoundRect.Left(), button11BoundRect.Top(), - button11BoundRect.GetWidth(), button11BoundRect.GetHeight() ); -- gtk_render_frame(context, cr, -+ gtk_render_frame(pScrollbarButtonStyle, cr, - button11BoundRect.Left(), button11BoundRect.Top(), - button11BoundRect.GetWidth(), button11BoundRect.GetHeight() ); - - // ----------------- ARROW 1 - NWCalcArrowRect( button11BoundRect, arrowRect ); -- gtk_render_arrow(context, cr, -+ gtk_render_arrow(pScrollbarButtonStyle, cr, - arrow1Angle, - arrowRect.Left(), arrowRect.Top(), - MIN(arrowRect.GetWidth(), arrowRect.GetHeight()) ); -- -- gtk_style_context_restore(context); - } - if ( has_forward2 ) - { -- NWConvertVCLStateToGTKState( rScrollbarVal.mnButton2State, &stateFlags, &shadowType ); -+ stateFlags = NWConvertVCLStateToGTKState(rScrollbarVal.mnButton2State); - if ( forwardButtonInsensitive ) - stateFlags = GTK_STATE_FLAG_INSENSITIVE; - -- gtk_style_context_save(context); -- gtk_style_context_set_state(context, stateFlags); -- gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON); -- gtk_style_context_add_class(context, button1StyleClass); -+ GtkStyleContext* pScrollbarButtonStyle = scrollbarOrientation == GTK_ORIENTATION_VERTICAL ? -+ mpVScrollbarButtonStyle : mpHScrollbarButtonStyle; -+ -+ gtk_style_context_set_state(pScrollbarButtonStyle, stateFlags); - -- gtk_render_background(context, cr, -+ gtk_render_background(pScrollbarButtonStyle, cr, - button12BoundRect.Left(), button12BoundRect.Top(), - button12BoundRect.GetWidth(), button12BoundRect.GetHeight() ); -- gtk_render_frame(context, cr, -+ gtk_render_frame(pScrollbarButtonStyle, cr, - button12BoundRect.Left(), button12BoundRect.Top(), - button12BoundRect.GetWidth(), button12BoundRect.GetHeight() ); - - // ----------------- ARROW 1 - NWCalcArrowRect( button12BoundRect, arrowRect ); -- gtk_render_arrow(context, cr, -+ gtk_render_arrow(pScrollbarButtonStyle, cr, - arrow2Angle, - arrowRect.Left(), arrowRect.Top(), - MIN(arrowRect.GetWidth(), arrowRect.GetHeight()) ); -- -- gtk_style_context_restore(context); - } - // ----------------- BUTTON 2 - if ( has_backward2 ) - { -- NWConvertVCLStateToGTKState( rScrollbarVal.mnButton1State, &stateFlags, &shadowType ); -+ stateFlags = NWConvertVCLStateToGTKState(rScrollbarVal.mnButton1State); - if ( backwardButtonInsensitive ) - stateFlags = GTK_STATE_FLAG_INSENSITIVE; - -- gtk_style_context_save(context); -- gtk_style_context_set_state(context, stateFlags); -- gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON); -- gtk_style_context_add_class(context, button2StyleClass); -+ GtkStyleContext* pScrollbarButtonStyle = scrollbarOrientation == GTK_ORIENTATION_VERTICAL ? -+ mpVScrollbarButtonStyle : mpHScrollbarButtonStyle; -+ -+ gtk_style_context_set_state(pScrollbarButtonStyle, stateFlags); - -- gtk_render_background(context, cr, -+ gtk_render_background(pScrollbarButtonStyle, cr, - button21BoundRect.Left(), button21BoundRect.Top(), - button21BoundRect.GetWidth(), button21BoundRect.GetHeight() ); -- gtk_render_frame(context, cr, -+ gtk_render_frame(pScrollbarButtonStyle, cr, - button21BoundRect.Left(), button21BoundRect.Top(), - button21BoundRect.GetWidth(), button21BoundRect.GetHeight() ); - - // ----------------- ARROW 2 - NWCalcArrowRect( button21BoundRect, arrowRect ); -- gtk_render_arrow(context, cr, -+ gtk_render_arrow(pScrollbarButtonStyle, cr, - arrow1Angle, - arrowRect.Left(), arrowRect.Top(), - MIN(arrowRect.GetWidth(), arrowRect.GetHeight()) ); -- -- gtk_style_context_restore(context); - } - if ( has_forward ) - { -- NWConvertVCLStateToGTKState( rScrollbarVal.mnButton2State, &stateFlags, &shadowType ); -+ stateFlags = NWConvertVCLStateToGTKState(rScrollbarVal.mnButton2State); - if ( forwardButtonInsensitive ) - stateFlags = GTK_STATE_FLAG_INSENSITIVE; - -- gtk_style_context_save(context); -- gtk_style_context_set_state(context, stateFlags); -- gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON); -- gtk_style_context_add_class(context, button2StyleClass); -+ GtkStyleContext* pScrollbarButtonStyle = scrollbarOrientation == GTK_ORIENTATION_VERTICAL ? -+ mpVScrollbarButtonStyle : mpHScrollbarButtonStyle; - -- gtk_render_background(context, cr, -+ gtk_style_context_set_state(pScrollbarButtonStyle, stateFlags); -+ -+ gtk_render_background(pScrollbarButtonStyle, cr, - button22BoundRect.Left(), button22BoundRect.Top(), - button22BoundRect.GetWidth(), button22BoundRect.GetHeight() ); -- gtk_render_frame(context, cr, -+ gtk_render_frame(pScrollbarButtonStyle, cr, - button22BoundRect.Left(), button22BoundRect.Top(), - button22BoundRect.GetWidth(), button22BoundRect.GetHeight() ); - - // ----------------- ARROW 2 - NWCalcArrowRect( button22BoundRect, arrowRect ); -- gtk_render_arrow(context, cr, -+ gtk_render_arrow(pScrollbarButtonStyle, cr, - arrow2Angle, - arrowRect.Left(), arrowRect.Top(), - MIN(arrowRect.GetWidth(), arrowRect.GetHeight()) ); -- -- gtk_style_context_restore(context); - } - } - -@@ -567,20 +566,15 @@ void GtkSalGraphics::PaintOneSpinButton( GtkStyleContext *context, - ControlState nState ) - { - (void)nType; -- Rectangle buttonRect; -- GtkStateFlags stateFlags; -- GtkShadowType shadowType; - GtkBorder padding, border; - -- NWConvertVCLStateToGTKState( nState, &stateFlags, &shadowType ); -- buttonRect = NWGetSpinButtonRect( nPart, aAreaRect ); -+ GtkStateFlags stateFlags = NWConvertVCLStateToGTKState(nState); -+ Rectangle buttonRect = NWGetSpinButtonRect( nPart, aAreaRect ); - -- gtk_style_context_save(context); - gtk_style_context_set_state(context, stateFlags); -- gtk_style_context_add_class(context, GTK_STYLE_CLASS_BUTTON); - -- gtk_style_context_get_padding(context, GTK_STATE_FLAG_NORMAL, &padding); -- gtk_style_context_get_border(context, GTK_STATE_FLAG_NORMAL, &border); -+ gtk_style_context_get_padding(context, gtk_style_context_get_state(context), &padding); -+ gtk_style_context_get_border(context, gtk_style_context_get_state(context), &border); - - gtk_render_background(context, cr, - buttonRect.Left(), buttonRect.Top(), -@@ -613,8 +607,6 @@ void GtkSalGraphics::PaintOneSpinButton( GtkStyleContext *context, - gtk_render_icon(context, cr, pixbuf, arrowRect.Left(), arrowRect.Top()); - g_object_unref(pixbuf); - gtk_icon_info_free(info); -- -- gtk_style_context_restore(context); - } - - void GtkSalGraphics::PaintSpinButton(GtkStyleContext *context, -@@ -668,14 +662,12 @@ Rectangle GtkSalGraphics::NWGetComboBoxButtonRect( ControlType nType, - (void)nType; - (void)nPart; - Rectangle aButtonRect; -- gint nArrowWidth; -- gint nButtonWidth; -- GtkBorder padding; - -- gtk_style_context_get_padding( mpButtonStyle, GTK_STATE_FLAG_NORMAL, &padding); -+ GtkBorder padding; -+ gtk_style_context_get_padding( mpButtonStyle, gtk_style_context_get_state(mpButtonStyle), &padding); - -- nArrowWidth = ARROW_SIZE; -- nButtonWidth = nArrowWidth + padding.left + padding.right; -+ gint nArrowWidth = ARROW_SIZE; -+ gint nButtonWidth = nArrowWidth + padding.left + padding.right; - if( nPart == PART_BUTTON_DOWN ) - { - Point aPos = Point(aAreaRect.Left() + aAreaRect.GetWidth() - nButtonWidth, aAreaRect.Top()); -@@ -741,7 +733,7 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, cairo_t *cr, - - if( nPart == PART_ENTIRE_CONTROL ) - { -- gtk_style_context_save(mpEntryStyle); -+ GtkJunctionSides eJuncSides = gtk_style_context_get_junction_sides(mpEntryStyle); - gtk_style_context_set_state(mpEntryStyle, flags); - if (AllSettings::GetLayoutRTL()) - gtk_style_context_set_junction_sides(mpEntryStyle, GTK_JUNCTION_LEFT); -@@ -762,8 +754,7 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, cairo_t *cr, - (aEditBoxRect.Left() - areaRect.Left()), - (aEditBoxRect.Top() - areaRect.Top()), - aEditBoxRect.GetWidth(), aEditBoxRect.GetHeight() ); -- -- gtk_style_context_restore(mpEntryStyle); -+ gtk_style_context_set_junction_sides(mpEntryStyle, eJuncSides); - } - - gtk_render_background(mpComboboxButtonStyle, cr, -@@ -820,30 +811,327 @@ void GtkSalGraphics::PaintCombobox( GtkStateFlags flags, cairo_t *cr, - } - } - --void GtkSalGraphics::PaintCheckOrRadio(GtkStyleContext *context, -- cairo_t *cr, -- const Rectangle& rControlRectangle, -- ControlType nType) -+static GtkStyleContext* createStyleContext(GtkControlPart ePart, GtkStyleContext* parent = nullptr) -+{ -+ GtkWidgetPath *path = parent ? gtk_widget_path_copy(gtk_style_context_get_path(parent)) : gtk_widget_path_new(); -+ switch (ePart) -+ { -+ case GtkControlPart::Button: -+ gtk_widget_path_append_type(path, GTK_TYPE_BUTTON); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "button"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_BUTTON); -+#endif -+ break; -+ case GtkControlPart::CheckButton: -+ gtk_widget_path_append_type(path, GTK_TYPE_CHECK_BUTTON); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "checkbutton"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_CHECK); -+#endif -+ break; -+ case GtkControlPart::CheckButtonCheck: -+ gtk_widget_path_append_type(path, GTK_TYPE_CHECK_BUTTON); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "check"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_CHECK); -+#endif -+ break; -+ case GtkControlPart::RadioButton: -+ gtk_widget_path_append_type(path, GTK_TYPE_RADIO_BUTTON); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "radiobutton"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_RADIO); -+#endif -+ break; -+ case GtkControlPart::RadioButtonRadio: -+ gtk_widget_path_append_type(path, GTK_TYPE_RADIO_BUTTON); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "radio"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_RADIO); -+#endif -+ break; -+ case GtkControlPart::Entry: -+ gtk_widget_path_append_type(path, GTK_TYPE_ENTRY); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "entry"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_ENTRY); -+#endif -+ break; -+ case GtkControlPart::SpinButton: -+ gtk_widget_path_append_type(path, GTK_TYPE_SPIN_BUTTON); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "spinbutton"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_SPINBUTTON); -+#endif -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_HORIZONTAL); -+ break; -+ case GtkControlPart::SpinButtonUpButton: -+ case GtkControlPart::SpinButtonDownButton: -+ gtk_widget_path_append_type(path, GTK_TYPE_SPIN_BUTTON); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "button"); -+ gtk_widget_path_iter_add_class(path, -1, ePart == GtkControlPart::SpinButtonUpButton ? "up" : "down"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_SPINBUTTON); -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_BUTTON); -+#endif -+ break; -+ case GtkControlPart::ScrollbarVertical: -+ case GtkControlPart::ScrollbarHorizontal: -+ gtk_widget_path_append_type(path, GTK_TYPE_SCROLLBAR); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "scrollbar"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_SCROLLBAR); -+#endif -+ gtk_widget_path_iter_add_class(path, -1, ePart == GtkControlPart::ScrollbarVertical ? "vertical" : "horizontal"); -+ break; -+ case GtkControlPart::ScrollbarTrough: -+ gtk_widget_path_append_type(path, GTK_TYPE_SCROLLBAR); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "trough"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_SCROLLBAR); -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_TROUGH); -+#endif -+ break; -+ case GtkControlPart::ScrollbarSlider: -+ gtk_widget_path_append_type(path, GTK_TYPE_SCROLLBAR); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "slider"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_SCROLLBAR); -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_SLIDER); -+#endif -+ break; -+ case GtkControlPart::ScrollbarButton: -+ gtk_widget_path_append_type(path, GTK_TYPE_SCROLLBAR); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "button"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_SCROLLBAR); -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_BUTTON); -+#endif -+ break; -+ case GtkControlPart::ProgressBar: -+ gtk_widget_path_append_type(path, GTK_TYPE_PROGRESS_BAR); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "progressbar"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_PROGRESSBAR); -+#endif -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_HORIZONTAL); -+ break; -+ case GtkControlPart::ProgressBarTrough: -+ gtk_widget_path_append_type(path, GTK_TYPE_PROGRESS_BAR); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "trough"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_PROGRESSBAR); -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_TROUGH); -+#endif -+ break; -+ case GtkControlPart::ProgressBarProgress: -+ gtk_widget_path_append_type(path, GTK_TYPE_PROGRESS_BAR); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "progress"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_PROGRESSBAR); -+#endif -+ break; -+ case GtkControlPart::MenuBar: -+ gtk_widget_path_append_type(path, GTK_TYPE_MENU_BAR); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "menubar"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_MENUBAR); -+#endif -+ break; -+ case GtkControlPart::MenuItem: -+ gtk_widget_path_append_type(path, GTK_TYPE_MENU_ITEM); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "menuitem"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_MENUITEM); -+#endif -+ break; -+ case GtkControlPart::MenuItemArrow: -+ gtk_widget_path_append_type(path, GTK_TYPE_MENU_ITEM); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "arrow"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_ARROW); -+#endif -+ break; -+ case GtkControlPart::Menu: -+ gtk_widget_path_append_type(path, GTK_TYPE_MENU); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "menu"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_MENU); -+#endif -+ break; -+ case GtkControlPart::CheckMenuItem: -+ gtk_widget_path_append_type(path, GTK_TYPE_CHECK_MENU_ITEM); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "menuitem"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_MENUITEM); -+#endif -+ break; -+ case GtkControlPart::CheckMenuItemCheck: -+ gtk_widget_path_append_type(path, GTK_TYPE_CHECK_MENU_ITEM); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "check"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_CHECK); -+#endif -+ break; -+ case GtkControlPart::RadioMenuItem: -+ gtk_widget_path_append_type(path, GTK_TYPE_RADIO_MENU_ITEM); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "menuitem"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_MENUITEM); -+#endif -+ break; -+ case GtkControlPart::RadioMenuItemRadio: -+ gtk_widget_path_append_type(path, GTK_TYPE_RADIO_MENU_ITEM); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "radio"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_RADIO); -+#endif -+ break; -+ case GtkControlPart::SeparatorMenuItem: -+ gtk_widget_path_append_type(path, GTK_TYPE_SEPARATOR_MENU_ITEM); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "menuitem"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_MENUITEM); -+#endif -+ break; -+ case GtkControlPart::SeparatorMenuItemSeparator: -+ gtk_widget_path_append_type(path, GTK_TYPE_SEPARATOR_MENU_ITEM); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "separator"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_SEPARATOR); -+#endif -+ break; -+ case GtkControlPart::Notebook: -+ gtk_widget_path_append_type(path, GTK_TYPE_NOTEBOOK); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "notebook"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_NOTEBOOK); -+#endif -+ gtk_widget_path_iter_add_class(path, -1, "frame"); -+ break; -+ case GtkControlPart::NotebookStack: -+ gtk_widget_path_append_type(path, GTK_TYPE_NOTEBOOK); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "stack"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_NOTEBOOK); -+#endif -+ break; -+ case GtkControlPart::NotebookHeader: -+ gtk_widget_path_append_type(path, GTK_TYPE_NOTEBOOK); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "header"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_HEADER); -+#endif -+ gtk_widget_path_iter_add_class(path, -1, "frame"); -+ gtk_widget_path_iter_add_class(path, -1, "top"); -+ break; -+ case GtkControlPart::NotebookHeaderTabs: -+ gtk_widget_path_append_type(path, GTK_TYPE_NOTEBOOK); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "tabs"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_HEADER); -+#endif -+ gtk_widget_path_iter_add_class(path, -1, "top"); -+ break; -+ case GtkControlPart::NotebookHeaderTabsTab: -+ gtk_widget_path_append_type(path, GTK_TYPE_NOTEBOOK); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "tab"); -+#else -+ gtk_widget_path_iter_add_class(path, -1, GTK_STYLE_CLASS_HEADER); -+#endif -+ gtk_widget_path_iter_add_class(path, -1, "top"); -+ break; -+ case GtkControlPart::FrameBorder: -+ gtk_widget_path_append_type(path, GTK_TYPE_FRAME); -+#if GTK_CHECK_VERSION(3, 19, 2) -+ gtk_widget_path_iter_set_object_name(path, -1, "frame"); -+#endif -+ gtk_widget_path_iter_add_class(path, -1, "frame"); -+ break; -+ } -+ -+ GtkStyleContext* context = gtk_style_context_new(); -+ gtk_style_context_set_path(context, path); -+ gtk_style_context_set_parent(context, parent); -+ gtk_widget_path_unref (path); -+ -+#if !GTK_CHECK_VERSION(3, 19, 2) -+ if (ePart == GtkControlPart::NotebookHeaderTabsTab) -+ { -+ gtk_style_context_add_region(context, GTK_STYLE_REGION_TAB, GTK_REGION_ONLY); -+ } -+#endif -+ -+ return context; -+} -+ -+#if GTK_CHECK_VERSION(3,13,7) -+# define CHECKED GTK_STATE_FLAG_CHECKED -+#else -+# define CHECKED GTK_STATE_FLAG_ACTIVE -+#endif -+ -+void GtkSalGraphics::PaintCheckOrRadio(cairo_t *cr, GtkStyleContext *context, -+ const Rectangle& rControlRectangle, bool bIsCheck, bool bInMenu) - { - gint indicator_size; -- gtk_style_context_get_style(mpCheckButtonStyle, -- "indicator-size", &indicator_size, -- NULL); -+ gtk_style_context_get_style(context, "indicator-size", &indicator_size, nullptr); - - gint x = (rControlRectangle.GetWidth() - indicator_size) / 2; - gint y = (rControlRectangle.GetHeight() - indicator_size) / 2; - -- if (nType == CTRL_CHECKBOX) -+ if (!bInMenu) -+ gtk_render_background(context, cr, x, y, indicator_size, indicator_size); -+ gtk_render_frame(context, cr, x, y, indicator_size, indicator_size); -+ -+ if (bIsCheck) - gtk_render_check(context, cr, x, y, indicator_size, indicator_size); -- else if (nType == CTRL_RADIOBUTTON) -+ else - gtk_render_option(context, cr, x, y, indicator_size, indicator_size); - } - --#if GTK_CHECK_VERSION(3,14,0) --# define CHECKED GTK_STATE_FLAG_CHECKED --#else --# define CHECKED GTK_STATE_FLAG_ACTIVE --#endif -+void GtkSalGraphics::PaintCheck(cairo_t *cr, GtkStyleContext *context, -+ const Rectangle& rControlRectangle, bool bInMenu) -+{ -+ PaintCheckOrRadio(cr, context, rControlRectangle, true, bInMenu); -+} -+ -+void GtkSalGraphics::PaintRadio(cairo_t *cr, GtkStyleContext *context, -+ const Rectangle& rControlRectangle, bool bInMenu) -+{ -+ PaintCheckOrRadio(cr, context, rControlRectangle, false, bInMenu); -+} - - static GtkWidget* gCacheWindow; - static GtkWidget* gDumbContainer; -@@ -854,31 +1142,46 @@ static GtkWidget* gComboBoxButtonWidget; - static GtkWidget* gComboBoxEntryWidget; - static GtkWidget* gListBox; - static GtkWidget* gListBoxButtonWidget; --static GtkWidget* gFrameIn; --static GtkWidget* gFrameOut; - static GtkWidget* gMenuBarWidget; - static GtkWidget* gMenuItemMenuBarWidget; - static GtkWidget* gCheckMenuItemWidget; - static GtkWidget* gTreeViewWidget; - -+void parent_styles_context_set_state(GtkStyleContext* context, GtkStateFlags flags) -+{ -+ while ((context = gtk_style_context_get_parent(context))) -+ { -+ gtk_style_context_set_state(context, flags); -+ } -+} -+ -+static gfloat getArrowSize(GtkStyleContext* context) -+{ -+ gfloat arrow_scaling = 1.0; -+ gtk_style_context_get_style(context, "arrow-scaling", &arrow_scaling, nullptr); -+ gfloat arrow_size = 11 * arrow_scaling; -+ return arrow_size; -+} -+ - bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, - ControlState nState, const ImplControlValue& rValue, - const OUString& ) - { -- GtkStateFlags flags; -- GtkShadowType shadow; - gint renderType = nPart == PART_FOCUS ? RENDER_FOCUS : RENDER_BACKGROUND_AND_FRAME; - GtkStyleContext *context = nullptr; -+#if !GTK_CHECK_VERSION(3,19,2) - const gchar *styleClass = nullptr; -+#endif - GdkPixbuf *pixbuf = nullptr; -+ bool bInMenu = false; - -- NWConvertVCLStateToGTKState(nState, &flags, &shadow); -+ GtkStateFlags flags = NWConvertVCLStateToGTKState(nState); - - switch(nType) - { - case CTRL_SPINBOX: - case CTRL_SPINBUTTONS: -- context = mpSpinStyle; -+ context = mpEntryStyle; - renderType = RENDER_SPINBUTTON; - break; - case CTRL_EDITBOX: -@@ -896,42 +1199,58 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co - renderType = nPart == PART_FOCUS ? RENDER_FOCUS : RENDER_COMBOBOX; - break; - case CTRL_MENU_POPUP: -+ bInMenu = true; - - // map selected menu entries in vcl parlance to gtk prelight - if (nPart >= PART_MENU_ITEM && nPart <= PART_MENU_SUBMENU_ARROW && (nState & ControlState::SELECTED)) - flags = (GtkStateFlags) (flags | GTK_STATE_FLAG_PRELIGHT); -- -+ flags = (GtkStateFlags)(flags & ~GTK_STATE_FLAG_ACTIVE); - switch(nPart) - { - case PART_MENU_ITEM: -- styleClass = GTK_STYLE_CLASS_MENUITEM; -- context = mpCheckMenuItemStyle; -+ context = mpMenuItemStyle; - renderType = RENDER_BACKGROUND_AND_FRAME; - break; - case PART_MENU_ITEM_CHECK_MARK: -- styleClass = GTK_STYLE_CLASS_CHECK; -+#if GTK_CHECK_VERSION(3,19,2) - context = mpCheckMenuItemStyle; -+#else -+ context = gtk_widget_get_style_context(gCheckMenuItemWidget); -+ styleClass = GTK_STYLE_CLASS_CHECK; -+#endif - renderType = RENDER_CHECK; - nType = CTRL_CHECKBOX; - if (nState & ControlState::PRESSED) -+ { - flags = (GtkStateFlags)(flags | CHECKED); -+ } - break; - case PART_MENU_ITEM_RADIO_MARK: -+#if GTK_CHECK_VERSION(3,19,2) -+ context = mpRadioMenuItemStyle; -+#else -+ context = gtk_widget_get_style_context(gCheckMenuItemWidget); - styleClass = GTK_STYLE_CLASS_RADIO; -- context = mpCheckMenuItemStyle; -+#endif - renderType = RENDER_RADIO; - nType = CTRL_RADIOBUTTON; - if (nState & ControlState::PRESSED) -+ { - flags = (GtkStateFlags)(flags | CHECKED); -+ } - break; - case PART_MENU_SEPARATOR: -- styleClass = GTK_STYLE_CLASS_SEPARATOR; -- context = mpCheckMenuItemStyle; -+ context = mpSeparatorMenuItemStyle; -+ flags = (GtkStateFlags)(GTK_STATE_FLAG_BACKDROP | GTK_STATE_FLAG_INSENSITIVE); //GTK_STATE_FLAG_BACKDROP hack ? - renderType = RENDER_MENU_SEPERATOR; - break; - case PART_MENU_SUBMENU_ARROW: -+#if GTK_CHECK_VERSION(3,19,2) -+ context = mpMenuItemArrowStyle; -+#else -+ context = gtk_widget_get_style_context(gCheckMenuItemWidget); - styleClass = GTK_STYLE_CLASS_ARROW; -- context = mpCheckMenuItemStyle; -+#endif - renderType = RENDER_ARROW; - break; - case PART_ENTIRE_CONTROL: -@@ -961,22 +1280,20 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co - return false; - } - break; -+ case CTRL_RADIOBUTTON: -+ flags = (GtkStateFlags)(flags | -+ ( (rValue.getTristateVal() == BUTTONVALUE_ON) ? CHECKED : GTK_STATE_FLAG_NORMAL)); -+ context = mpRadioButtonStyle; -+ renderType = nPart == PART_FOCUS ? RENDER_FOCUS : RENDER_RADIO; -+ break; - case CTRL_CHECKBOX: - flags = (GtkStateFlags)(flags | - ( (rValue.getTristateVal() == BUTTONVALUE_ON) ? CHECKED : - (rValue.getTristateVal() == BUTTONVALUE_MIXED) ? GTK_STATE_FLAG_INCONSISTENT : - GTK_STATE_FLAG_NORMAL)); - context = mpCheckButtonStyle; -- styleClass = GTK_STYLE_CLASS_CHECK; - renderType = nPart == PART_FOCUS ? RENDER_FOCUS : RENDER_CHECK; - break; -- case CTRL_RADIOBUTTON: -- flags = (GtkStateFlags)(flags | -- ( (rValue.getTristateVal() == BUTTONVALUE_ON) ? CHECKED : GTK_STATE_FLAG_NORMAL)); -- context = mpCheckButtonStyle; -- styleClass = GTK_STYLE_CLASS_RADIO; -- renderType = nPart == PART_FOCUS ? RENDER_FOCUS : RENDER_RADIO; -- break; - case CTRL_PUSHBUTTON: - context = mpButtonStyle; - break; -@@ -992,21 +1309,20 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co - } - break; - case CTRL_LISTNET: -- case CTRL_TAB_BODY: -- return true; - break; - case CTRL_TAB_PANE: -- context = mpNoteBookStyle; -+ context = mpNotebookStyle; -+ break; -+ case CTRL_TAB_BODY: -+ context = mpNotebookStackStyle; - break; - case CTRL_TAB_HEADER: -- context = mpNoteBookStyle; -- styleClass = GTK_STYLE_CLASS_HEADER; -+ context = mpNotebookHeaderStyle; - break; - case CTRL_TAB_ITEM: -- context = mpNoteBookStyle; -+ context = mpNotebookHeaderTabsTabStyle; - if (nState & ControlState::SELECTED) - flags = (GtkStateFlags) (flags | GTK_STATE_FLAG_ACTIVE); -- - break; - case CTRL_WINDOW_BACKGROUND: - context = gtk_widget_get_style_context(mpWindow); -@@ -1024,7 +1340,6 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co - if (nPart == PART_MENU_ITEM) - { - context = mpMenuBarItemStyle; -- styleClass = GTK_STYLE_CLASS_MENUBAR; - - flags = (!(nState & ControlState::ENABLED)) ? GTK_STATE_FLAG_INSENSITIVE : GTK_STATE_FLAG_NORMAL; - if (nState & ControlState::SELECTED) -@@ -1032,8 +1347,8 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co - } - else - { -- context = gtk_widget_get_style_context(gMenuBarWidget); -- styleClass = GTK_STYLE_CLASS_BACKGROUND; -+ // context = mpMenuBarStyle; why does this not work -+ context = gtk_widget_get_style_context(mpWindow); - } - break; - case CTRL_FIXEDLINE: -@@ -1047,7 +1362,6 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co - if (aButtonValue == BUTTONVALUE_ON) - flags = (GtkStateFlags) (flags | CHECKED); - renderType = RENDER_EXPANDER; -- styleClass = GTK_STYLE_CLASS_EXPANDER; - break; - } - case CTRL_LISTHEADER: -@@ -1061,13 +1375,11 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co - static_cast(0), nullptr); - flags = GTK_STATE_FLAG_SELECTED; - renderType = RENDER_ICON; -- styleClass = GTK_STYLE_CLASS_ARROW; - } - break; - case CTRL_PROGRESS: -- context = mpProgressBarStyle; -+ context = mpProgressBarProgressStyle; - renderType = RENDER_PROGRESS; -- styleClass = GTK_STYLE_CLASS_TROUGH; - break; - default: - return false; -@@ -1077,45 +1389,38 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co - clipRegion(cr); - cairo_translate(cr, rControlRegion.Left(), rControlRegion.Top()); - -+ Rectangle aDamageRect(rControlRegion); -+ - long nX = 0; - long nY = 0; - long nWidth = rControlRegion.GetWidth(); - long nHeight = rControlRegion.GetHeight(); - -- gtk_style_context_save(context); - gtk_style_context_set_state(context, flags); -+ parent_styles_context_set_state(context, flags); - if (nType == CTRL_TAB_ITEM) - { -- -- const TabitemValue& rTabitemValue = static_cast(rValue); -- -- GtkRegionFlags eFlags(GTK_REGION_EVEN); -- if (rTabitemValue.isFirst() && rTabitemValue.isLast()) -- eFlags = GTK_REGION_ONLY; -- else if (rTabitemValue.isFirst()) -- eFlags = GTK_REGION_FIRST; -- else if (rTabitemValue.isLast()) -- eFlags = GTK_REGION_LAST; -- -- gtk_style_context_add_region(mpNoteBookStyle, GTK_STYLE_REGION_TAB, eFlags); -- gtk_style_context_add_class(context, GTK_STYLE_CLASS_TOP); -- -+ GtkBorder margin; -+#if GTK_CHECK_VERSION(3,19,2) -+ gtk_style_context_get_margin(mpNotebookHeaderTabsTabStyle, gtk_style_context_get_state(mpNotebookHeaderTabsTabStyle), &margin); -+#else - gint initial_gap(0); -- gtk_style_context_get_style(mpNoteBookStyle, -+ gtk_style_context_get_style(mpNotebookStyle, - "initial-gap", &initial_gap, - NULL); - -- nX += initial_gap/2; -- nWidth -= initial_gap; -+ margin.left = margin.right = initial_gap/2; -+#endif -+ nX += margin.left; -+ nWidth -= (margin.left + margin.right); - } -+ -+#if !GTK_CHECK_VERSION(3,19,2) - if (styleClass) - { - gtk_style_context_add_class(context, styleClass); - } -- if (nType == CTRL_TAB_HEADER || nType == CTRL_TAB_PANE) -- { -- gtk_style_context_add_class(context, GTK_STYLE_CLASS_FRAME); -- } -+#endif - - switch(renderType) - { -@@ -1128,13 +1433,19 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co - } - break; - case RENDER_CHECK: -+ { -+ PaintCheck(cr, context, rControlRegion, bInMenu); -+ break; -+ } - case RENDER_RADIO: -- PaintCheckOrRadio(context, cr, rControlRegion, nType); -+ { -+ PaintRadio(cr, context, rControlRegion, bInMenu); - break; -+ } - case RENDER_MENU_SEPERATOR: - gtk_render_line(context, cr, -- 3, rControlRegion.GetHeight() / 2, -- rControlRegion.GetWidth() - 3, rControlRegion.GetHeight() / 2); -+ 0, rControlRegion.GetHeight() / 2, -+ rControlRegion.GetWidth() - 1, rControlRegion.GetHeight() / 2); - break; - case RENDER_TOOLBAR_SEPERATOR: - gtk_render_line(context, cr, -@@ -1188,17 +1499,14 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co - } - case RENDER_PROGRESS: - { -- gtk_render_background(context, cr, nX, nY, nWidth, nHeight); -- gtk_render_frame(context, cr, nX, nY, nWidth, nHeight); -+ gtk_render_background(mpProgressBarTroughStyle, cr, nX, nY, nWidth, nHeight); -+ gtk_render_frame(mpProgressBarTroughStyle, cr, nX, nY, nWidth, nHeight); - long nProgressWidth = rValue.getNumericVal(); - if (nProgressWidth) - { - GtkBorder padding; -- gtk_style_context_get_padding(context, GTK_STATE_FLAG_NORMAL, &padding); -+ gtk_style_context_get_padding(context, gtk_style_context_get_state(context), &padding); - -- gtk_style_context_remove_class(context, GTK_STYLE_CLASS_TROUGH); -- gtk_style_context_add_class(context, GTK_STYLE_CLASS_PROGRESSBAR); -- gtk_style_context_add_class(context, GTK_STYLE_CLASS_PULSE); - nX += padding.left; - nY += padding.top; - nHeight -= (padding.top + padding.bottom); -@@ -1213,10 +1521,18 @@ bool GtkSalGraphics::drawNativeControl( ControlType nType, ControlPart nPart, co - break; - } - -- gtk_style_context_restore(context); -+#if !GTK_CHECK_VERSION(3,19,2) -+ if (styleClass) -+ { -+ gtk_style_context_remove_class(context, styleClass); -+ } -+#endif -+ - cairo_surface_flush(cairo_get_target(cr)); - cairo_destroy(cr); // unref -- mpFrame->damaged(basegfx::B2IBox(rControlRegion.Left(), rControlRegion.Top(), rControlRegion.Right(), rControlRegion.Bottom())); -+ -+ if (!aDamageRect.IsEmpty()) -+ mpFrame->damaged(basegfx::B2IBox(aDamageRect.Left(), aDamageRect.Top(), aDamageRect.Right(), aDamageRect.Bottom())); - - return true; - } -@@ -1231,24 +1547,20 @@ Rectangle GetWidgetSize(const Rectangle& rControlRegion, GtkWidget* widget) - - Rectangle AdjustRectForTextBordersPadding(GtkStyleContext* pStyle, long nContentWidth, long nContentHeight, const Rectangle& rControlRegion) - { -- gtk_style_context_save(pStyle); -- - GtkBorder border; -- gtk_style_context_get_border(pStyle, GTK_STATE_FLAG_NORMAL, &border); -+ gtk_style_context_get_border(pStyle, gtk_style_context_get_state(pStyle), &border); - - GtkBorder padding; -- gtk_style_context_get_padding(pStyle, GTK_STATE_FLAG_NORMAL, &padding); -+ gtk_style_context_get_padding(pStyle, gtk_style_context_get_state(pStyle), &padding); - - gint nWidgetHeight = nContentHeight + padding.top + padding.bottom + border.top + border.bottom; -- nWidgetHeight = std::max(nWidgetHeight, rControlRegion.GetHeight()); -+ nWidgetHeight = std::max(std::max(nWidgetHeight, rControlRegion.GetHeight()), 34); - - gint nWidgetWidth = nContentWidth + padding.left + padding.right + border.left + border.right; - nWidgetWidth = std::max(nWidgetWidth, rControlRegion.GetWidth()); - - Rectangle aEditRect(rControlRegion.TopLeft(), Size(nWidgetWidth, nWidgetHeight)); - -- gtk_style_context_restore(pStyle); -- - return aEditRect; - } - -@@ -1265,16 +1577,19 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar - { - rNativeBoundingRegion = rControlRegion; - -- gtk_style_context_get_style( mpCheckButtonStyle, -+ GtkStyleContext *pButtonStyle = (nType == CTRL_CHECKBOX) ? mpCheckButtonStyle : mpRadioButtonStyle; -+ -+ -+ gtk_style_context_get_style( pButtonStyle, - "indicator-size", &indicator_size, - "indicator-spacing", &indicator_spacing, - nullptr ); - - GtkBorder border; -- gtk_style_context_get_border(mpCheckButtonStyle, GTK_STATE_FLAG_NORMAL, &border); -+ gtk_style_context_get_border(pButtonStyle, gtk_style_context_get_state(pButtonStyle), &border); - - GtkBorder padding; -- gtk_style_context_get_padding(mpCheckButtonStyle, GTK_STATE_FLAG_NORMAL, &padding); -+ gtk_style_context_get_padding(pButtonStyle, gtk_style_context_get_state(pButtonStyle), &padding); - - - indicator_size += 2*indicator_spacing + border.left + padding.left + border.right + padding.right; -@@ -1292,7 +1607,9 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar - { - indicator_size = 0; - -- gtk_style_context_get_style( mpCheckMenuItemStyle, -+ GtkStyleContext *pMenuItemStyle = (nType == PART_MENU_ITEM_CHECK_MARK ) ? mpCheckMenuItemStyle : mpRadioMenuItemStyle; -+ -+ gtk_style_context_get_style( pMenuItemStyle, - "indicator-size", &indicator_size, - nullptr ); - -@@ -1304,7 +1621,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar - { - gint separator_height, separator_width, wide_separators; - -- gtk_style_context_get_style (mpCheckMenuItemStyle, -+ gtk_style_context_get_style (mpSeparatorMenuItemStyle, - "wide-separators", &wide_separators, - "separator-width", &separator_width, - "separator-height", &separator_height, -@@ -1315,14 +1632,7 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar - } - else if (nPart == PART_MENU_SUBMENU_ARROW) - { -- gfloat arrow_scaling, arrow_size; -- -- arrow_scaling = 0; -- gtk_style_context_get_style (mpCheckMenuItemStyle, -- "arrow-scaling", &arrow_scaling, -- NULL); -- -- arrow_size = 11 * arrow_scaling; -+ gfloat arrow_size = getArrowSize(mpMenuItemArrowStyle); - aEditRect = Rectangle( aEditRect.TopLeft(), - Size( arrow_size, arrow_size ) ); - } -@@ -1380,18 +1690,11 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar - } - else if (nType == CTRL_TAB_ITEM && nPart == PART_ENTIRE_CONTROL) - { -- gtk_style_context_save(mpNoteBookStyle); -- -- gtk_style_context_add_region(mpNoteBookStyle, GTK_STYLE_REGION_TAB, GTK_REGION_ONLY); -- gtk_style_context_add_class(mpNoteBookStyle, GTK_STYLE_CLASS_TOP); -- - const TabitemValue& rTabitemValue = static_cast(rValue); - const Rectangle& rTabitemRect = rTabitemValue.getContentRect(); - -- aEditRect = AdjustRectForTextBordersPadding(mpNoteBookStyle, rTabitemRect.GetWidth(), -+ aEditRect = AdjustRectForTextBordersPadding(mpNotebookHeaderTabsTabStyle, rTabitemRect.GetWidth(), - rTabitemRect.GetHeight(), rControlRegion); -- -- gtk_style_context_restore(mpNoteBookStyle); - } - else if (nType == CTRL_FRAME && nPart == PART_BORDER) - { -@@ -1399,14 +1702,11 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar - DrawFrameFlags nStyle = static_cast(rValue.getNumericVal() & 0xfff0); - if (nStyle & DrawFrameFlags::NoDraw) - { -- gtk_style_context_save(mpFrameInStyle); -- gtk_style_context_add_class(mpFrameInStyle, GTK_STYLE_CLASS_FRAME); -- - GtkBorder padding; -- gtk_style_context_get_padding(mpFrameInStyle, GTK_STATE_FLAG_NORMAL, &padding); -+ gtk_style_context_get_padding(mpFrameInStyle, gtk_style_context_get_state(mpFrameInStyle), &padding); - - GtkBorder border; -- gtk_style_context_get_border(mpFrameInStyle, GTK_STATE_FLAG_NORMAL, &border); -+ gtk_style_context_get_border(mpFrameInStyle, gtk_style_context_get_state(mpFrameInStyle), &border); - - int x1 = aEditRect.Left(); - int y1 = aEditRect.Top(); -@@ -1419,7 +1719,6 @@ bool GtkSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPar - x2 - (padding.right + border.right), - y2 - (padding.bottom + border.bottom)); - -- gtk_style_context_restore(mpFrameInStyle); - return true; - } - else -@@ -1457,7 +1756,8 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) - - // text colors - GdkRGBA text_color; -- gtk_style_context_get_color(pStyle, GTK_STATE_FLAG_NORMAL, &text_color); -+ gtk_style_context_set_state(pStyle, GTK_STATE_FLAG_NORMAL); -+ gtk_style_context_get_color(pStyle, gtk_style_context_get_state(pStyle), &text_color); - ::Color aTextColor = getColor( text_color ); - aStyleSet.SetDialogTextColor( aTextColor ); - aStyleSet.SetButtonTextColor( aTextColor ); -@@ -1468,15 +1768,9 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) - aStyleSet.SetWindowTextColor( aTextColor ); - aStyleSet.SetFieldTextColor( aTextColor ); - -- // mouse over text colors -- gtk_style_context_get_color(pStyle, GTK_STATE_FLAG_PRELIGHT, &text_color); -- aTextColor = getColor( text_color ); -- aStyleSet.SetButtonRolloverTextColor( aTextColor ); -- aStyleSet.SetFieldRolloverTextColor( aTextColor ); -- - // background colors - GdkRGBA background_color; -- gtk_style_context_get_background_color(pStyle, GTK_STATE_FLAG_NORMAL, &background_color); -+ gtk_style_context_get_background_color(pStyle, gtk_style_context_get_state(pStyle), &background_color); - - ::Color aBackColor = getColor( background_color ); - aStyleSet.Set3DColors( aBackColor ); -@@ -1485,6 +1779,106 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) - aStyleSet.SetWorkspaceColor( aBackColor ); - aStyleSet.SetCheckedColorSpecialCase( ); - -+ // UI font -+ const PangoFontDescription* font = gtk_style_context_get_font(pStyle, gtk_style_context_get_state(pStyle)); -+ OString aFamily = pango_font_description_get_family( font ); -+ int nPangoHeight = pango_font_description_get_size( font ); -+ PangoStyle eStyle = pango_font_description_get_style( font ); -+ PangoWeight eWeight = pango_font_description_get_weight( font ); -+ PangoStretch eStretch = pango_font_description_get_stretch( font ); -+ -+ psp::FastPrintFontInfo aInfo; -+ // set family name -+ aInfo.m_aFamilyName = OStringToOUString( aFamily, RTL_TEXTENCODING_UTF8 ); -+ // set italic -+ switch( eStyle ) -+ { -+ case PANGO_STYLE_NORMAL: aInfo.m_eItalic = ITALIC_NONE;break; -+ case PANGO_STYLE_ITALIC: aInfo.m_eItalic = ITALIC_NORMAL;break; -+ case PANGO_STYLE_OBLIQUE: aInfo.m_eItalic = ITALIC_OBLIQUE;break; -+ } -+ // set weight -+ if( eWeight <= PANGO_WEIGHT_ULTRALIGHT ) -+ aInfo.m_eWeight = WEIGHT_ULTRALIGHT; -+ else if( eWeight <= PANGO_WEIGHT_LIGHT ) -+ aInfo.m_eWeight = WEIGHT_LIGHT; -+ else if( eWeight <= PANGO_WEIGHT_NORMAL ) -+ aInfo.m_eWeight = WEIGHT_NORMAL; -+ else if( eWeight <= PANGO_WEIGHT_BOLD ) -+ aInfo.m_eWeight = WEIGHT_BOLD; -+ else -+ aInfo.m_eWeight = WEIGHT_ULTRABOLD; -+ // set width -+ switch( eStretch ) -+ { -+ case PANGO_STRETCH_ULTRA_CONDENSED: aInfo.m_eWidth = WIDTH_ULTRA_CONDENSED;break; -+ case PANGO_STRETCH_EXTRA_CONDENSED: aInfo.m_eWidth = WIDTH_EXTRA_CONDENSED;break; -+ case PANGO_STRETCH_CONDENSED: aInfo.m_eWidth = WIDTH_CONDENSED;break; -+ case PANGO_STRETCH_SEMI_CONDENSED: aInfo.m_eWidth = WIDTH_SEMI_CONDENSED;break; -+ case PANGO_STRETCH_NORMAL: aInfo.m_eWidth = WIDTH_NORMAL;break; -+ case PANGO_STRETCH_SEMI_EXPANDED: aInfo.m_eWidth = WIDTH_SEMI_EXPANDED;break; -+ case PANGO_STRETCH_EXPANDED: aInfo.m_eWidth = WIDTH_EXPANDED;break; -+ case PANGO_STRETCH_EXTRA_EXPANDED: aInfo.m_eWidth = WIDTH_EXTRA_EXPANDED;break; -+ case PANGO_STRETCH_ULTRA_EXPANDED: aInfo.m_eWidth = WIDTH_ULTRA_EXPANDED;break; -+ } -+ -+#if OSL_DEBUG_LEVEL > 1 -+ fprintf( stderr, "font name BEFORE system match: \"%s\"\n", aFamily.getStr() ); -+#endif -+ -+ // match font to e.g. resolve "Sans" -+ psp::PrintFontManager::get().matchFont( aInfo, rSettings.GetUILanguageTag().getLocale() ); -+ -+#if OSL_DEBUG_LEVEL > 1 -+ fprintf( stderr, "font match %s, name AFTER: \"%s\"\n", -+ aInfo.m_nID != 0 ? "succeeded" : "failed", -+ OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); -+#endif -+ -+ int nPointHeight = 0; -+ /*sal_Int32 nDispDPIY = GetDisplay()->GetResolution().B(); -+ static gboolean(*pAbso)(const PangoFontDescription*) = -+ (gboolean(*)(const PangoFontDescription*))osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "pango_font_description_get_size_is_absolute" ); -+ -+ if( pAbso && pAbso( font ) ) -+ nPointHeight = (nPangoHeight * 72 + nDispDPIY*PANGO_SCALE/2) / (nDispDPIY * PANGO_SCALE); -+ else*/ -+ nPointHeight = nPangoHeight/PANGO_SCALE; -+ -+ vcl::Font aFont( aInfo.m_aFamilyName, Size( 0, nPointHeight ) ); -+ if( aInfo.m_eWeight != WEIGHT_DONTKNOW ) -+ aFont.SetWeight( aInfo.m_eWeight ); -+ if( aInfo.m_eWidth != WIDTH_DONTKNOW ) -+ aFont.SetWidthType( aInfo.m_eWidth ); -+ if( aInfo.m_eItalic != ITALIC_DONTKNOW ) -+ aFont.SetItalic( aInfo.m_eItalic ); -+ if( aInfo.m_ePitch != PITCH_DONTKNOW ) -+ aFont.SetPitch( aInfo.m_ePitch ); -+ -+ aStyleSet.SetAppFont( aFont ); -+ aStyleSet.SetHelpFont( aFont ); -+ aStyleSet.SetMenuFont( aFont ); -+ aStyleSet.SetToolFont( aFont ); -+ aStyleSet.SetLabelFont( aFont ); -+ aStyleSet.SetInfoFont( aFont ); -+ aStyleSet.SetRadioCheckFont( aFont ); -+ aStyleSet.SetPushButtonFont( aFont ); -+ aStyleSet.SetFieldFont( aFont ); -+ aStyleSet.SetIconFont( aFont ); -+ aStyleSet.SetGroupFont( aFont ); -+ -+ aFont.SetWeight( WEIGHT_BOLD ); -+ aStyleSet.SetTabFont( aFont ); //pull from notebook style + GTK_STYLE_REGION_TAB ? -+ aStyleSet.SetTitleFont( aFont ); -+ aStyleSet.SetFloatTitleFont( aFont ); -+ -+ // mouse over text colors -+ gtk_style_context_set_state(pStyle, GTK_STATE_FLAG_PRELIGHT); -+ gtk_style_context_get_color(pStyle, gtk_style_context_get_state(pStyle), &text_color); -+ aTextColor = getColor( text_color ); -+ aStyleSet.SetButtonRolloverTextColor( aTextColor ); -+ aStyleSet.SetFieldRolloverTextColor( aTextColor ); -+ - // tooltip colors - { - GtkStyleContext *pCStyle = gtk_style_context_new(); -@@ -1501,8 +1895,9 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) - gtk_widget_path_free(pCPath); - - GdkRGBA tooltip_bg_color, tooltip_fg_color; -- gtk_style_context_get_color(pCStyle, GTK_STATE_FLAG_NORMAL, &tooltip_fg_color); -- gtk_style_context_get_background_color(pCStyle, GTK_STATE_FLAG_NORMAL, &tooltip_bg_color); -+ gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_NORMAL); -+ gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &tooltip_fg_color); -+ gtk_style_context_get_background_color(pCStyle, gtk_style_context_get_state(pCStyle), &tooltip_bg_color); - g_object_unref( pCStyle ); - - aStyleSet.SetHelpColor( getColor( tooltip_bg_color )); -@@ -1520,16 +1915,18 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) - gtk_widget_path_free( pCPath ); - - // highlighting colors -- gtk_style_context_get_background_color(pCStyle, GTK_STATE_FLAG_SELECTED, &text_color); -+ gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_SELECTED); -+ gtk_style_context_get_background_color(pCStyle, gtk_style_context_get_state(pCStyle), &text_color); - ::Color aHighlightColor = getColor( text_color ); -- gtk_style_context_get_color(pCStyle, GTK_STATE_FLAG_SELECTED, &text_color); -+ gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &text_color); - ::Color aHighlightTextColor = getColor( text_color ); - aStyleSet.SetHighlightColor( aHighlightColor ); - aStyleSet.SetHighlightTextColor( aHighlightTextColor ); - - // field background color - GdkRGBA field_background_color; -- gtk_style_context_get_background_color(pCStyle, GTK_STATE_FLAG_NORMAL, &field_background_color); -+ gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_NORMAL); -+ gtk_style_context_get_background_color(pCStyle, gtk_style_context_get_state(pCStyle), &field_background_color); - g_object_unref( pCStyle ); - - ::Color aBackFieldColor = getColor( field_background_color ); -@@ -1543,30 +1940,34 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) - aStyleSet.SetAcceleratorsInContextMenus( false ); - - // menu colors -- gtk_style_context_get_background_color( mpMenuStyle, GTK_STATE_FLAG_NORMAL, &background_color ); -+ gtk_style_context_set_state(mpMenuStyle, GTK_STATE_FLAG_NORMAL); -+ gtk_style_context_get_background_color( mpMenuStyle, gtk_style_context_get_state(mpMenuStyle), &background_color ); - aBackColor = getColor( background_color ); - aStyleSet.SetMenuColor( aBackColor ); - -+ // menu items -+ gtk_style_context_get_color( mpMenuStyle, gtk_style_context_get_state(mpMenuStyle), &color ); -+ aTextColor = getColor( color ); -+ aStyleSet.SetMenuTextColor( aTextColor ); -+ - // menu bar -- gtk_style_context_get_background_color( mpMenuBarStyle, GTK_STATE_FLAG_NORMAL, &background_color ); -+ gtk_style_context_set_state(mpMenuBarStyle, GTK_STATE_FLAG_NORMAL); -+ gtk_style_context_get_background_color( mpMenuBarStyle, gtk_style_context_get_state(mpMenuBarStyle), &background_color ); - aBackColor = getColor( background_color ); - aStyleSet.SetMenuBarColor( aBackColor ); - aStyleSet.SetMenuBarRolloverColor( aBackColor ); - -- gtk_style_context_get_color( mpMenuBarItemStyle, GTK_STATE_FLAG_NORMAL, &text_color ); -+ gtk_style_context_set_state(mpMenuBarItemStyle, GTK_STATE_FLAG_NORMAL); -+ gtk_style_context_get_color( mpMenuBarItemStyle, gtk_style_context_get_state(mpMenuBarItemStyle), &text_color ); - aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or( getColor( text_color ) ); - aStyleSet.SetMenuBarTextColor( aTextColor ); - aStyleSet.SetMenuBarRolloverTextColor( aTextColor ); - -- gtk_style_context_get_color( mpMenuBarItemStyle, GTK_STATE_FLAG_PRELIGHT, &text_color ); -+ gtk_style_context_set_state(mpMenuBarItemStyle, GTK_STATE_FLAG_PRELIGHT); -+ gtk_style_context_get_color( mpMenuBarItemStyle, gtk_style_context_get_state(mpMenuBarItemStyle), &text_color ); - aTextColor = aStyleSet.GetPersonaMenuBarTextColor().get_value_or( getColor( text_color ) ); - aStyleSet.SetMenuBarHighlightTextColor( aTextColor ); - -- // menu items -- gtk_style_context_get_color( mpMenuStyle, GTK_STATE_FLAG_NORMAL, &color ); -- aTextColor = getColor( color ); -- aStyleSet.SetMenuTextColor( aTextColor ); -- - // Awful hack for menu separators in the Sonar and similar themes. - // If the menu color is not too dark, and the menu text color is lighter, - // make the "light" color lighter than the menu color and the "shadow" -@@ -1582,11 +1983,12 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) - aStyleSet.SetShadowColor( temp ); - } - -- gtk_style_context_get_background_color( mpCheckMenuItemStyle, GTK_STATE_FLAG_PRELIGHT, &background_color ); -+ gtk_style_context_set_state(mpMenuItemStyle, GTK_STATE_FLAG_PRELIGHT); -+ gtk_style_context_get_background_color( mpMenuItemStyle, gtk_style_context_get_state(mpMenuItemStyle), &background_color ); - ::Color aHighlightColor = getColor( background_color ); - aStyleSet.SetMenuHighlightColor( aHighlightColor ); - -- gtk_style_context_get_color( mpCheckMenuItemStyle, GTK_STATE_FLAG_PRELIGHT, &color ); -+ gtk_style_context_get_color( mpMenuItemStyle, gtk_style_context_get_state(mpMenuItemStyle), &color ); - ::Color aHighlightTextColor = getColor( color ); - aStyleSet.SetMenuHighlightTextColor( aHighlightTextColor ); - -@@ -1609,6 +2011,27 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) - gdk_color_free(link_color); - } - -+#if GTK_CHECK_VERSION(3, 19, 2) -+ { -+ GtkStyleContext *pCStyle = mpNotebookHeaderTabsTabStyle; -+ -+ gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_NORMAL); -+ gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &text_color); -+ aTextColor = getColor( text_color ); -+ aStyleSet.SetTabTextColor(aTextColor); -+ -+ // mouse over text colors -+ gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_PRELIGHT); -+ gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &text_color); -+ aTextColor = getColor( text_color ); -+ aStyleSet.SetTabRolloverTextColor(aTextColor); -+ -+ gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_ACTIVE); -+ gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &text_color); -+ aTextColor = getColor( text_color ); -+ aStyleSet.SetTabHighlightTextColor(aTextColor); -+ } -+#else - { - GtkStyleContext *pCStyle = gtk_style_context_new(); - gtk_style_context_set_screen( pCStyle, gtk_window_get_screen( GTK_WINDOW( mpWindow ) ) ); -@@ -1624,118 +2047,30 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings ) - gtk_style_context_set_path(pCStyle, pCPath); - gtk_widget_path_free(pCPath); - -- gtk_style_context_get_color(pCStyle, GTK_STATE_FLAG_NORMAL, &text_color); -+ gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_NORMAL); -+ gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &text_color); - aTextColor = getColor( text_color ); - aStyleSet.SetTabTextColor(aTextColor); - - // mouse over text colors - gtk_style_context_add_class(pCStyle, "prelight-page"); -- gtk_style_context_get_color(pCStyle, GTK_STATE_FLAG_PRELIGHT, &text_color); -+ gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_PRELIGHT); -+ gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &text_color); - gtk_style_context_remove_class(pCStyle, "prelight-page"); - aTextColor = getColor( text_color ); - aStyleSet.SetTabRolloverTextColor(aTextColor); - - gtk_style_context_add_class(pCStyle, "active-page"); -- gtk_style_context_get_color(pCStyle, GTK_STATE_FLAG_ACTIVE, &text_color); -+ gtk_style_context_set_state(pCStyle, GTK_STATE_FLAG_ACTIVE); -+ gtk_style_context_get_color(pCStyle, gtk_style_context_get_state(pCStyle), &text_color); - gtk_style_context_remove_class(pCStyle, "active-page"); - aTextColor = getColor( text_color ); - aStyleSet.SetTabHighlightTextColor(aTextColor); - - g_object_unref( pCStyle ); -- } -- -- // UI font -- const PangoFontDescription* font = gtk_style_context_get_font(pStyle, GTK_STATE_FLAG_NORMAL); -- OString aFamily = pango_font_description_get_family( font ); -- int nPangoHeight = pango_font_description_get_size( font ); -- PangoStyle eStyle = pango_font_description_get_style( font ); -- PangoWeight eWeight = pango_font_description_get_weight( font ); -- PangoStretch eStretch = pango_font_description_get_stretch( font ); -- -- psp::FastPrintFontInfo aInfo; -- // set family name -- aInfo.m_aFamilyName = OStringToOUString( aFamily, RTL_TEXTENCODING_UTF8 ); -- // set italic -- switch( eStyle ) -- { -- case PANGO_STYLE_NORMAL: aInfo.m_eItalic = ITALIC_NONE;break; -- case PANGO_STYLE_ITALIC: aInfo.m_eItalic = ITALIC_NORMAL;break; -- case PANGO_STYLE_OBLIQUE: aInfo.m_eItalic = ITALIC_OBLIQUE;break; -- } -- // set weight -- if( eWeight <= PANGO_WEIGHT_ULTRALIGHT ) -- aInfo.m_eWeight = WEIGHT_ULTRALIGHT; -- else if( eWeight <= PANGO_WEIGHT_LIGHT ) -- aInfo.m_eWeight = WEIGHT_LIGHT; -- else if( eWeight <= PANGO_WEIGHT_NORMAL ) -- aInfo.m_eWeight = WEIGHT_NORMAL; -- else if( eWeight <= PANGO_WEIGHT_BOLD ) -- aInfo.m_eWeight = WEIGHT_BOLD; -- else -- aInfo.m_eWeight = WEIGHT_ULTRABOLD; -- // set width -- switch( eStretch ) -- { -- case PANGO_STRETCH_ULTRA_CONDENSED: aInfo.m_eWidth = WIDTH_ULTRA_CONDENSED;break; -- case PANGO_STRETCH_EXTRA_CONDENSED: aInfo.m_eWidth = WIDTH_EXTRA_CONDENSED;break; -- case PANGO_STRETCH_CONDENSED: aInfo.m_eWidth = WIDTH_CONDENSED;break; -- case PANGO_STRETCH_SEMI_CONDENSED: aInfo.m_eWidth = WIDTH_SEMI_CONDENSED;break; -- case PANGO_STRETCH_NORMAL: aInfo.m_eWidth = WIDTH_NORMAL;break; -- case PANGO_STRETCH_SEMI_EXPANDED: aInfo.m_eWidth = WIDTH_SEMI_EXPANDED;break; -- case PANGO_STRETCH_EXPANDED: aInfo.m_eWidth = WIDTH_EXPANDED;break; -- case PANGO_STRETCH_EXTRA_EXPANDED: aInfo.m_eWidth = WIDTH_EXTRA_EXPANDED;break; -- case PANGO_STRETCH_ULTRA_EXPANDED: aInfo.m_eWidth = WIDTH_ULTRA_EXPANDED;break; -- } -- --#if OSL_DEBUG_LEVEL > 1 -- fprintf( stderr, "font name BEFORE system match: \"%s\"\n", aFamily.getStr() ); -+ } - #endif - -- // match font to e.g. resolve "Sans" -- psp::PrintFontManager::get().matchFont( aInfo, rSettings.GetUILanguageTag().getLocale() ); -- --#if OSL_DEBUG_LEVEL > 1 -- fprintf( stderr, "font match %s, name AFTER: \"%s\"\n", -- aInfo.m_nID != 0 ? "succeeded" : "failed", -- OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); --#endif -- -- int nPointHeight = 0; -- /*sal_Int32 nDispDPIY = GetDisplay()->GetResolution().B(); -- static gboolean(*pAbso)(const PangoFontDescription*) = -- (gboolean(*)(const PangoFontDescription*))osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "pango_font_description_get_size_is_absolute" ); -- -- if( pAbso && pAbso( font ) ) -- nPointHeight = (nPangoHeight * 72 + nDispDPIY*PANGO_SCALE/2) / (nDispDPIY * PANGO_SCALE); -- else*/ -- nPointHeight = nPangoHeight/PANGO_SCALE; -- -- vcl::Font aFont( aInfo.m_aFamilyName, Size( 0, nPointHeight ) ); -- if( aInfo.m_eWeight != WEIGHT_DONTKNOW ) -- aFont.SetWeight( aInfo.m_eWeight ); -- if( aInfo.m_eWidth != WIDTH_DONTKNOW ) -- aFont.SetWidthType( aInfo.m_eWidth ); -- if( aInfo.m_eItalic != ITALIC_DONTKNOW ) -- aFont.SetItalic( aInfo.m_eItalic ); -- if( aInfo.m_ePitch != PITCH_DONTKNOW ) -- aFont.SetPitch( aInfo.m_ePitch ); -- -- aStyleSet.SetAppFont( aFont ); -- aStyleSet.SetHelpFont( aFont ); -- aStyleSet.SetMenuFont( aFont ); -- aStyleSet.SetToolFont( aFont ); -- aStyleSet.SetLabelFont( aFont ); -- aStyleSet.SetInfoFont( aFont ); -- aStyleSet.SetRadioCheckFont( aFont ); -- aStyleSet.SetPushButtonFont( aFont ); -- aStyleSet.SetFieldFont( aFont ); -- aStyleSet.SetIconFont( aFont ); -- aStyleSet.SetGroupFont( aFont ); -- -- aFont.SetWeight( WEIGHT_BOLD ); -- aStyleSet.SetTabFont( aFont ); //pull from notebook style + GTK_STYLE_REGION_TAB ? -- aStyleSet.SetTitleFont( aFont ); -- aStyleSet.SetFloatTitleFont( aFont ); - // get cursor blink time - gboolean blink = false; - -@@ -2007,9 +2342,12 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) - gtk_widget_realize(gCacheWindow); - - gEntryBox = gtk_entry_new(); -- getStyleContext(&mpEntryStyle, gEntryBox); -+ gtk_container_add(GTK_CONTAINER(gDumbContainer), gEntryBox); -+ mpEntryStyle = createStyleContext(GtkControlPart::Entry); -+ - getStyleContext(&mpTextViewStyle, gtk_text_view_new()); -- getStyleContext(&mpButtonStyle, gtk_button_new()); -+ -+ mpButtonStyle = createStyleContext(GtkControlPart::Button); - - GtkWidget* pToolbar = gtk_toolbar_new(); - mpToolbarStyle = gtk_widget_get_style_context(pToolbar); -@@ -2025,36 +2363,64 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) - gtk_toolbar_insert(GTK_TOOLBAR(pToolbar), item, -1); - mpToolButtonStyle = gtk_widget_get_style_context(GTK_WIDGET(pButton)); - -- getStyleContext(&mpVScrollbarStyle, gtk_scrollbar_new(GTK_ORIENTATION_VERTICAL, nullptr)); -- gtk_style_context_add_class(mpVScrollbarStyle, GTK_STYLE_CLASS_SCROLLBAR); -- getStyleContext(&mpHScrollbarStyle, gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, nullptr)); -- gtk_style_context_add_class(mpHScrollbarStyle, GTK_STYLE_CLASS_SCROLLBAR); -+ mpVScrollbarStyle = createStyleContext(GtkControlPart::ScrollbarVertical); -+ mpVScrollbarTroughStyle = createStyleContext(GtkControlPart::ScrollbarTrough, mpVScrollbarStyle); -+ mpVScrollbarSliderStyle = createStyleContext(GtkControlPart::ScrollbarSlider, mpVScrollbarTroughStyle); -+ mpVScrollbarButtonStyle = createStyleContext(GtkControlPart::ScrollbarButton, mpVScrollbarStyle); -+ mpHScrollbarStyle = createStyleContext(GtkControlPart::ScrollbarHorizontal); -+ mpHScrollbarTroughStyle = createStyleContext(GtkControlPart::ScrollbarTrough, mpHScrollbarStyle); -+ mpHScrollbarSliderStyle = createStyleContext(GtkControlPart::ScrollbarSlider, mpHScrollbarTroughStyle); -+ mpHScrollbarButtonStyle = createStyleContext(GtkControlPart::ScrollbarButton, mpHScrollbarStyle); - -- getStyleContext(&mpCheckButtonStyle, gtk_check_button_new()); -+ { -+ GtkStyleContext* parentContext = createStyleContext(GtkControlPart::CheckButton); -+ mpCheckButtonStyle = createStyleContext(GtkControlPart::CheckButtonCheck, parentContext); -+ g_object_unref(parentContext); -+ } -+ -+ { -+ GtkStyleContext* parentContext = createStyleContext(GtkControlPart::RadioButton); -+ mpRadioButtonStyle = createStyleContext(GtkControlPart::RadioButtonRadio, parentContext); -+ g_object_unref(parentContext); -+ } - - /* Menu bar */ - gMenuBarWidget = gtk_menu_bar_new(); - gMenuItemMenuBarWidget = gtk_menu_item_new_with_label( "b" ); - gtk_menu_shell_append(GTK_MENU_SHELL(gMenuBarWidget), gMenuItemMenuBarWidget); -- getStyleContext(&mpMenuBarStyle, gMenuBarWidget); -- mpMenuBarItemStyle = gtk_widget_get_style_context(gMenuItemMenuBarWidget); -+ gtk_container_add(GTK_CONTAINER(gDumbContainer), gMenuBarWidget); -+ -+ mpMenuBarStyle = createStyleContext(GtkControlPart::MenuBar, gtk_widget_get_style_context(mpWindow)); -+ mpMenuBarItemStyle = createStyleContext(GtkControlPart::MenuItem, mpMenuBarStyle); - - /* Menu */ -+ mpMenuStyle = createStyleContext(GtkControlPart::Menu, gtk_widget_get_style_context(mpWindow)); - GtkWidget *menu = gtk_menu_new(); -- mpMenuStyle = gtk_widget_get_style_context(menu); - gtk_menu_item_set_submenu(GTK_MENU_ITEM(gMenuItemMenuBarWidget), menu); - - /* Menu Items */ - gCheckMenuItemWidget = gtk_check_menu_item_new_with_label("M"); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), gCheckMenuItemWidget); -- mpCheckMenuItemStyle = gtk_widget_get_style_context(gCheckMenuItemWidget); -+ -+ mpMenuItemStyle = createStyleContext(GtkControlPart::MenuItem, mpMenuStyle); -+ mpMenuItemArrowStyle = createStyleContext(GtkControlPart::MenuItemArrow, mpMenuItemStyle); -+ mpCheckMenuItemStyle = createStyleContext(GtkControlPart::CheckMenuItemCheck, mpMenuItemStyle); -+ mpRadioMenuItemStyle = createStyleContext(GtkControlPart::RadioMenuItemRadio, mpMenuItemStyle); -+ mpSeparatorMenuItemStyle = createStyleContext(GtkControlPart::SeparatorMenuItemSeparator, mpMenuItemStyle); - - /* Spinbutton */ - gSpinBox = gtk_spin_button_new(nullptr, 0, 0); -- getStyleContext(&mpSpinStyle, gSpinBox); -+ gtk_container_add(GTK_CONTAINER(gDumbContainer), gSpinBox); -+ mpSpinStyle = createStyleContext(GtkControlPart::SpinButton); -+ mpSpinUpStyle = createStyleContext(GtkControlPart::SpinButtonUpButton, mpSpinStyle); -+ mpSpinDownStyle = createStyleContext(GtkControlPart::SpinButtonDownButton, mpSpinStyle); - - /* NoteBook */ -- getStyleContext(&mpNoteBookStyle, gtk_notebook_new()); -+ mpNotebookStyle = createStyleContext(GtkControlPart::Notebook); -+ mpNotebookStackStyle = createStyleContext(GtkControlPart::NotebookStack, mpNotebookStyle); -+ mpNotebookHeaderStyle = createStyleContext(GtkControlPart::NotebookHeader, mpNotebookStyle); -+ mpNotebookHeaderTabsStyle = createStyleContext(GtkControlPart::NotebookHeaderTabs, mpNotebookHeaderStyle); -+ mpNotebookHeaderTabsTabStyle = createStyleContext(GtkControlPart::NotebookHeaderTabsTab, mpNotebookHeaderTabsStyle); - - /* Combobox */ - gComboBox = gtk_combo_box_text_new_with_entry(); -@@ -2076,14 +2442,7 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) - mpListboxButtonStyle = gtk_widget_get_style_context(gListBoxButtonWidget); - - /* Frames */ -- gFrameIn = gtk_frame_new(nullptr); -- gtk_frame_set_shadow_type(GTK_FRAME(gFrameIn), GTK_SHADOW_IN); -- -- gFrameOut = gtk_frame_new(nullptr); -- gtk_frame_set_shadow_type(GTK_FRAME(gFrameOut), GTK_SHADOW_OUT); -- -- getStyleContext(&mpFrameInStyle, gFrameIn); -- getStyleContext(&mpFrameOutStyle, gFrameOut); -+ mpFrameOutStyle = mpFrameInStyle = createStyleContext(GtkControlPart::FrameBorder); - getStyleContext(&mpFixedHoriLineStyle, gtk_separator_new(GTK_ORIENTATION_HORIZONTAL)); - getStyleContext(&mpFixedVertLineStyle, gtk_separator_new(GTK_ORIENTATION_VERTICAL)); - -@@ -2110,7 +2469,9 @@ GtkSalGraphics::GtkSalGraphics( GtkSalFrame *pFrame, GtkWidget *pWindow ) - mpTreeHeaderButtonStyle = gtk_widget_get_style_context(pTreeHeaderCellWidget); - - /* Progress Bar */ -- getStyleContext(&mpProgressBarStyle, gtk_progress_bar_new()); -+ mpProgressBarStyle = createStyleContext(GtkControlPart::ProgressBar); -+ mpProgressBarTroughStyle = createStyleContext(GtkControlPart::ProgressBar, mpProgressBarStyle); -+ mpProgressBarProgressStyle = createStyleContext(GtkControlPart::ProgressBarProgress, mpProgressBarTroughStyle); - - gtk_widget_show_all(gDumbContainer); - } --- -2.7.0 - diff --git a/0001-gtk3-get-app-menu-working-again-under-gtk3.patch b/0001-gtk3-get-app-menu-working-again-under-gtk3.patch deleted file mode 100644 index d6c9132..0000000 --- a/0001-gtk3-get-app-menu-working-again-under-gtk3.patch +++ /dev/null @@ -1,240 +0,0 @@ -From d002f74d3e83d9a074c4a141a204d0e779dfdb4a Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Thu, 18 Feb 2016 21:00:57 +0000 -Subject: [PATCH] gtk3: get app menu working again under gtk3 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -and get it working under wayland too - -Reviewed-on: https://gerrit.libreoffice.org/22491 -Tested-by: Jenkins -Tested-by: Caolán McNamara -Reviewed-by: Caolán McNamara -(cherry picked from commit 59d978389721c780b1df5e54b833fe75576dd034) - -Change-Id: I57592acc4b7ea4a55296541ab4b3bf0c8fd98c5b - -loplugin: checkconfigmacros - -I suppose - -Change-Id: I2821665548077162c4a434876aee407127b312a4 -(cherry picked from commit 2f3d85182ff9f2f1174a47b6139f358d232ee5e3) ---- - vcl/inc/unx/gtk/gtkframe.hxx | 4 ++- - vcl/inc/unx/gtk/gtksalmenu.hxx | 6 +++-- - vcl/unx/gtk/gtksalframe.cxx | 10 +++++--- - vcl/unx/gtk3/gtk3gtkframe.cxx | 57 ++++++++++++++++++++++++------------------ - 4 files changed, 46 insertions(+), 31 deletions(-) - -diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx -index 20a1e84..1d8334c 100644 ---- a/vcl/inc/unx/gtk/gtkframe.hxx -+++ b/vcl/inc/unx/gtk/gtkframe.hxx -@@ -49,6 +49,8 @@ - #include - #include - -+#include -+ - class GtkSalGraphics; - class GtkSalDisplay; - -@@ -222,7 +224,7 @@ class GtkSalFrame : public SalFrame - - SalMenu* m_pSalMenu; - --#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) -+#if defined(ENABLE_DBUS) && ENABLE_GIO - public: - void EnsureDbusMenuSynced(); - private: -diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx -index 998a925..5d9c262 100644 ---- a/vcl/inc/unx/gtk/gtksalmenu.hxx -+++ b/vcl/inc/unx/gtk/gtksalmenu.hxx -@@ -10,15 +10,17 @@ - #ifndef INCLUDED_VCL_INC_UNX_GTK_GTKSALMENU_HXX - #define INCLUDED_VCL_INC_UNX_GTK_GTKSALMENU_HXX - -+#include -+ - #include --#ifdef ENABLE_GIO -+#if ENABLE_GIO - #include - #endif - - #include - #include - --#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) && \ -+#if defined(ENABLE_DBUS) && ENABLE_GIO && \ - (GLIB_MAJOR_VERSION > 2 || GLIB_MINOR_VERSION >= 36) - # define ENABLE_GMENU_INTEGRATION - # include -diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx -index 7a7c293..95fd581 100644 ---- a/vcl/unx/gtk/gtksalframe.cxx -+++ b/vcl/unx/gtk/gtksalframe.cxx -@@ -38,8 +38,10 @@ - #include - #include - -+#include -+ - #include --#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) -+#if defined(ENABLE_DBUS) && ENABLE_GIO - # include - #endif - #if defined ENABLE_GMENU_INTEGRATION // defined in gtksalmenu.hxx above -@@ -432,7 +434,7 @@ GtkSalFrame::GtkSalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) - m_bDefaultPos = true; - m_bDefaultSize = ( (nStyle & SalFrameStyleFlags::SIZEABLE) && ! pParent ); - m_bWindowIsGtkPlug = false; --#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) -+#if defined(ENABLE_DBUS) && ENABLE_GIO - m_pLastSyncedDbusMenu = nullptr; - #endif - Init( pParent, nStyle ); -@@ -446,7 +448,7 @@ GtkSalFrame::GtkSalFrame( SystemParentData* pSysData ) - GetGenericData()->ErrorTrapPush(); - m_bDefaultPos = true; - m_bDefaultSize = true; --#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) -+#if defined(ENABLE_DBUS) && ENABLE_GIO - m_pLastSyncedDbusMenu = nullptr; - #endif - Init( pSysData ); -@@ -486,7 +488,7 @@ static void ObjectDestroyedNotify( gpointer data ) - } - } - --#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) -+#if defined(ENABLE_DBUS) && ENABLE_GIO - void GtkSalFrame::EnsureDbusMenuSynced() - { - GtkSalMenu* pSalMenu = static_cast(GetMenu()); -diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx -index f3bdfb2..f018576 100644 ---- a/vcl/unx/gtk3/gtk3gtkframe.cxx -+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx -@@ -38,7 +38,9 @@ - #include - #include - --#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) -+#include -+ -+#if defined(ENABLE_DBUS) && ENABLE_GIO - # include - #endif - #if defined ENABLE_GMENU_INTEGRATION // defined in gtksalmenu.hxx above -@@ -479,7 +481,7 @@ GtkSalFrame::GtkSalFrame( SalFrame* pParent, SalFrameStyleFlags nStyle ) - m_bDefaultPos = true; - m_bDefaultSize = ( (nStyle & SalFrameStyleFlags::SIZEABLE) && ! pParent ); - m_bWindowIsGtkPlug = false; --#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) -+#if defined(ENABLE_DBUS) && ENABLE_GIO - m_pLastSyncedDbusMenu = nullptr; - #endif - Init( pParent, nStyle ); -@@ -495,7 +497,7 @@ GtkSalFrame::GtkSalFrame( SystemParentData* pSysData ) - GetGenericData()->ErrorTrapPush(); - m_bDefaultPos = true; - m_bDefaultSize = true; --#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) -+#if defined(ENABLE_DBUS) && ENABLE_GIO - m_pLastSyncedDbusMenu = nullptr; - #endif - Init( pSysData ); -@@ -503,13 +505,6 @@ GtkSalFrame::GtkSalFrame( SystemParentData* pSysData ) - - #ifdef ENABLE_GMENU_INTEGRATION - --static void --gdk_x11_window_set_utf8_property (GdkWindow * /*window*/, -- const gchar * /*name*/, -- const gchar * /*value*/) --{ --} -- - // AppMenu watch functions. - - static void ObjectDestroyedNotify( gpointer data ) -@@ -519,7 +514,7 @@ static void ObjectDestroyedNotify( gpointer data ) - } - } - --#if defined(ENABLE_DBUS) && defined(ENABLE_GIO) -+#if defined(ENABLE_DBUS) && ENABLE_GIO - void GtkSalFrame::EnsureDbusMenuSynced() - { - GtkSalMenu* pSalMenu = static_cast(GetMenu()); -@@ -628,7 +623,7 @@ gboolean ensure_dbus_setup( gpointer data ) - GActionGroup* pActionGroup = reinterpret_cast(g_lo_action_group_new( static_cast< gpointer >( pSalFrame ) )); - - // Generate menu paths. -- ::Window windowId = GDK_WINDOW_XID( gdkWindow ); -+ sal_uIntPtr windowId = pSalFrame->GetNativeWindowHandle(pSalFrame->getWindow()); - gchar* aDBusWindowPath = g_strdup_printf( "/org/libreoffice/window/%lu", windowId ); - gchar* aDBusMenubarPath = g_strdup_printf( "/org/libreoffice/window/%lu/menus/menubar", windowId ); - -@@ -636,12 +631,32 @@ gboolean ensure_dbus_setup( gpointer data ) - g_object_set_data_full( G_OBJECT( gdkWindow ), "g-lo-menubar", pMenuModel, ObjectDestroyedNotify ); - g_object_set_data_full( G_OBJECT( gdkWindow ), "g-lo-action-group", pActionGroup, ObjectDestroyedNotify ); - -- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APPLICATION_ID", "org.libreoffice" ); -- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_UNIQUE_BUS_NAME", g_dbus_connection_get_unique_name( pSessionBus ) ); -- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APPLICATION_OBJECT_PATH", "/org/libreoffice" ); -- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_WINDOW_OBJECT_PATH", aDBusWindowPath ); -- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_MENUBAR_OBJECT_PATH", aDBusMenubarPath ); -- -+ GdkDisplay *pDisplay = pSalFrame->getGdkDisplay(); -+ // fdo#70885 we don't want app menu under Unity -+ const bool bDesktopIsUnity = (SalGetDesktopEnvironment() == "UNITY"); -+#if defined(GDK_WINDOWING_X11) -+ if (GDK_IS_X11_DISPLAY(pDisplay)) -+ { -+ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APPLICATION_ID", "org.libreoffice" ); -+ if (!bDesktopIsUnity) -+ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APP_MENU_OBJECT_PATH", "/org/libreoffice/menus/appmenu" ); -+ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_MENUBAR_OBJECT_PATH", aDBusMenubarPath ); -+ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_WINDOW_OBJECT_PATH", aDBusWindowPath ); -+ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APPLICATION_OBJECT_PATH", "/org/libreoffice" ); -+ gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_UNIQUE_BUS_NAME", g_dbus_connection_get_unique_name( pSessionBus ) ); -+ } -+#endif -+#if defined(GDK_WINDOWING_WAYLAND) -+ if (GDK_IS_WAYLAND_DISPLAY(pDisplay)) -+ { -+ gdk_wayland_window_set_dbus_properties_libgtk_only(gdkWindow, "org.libreoffice", -+ "/org/libreoffice/menus/appmenu", -+ !bDesktopIsUnity ? aDBusMenubarPath : nullptr, -+ aDBusWindowPath, -+ "/org/libreoffice", -+ g_dbus_connection_get_unique_name( pSessionBus )); -+ } -+#endif - // Publish the menu model and the action group. - SAL_INFO("vcl.unity", "exporting menu model at " << pMenuModel << " for window " << windowId); - pSalFrame->m_nMenuExportId = g_dbus_connection_export_menu_model (pSessionBus, aDBusMenubarPath, pMenuModel, nullptr); -@@ -649,12 +664,6 @@ gboolean ensure_dbus_setup( gpointer data ) - pSalFrame->m_nActionGroupExportId = g_dbus_connection_export_action_group( pSessionBus, aDBusWindowPath, pActionGroup, nullptr); - pSalFrame->m_nHudAwarenessId = hud_awareness_register( pSessionBus, aDBusMenubarPath, hud_activated, pSalFrame, nullptr, nullptr ); - -- // fdo#70885 we don't want app menu under Unity -- bool bDesktopIsUnity = (SalGetDesktopEnvironment() == "UNITY"); -- -- if (!bDesktopIsUnity) -- gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APP_MENU_OBJECT_PATH", "/org/libreoffice/menus/appmenu" ); -- - //app menu, to-do translations, block normal menus when active, honor use appmenu settings - ResMgr* pMgr = ImplGetResMgr(); - if( pMgr && !bDesktopIsUnity ) --- -2.7.1 - diff --git a/0001-unused-vcl-IsWindowSystemAvailable.patch b/0001-unused-vcl-IsWindowSystemAvailable.patch deleted file mode 100644 index e626be2..0000000 --- a/0001-unused-vcl-IsWindowSystemAvailable.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 32c6389cceda63391ff372987834fb7b0a25339a Mon Sep 17 00:00:00 2001 -From: Juergen Funk -Date: Sat, 5 Dec 2015 01:37:13 +0100 -Subject: [PATCH 1/5] unused vcl::IsWindowSystemAvailable - -Change-Id: Ie903a6fe3237319661662c0533c23528766ffd08 -Reviewed-on: https://gerrit.libreoffice.org/20404 -Tested-by: Jenkins -Reviewed-by: Tor Lillqvist -Tested-by: Tor Lillqvist -(cherry picked from commit 6ded842ac4a0e06efcfcc312775d25063201eb68) ---- - include/vcl/svapp.hxx | 7 ------- - unusedcode.easy | 1 - - vcl/osx/salinst.cxx | 10 ---------- - vcl/unx/generic/gdi/x11windowprovider.cxx | 16 ---------------- - vcl/win/source/app/saldata.cxx | 9 --------- - 5 files changed, 43 deletions(-) - -diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx -index a8b813b..c5b52ca 100644 ---- a/include/vcl/svapp.hxx -+++ b/include/vcl/svapp.hxx -@@ -1649,13 +1649,6 @@ inline void Application::EndYield() - PostUserEvent( Link() ); - } - --namespace vcl --{ -- --VCL_DLLPUBLIC bool IsWindowSystemAvailable(); -- --} -- - #endif // _APP_HXX - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/unusedcode.easy b/unusedcode.easy -index bce941f..89f4028 100644 ---- a/unusedcode.easy -+++ b/unusedcode.easy -@@ -93,7 +93,6 @@ sd::LeftDrawPaneShell::RegisterInterface(SfxModule*) - sd::LeftImpressPaneShell::RegisterInterface(SfxModule*) - std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_move_data(std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >&, std::integral_constant) - std::__cxx1998::vector, std::allocator > >::reserve(unsigned long) --vcl::IsWindowSystemAvailable() - vcl::MapChar(vcl::_TrueTypeFont*, unsigned short, bool) - vcl::Region::IsInside(Rectangle const&) const - vcl::RenderSettings::PushAndApply(OutputDevice&) -diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx -index b7467be..4bfe5bc 100644 ---- a/vcl/osx/salinst.cxx -+++ b/vcl/osx/salinst.cxx -@@ -1097,15 +1097,5 @@ NSImage* CreateNSImage( const Image& rImage ) - return pImage; - } - --namespace vcl --{ -- --bool IsWindowSystemAvailable() --{ -- // Yes I know the parens are not needed. I like them in cases like this. So sue me. -- return ([NSScreen screens] != nil && [[NSScreen screens] count] > 0); --} -- --} // namespace vcl - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/vcl/unx/generic/gdi/x11windowprovider.cxx b/vcl/unx/generic/gdi/x11windowprovider.cxx -index 4f507c3..5f7d289 100644 ---- a/vcl/unx/generic/gdi/x11windowprovider.cxx -+++ b/vcl/unx/generic/gdi/x11windowprovider.cxx -@@ -68,21 +68,5 @@ Display *OpenX11Display(OString& rDisplay) - return pDisp; - } - --namespace vcl --{ -- --bool IsWindowSystemAvailable() --{ -- Display *pDisp; -- OString aDisplay; -- -- pDisp = OpenX11Display(aDisplay); -- if (pDisp) -- XCloseDisplay(pDisp); -- -- return (pDisp != nullptr); --} -- --} // namespace vcl - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/vcl/win/source/app/saldata.cxx b/vcl/win/source/app/saldata.cxx -index 18256ee..2a04b33 100644 ---- a/vcl/win/source/app/saldata.cxx -+++ b/vcl/win/source/app/saldata.cxx -@@ -74,15 +74,6 @@ int ImplSalWICompareAscii( const wchar_t* pStr1, const char* pStr2 ) - return nRet; - } - --namespace vcl --{ -- --bool IsWindowSystemAvailable() --{ -- return true; // FIXME: we want this to return false if logged in -- // to some Cygwin ssh session for instance --} - --} // namespace vcl - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ --- -2.7.1 - diff --git a/0002-gtk3-some-changes-towards-enabling-native-gtk3-popup.patch b/0002-gtk3-some-changes-towards-enabling-native-gtk3-popup.patch index 86b314e..967aab8 100644 --- a/0002-gtk3-some-changes-towards-enabling-native-gtk3-popup.patch +++ b/0002-gtk3-some-changes-towards-enabling-native-gtk3-popup.patch @@ -1,8 +1,7 @@ -From 684f2191c0010aaa5c802a306bef209660df0968 Mon Sep 17 00:00:00 2001 +From 7e0dcbd97a7ec6e9d39a8b74980421a6b33132ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 22 Feb 2016 20:57:52 +0000 -Subject: [PATCH 2/8] gtk3: some changes towards enabling native gtk3 popup - menus +Subject: [PATCH] gtk3: some changes towards enabling native gtk3 popup menus these menubar things can be menu things and can then do away with the casting, no logic changes intended @@ -45,7 +44,7 @@ index 0d6e16a..1dbd85e 100644 void SetCloseButtonClickHdl( const Link& rLink ) { maCloseHdl = rLink; } diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx -index 8df2c1d..1d58b7a 100644 +index 93259f1..ffda51a 100644 --- a/vcl/inc/unx/gtk/gtksalmenu.hxx +++ b/vcl/inc/unx/gtk/gtksalmenu.hxx @@ -42,7 +42,7 @@ class GtkSalMenu : public SalMenu @@ -59,7 +58,7 @@ index 8df2c1d..1d58b7a 100644 const GtkSalFrame* mpFrame; @@ -53,7 +53,7 @@ private: - GtkSalMenu* GetMenuForItemCommand( gchar* aCommand, gboolean bGetSubmenu ); + GtkSalMenu* GetMenuForItemCommand( gchar* aCommand, int& rDupsToSkip, gboolean bGetSubmenu ); void ImplUpdate( gboolean bRecurse ); - void ActivateAllSubmenus(MenuBar* pMenuBar); + void ActivateAllSubmenus(Menu* pMenuBar); @@ -122,11 +121,11 @@ index 4aa7d41..999085e 100644 return true; } diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx -index fd29a25..6887ade 100644 +index 507d529..9b590dd 100644 --- a/vcl/unx/gtk/gtksalmenu.cxx +++ b/vcl/unx/gtk/gtksalmenu.cxx -@@ -622,11 +622,10 @@ void GtkSalMenu::DispatchCommand( gint itemId, const gchar *aCommand ) - GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast(aCommand), FALSE ); +@@ -654,11 +654,10 @@ void GtkSalMenu::DispatchCommand( gint itemId, const gchar *aCommand ) + GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast(aCommand), nDupsToSkip, FALSE ); Menu* pSubMenu = ( pSalSubMenu != nullptr ) ? pSalSubMenu->GetMenu() : nullptr; - MenuBar* pMenuBar = static_cast< MenuBar* >( mpVCLMenu ); @@ -139,7 +138,7 @@ index fd29a25..6887ade 100644 { pMenuBar->HandleMenuActivateEvent(mpVCLMenu); pMenuBar->HandleMenuDeActivateEvent(mpVCLMenu); -@@ -647,15 +646,14 @@ void GtkSalMenu::Activate( const gchar* aMenuCommand ) +@@ -679,15 +678,14 @@ void GtkSalMenu::Activate( const gchar* aMenuCommand ) return; if ( !aMenuCommand ) { @@ -157,8 +156,8 @@ index fd29a25..6887ade 100644 pSalSubMenu->Update(); } } -@@ -668,8 +666,7 @@ void GtkSalMenu::Deactivate( const gchar* aMenuCommand ) - GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast(aMenuCommand), TRUE ); +@@ -702,8 +700,7 @@ void GtkSalMenu::Deactivate( const gchar* aMenuCommand ) + GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast(aMenuCommand), nDupsToSkip, TRUE ); if ( pSalSubMenu != nullptr ) { - MenuBar* pMenuBar = static_cast< MenuBar* >( mpVCLMenu ); @@ -168,5 +167,5 @@ index fd29a25..6887ade 100644 } -- -2.7.1 +2.5.0 diff --git a/0002-split-the-gtk2-and-gtk3-gtkobjects.patch b/0002-split-the-gtk2-and-gtk3-gtkobjects.patch deleted file mode 100644 index 89e79c4..0000000 --- a/0002-split-the-gtk2-and-gtk3-gtkobjects.patch +++ /dev/null @@ -1,278 +0,0 @@ -From 9f13817e695a46c9dc9ef79a63f26d828e6a7368 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Fri, 12 Feb 2016 16:55:12 +0000 -Subject: [PATCH 2/5] split the gtk2 and gtk3 gtkobjects - -(cherry picked from commit 31fa4545985acc1594107e087cedc2d99b3d0f0b) - -Change-Id: I32084232c44a12e9641010b51e75710abc827695 ---- - vcl/unx/gtk/gtkobject.cxx | 21 ----- - vcl/unx/gtk3/gtk3gtkobject.cxx | 185 ++++++++++++++++++++++++++++++++++++++++- - 2 files changed, 184 insertions(+), 22 deletions(-) - -diff --git a/vcl/unx/gtk/gtkobject.cxx b/vcl/unx/gtk/gtkobject.cxx -index 35084aa..cc78ff5 100644 ---- a/vcl/unx/gtk/gtkobject.cxx -+++ b/vcl/unx/gtk/gtkobject.cxx -@@ -51,7 +51,6 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, bool bShow ) - - // system data - m_aSystemData.nSize = sizeof( SystemEnvData ); --#if !GTK_CHECK_VERSION(3,0,0) - SalDisplay* pDisp = vcl_sal::getSalDisplay(GetGenericData()); - m_aSystemData.pDisplay = pDisp->GetDisplay(); - m_aSystemData.pVisual = pDisp->GetVisual(pParent->getXScreenNumber()).GetVisual(); -@@ -59,12 +58,6 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, bool bShow ) - m_aSystemData.aColormap = pDisp->GetColormap(pParent->getXScreenNumber()).GetXColormap(); - m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(widget_get_window(m_pSocket)); - m_aSystemData.aShellWindow = GDK_WINDOW_XWINDOW(widget_get_window(GTK_WIDGET(pParent->getWindow()))); --#else -- static int nWindow = 0; -- m_aSystemData.aWindow = nWindow; -- ++nWindow; -- m_aSystemData.aShellWindow = reinterpret_cast(this); --#endif - m_aSystemData.pSalFrame = nullptr; - m_aSystemData.pWidget = m_pSocket; - m_aSystemData.nScreen = pParent->getXScreenNumber().getXScreen(); -@@ -86,11 +79,7 @@ GtkSalObject::~GtkSalObject() - { - if( m_pRegion ) - { --#if GTK_CHECK_VERSION(3,0,0) -- cairo_region_destroy( m_pRegion ); --#else - gdk_region_destroy( m_pRegion ); --#endif - } - if( m_pSocket ) - { -@@ -119,15 +108,9 @@ sal_uInt16 GtkSalObject::GetClipRegionType() - - void GtkSalObject::BeginSetClipRegion( sal_uLong ) - { --#if GTK_CHECK_VERSION(3,0,0) -- if( m_pRegion ) -- cairo_region_destroy( m_pRegion ); -- m_pRegion = cairo_region_create(); --#else - if( m_pRegion ) - gdk_region_destroy( m_pRegion ); - m_pRegion = gdk_region_new(); --#endif - } - - void GtkSalObject::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) -@@ -138,11 +121,7 @@ void GtkSalObject::UnionClipRegion( long nX, long nY, long nWidth, long nHeight - aRect.width = nWidth; - aRect.height = nHeight; - --#if GTK_CHECK_VERSION(3,0,0) -- cairo_region_union_rectangle( m_pRegion, &aRect ); --#else - gdk_region_union_with_rect( m_pRegion, &aRect ); --#endif - } - - void GtkSalObject::EndSetClipRegion() -diff --git a/vcl/unx/gtk3/gtk3gtkobject.cxx b/vcl/unx/gtk3/gtk3gtkobject.cxx -index 96c1527..8c06b4e 100644 ---- a/vcl/unx/gtk3/gtk3gtkobject.cxx -+++ b/vcl/unx/gtk3/gtk3gtkobject.cxx -@@ -5,8 +5,191 @@ - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ * -+ * This file incorporates work covered by the following license notice: -+ * -+ * Licensed to the Apache Software Foundation (ASF) under one or more -+ * contributor license agreements. See the NOTICE file distributed -+ * with this work for additional information regarding copyright -+ * ownership. The ASF licenses this file to you under the Apache -+ * License, Version 2.0 (the "License"); you may not use this file -+ * except in compliance with the License. You may obtain a copy of -+ * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - --#include "../gtk/gtkobject.cxx" -+#ifdef AIX -+#define _LINUX_SOURCE_COMPAT -+#include -+#undef _LINUX_SOURCE_COMPAT -+#endif -+ -+#include -+#include -+#include -+#include -+#include -+ -+GtkSalObject::GtkSalObject( GtkSalFrame* pParent, bool bShow ) -+ : m_pSocket( nullptr ), -+ m_pRegion( nullptr ) -+{ -+ if( pParent ) -+ { -+ // our plug window -+ m_pSocket = gtk_drawing_area_new(); -+ Show( bShow ); -+ // insert into container -+ gtk_fixed_put( pParent->getFixedContainer(), -+ m_pSocket, -+ 0, 0 ); -+ // realize so we can get a window id -+ gtk_widget_realize( m_pSocket ); -+ -+ // make it transparent; some plugins may not insert -+ // their own window here but use the socket window itself -+ gtk_widget_set_app_paintable( m_pSocket, TRUE ); -+ -+ // system data -+ m_aSystemData.nSize = sizeof( SystemEnvData ); -+ static int nWindow = 0; -+ m_aSystemData.aWindow = nWindow; -+ ++nWindow; -+ m_aSystemData.aShellWindow = reinterpret_cast(this); -+ m_aSystemData.pSalFrame = nullptr; -+ m_aSystemData.pWidget = m_pSocket; -+ m_aSystemData.nScreen = pParent->getXScreenNumber().getXScreen(); -+ m_aSystemData.pAppContext = nullptr; -+ m_aSystemData.pShellWidget = GTK_WIDGET(pParent->getWindow()); -+ -+ g_signal_connect( G_OBJECT(m_pSocket), "button-press-event", G_CALLBACK(signalButton), this ); -+ g_signal_connect( G_OBJECT(m_pSocket), "button-release-event", G_CALLBACK(signalButton), this ); -+ g_signal_connect( G_OBJECT(m_pSocket), "focus-in-event", G_CALLBACK(signalFocus), this ); -+ g_signal_connect( G_OBJECT(m_pSocket), "focus-out-event", G_CALLBACK(signalFocus), this ); -+ g_signal_connect( G_OBJECT(m_pSocket), "destroy", G_CALLBACK(signalDestroy), this ); -+ -+ // #i59255# necessary due to sync effects with java child windows -+ pParent->Flush(); -+ } -+} -+ -+GtkSalObject::~GtkSalObject() -+{ -+ if( m_pRegion ) -+ { -+ cairo_region_destroy( m_pRegion ); -+ } -+ if( m_pSocket ) -+ { -+ // remove socket from parent frame's fixed container -+ gtk_container_remove( GTK_CONTAINER(gtk_widget_get_parent(m_pSocket)), -+ m_pSocket ); -+ // get rid of the socket -+ // actually the gtk_container_remove should let the ref count -+ // of the socket sink to 0 and destroy it (see signalDestroy) -+ // this is just a sanity check -+ if( m_pSocket ) -+ gtk_widget_destroy( m_pSocket ); -+ } -+} -+ -+void GtkSalObject::ResetClipRegion() -+{ -+ if( m_pSocket ) -+ gdk_window_shape_combine_region( widget_get_window(m_pSocket), nullptr, 0, 0 ); -+} -+ -+sal_uInt16 GtkSalObject::GetClipRegionType() -+{ -+ return SAL_OBJECT_CLIP_INCLUDERECTS; -+} -+ -+void GtkSalObject::BeginSetClipRegion( sal_uLong ) -+{ -+ if( m_pRegion ) -+ cairo_region_destroy( m_pRegion ); -+ m_pRegion = cairo_region_create(); -+} -+ -+void GtkSalObject::UnionClipRegion( long nX, long nY, long nWidth, long nHeight ) -+{ -+ GdkRectangle aRect; -+ aRect.x = nX; -+ aRect.y = nY; -+ aRect.width = nWidth; -+ aRect.height = nHeight; -+ -+ cairo_region_union_rectangle( m_pRegion, &aRect ); -+} -+ -+void GtkSalObject::EndSetClipRegion() -+{ -+ if( m_pSocket ) -+ gdk_window_shape_combine_region( widget_get_window(m_pSocket), m_pRegion, 0, 0 ); -+} -+ -+void GtkSalObject::SetPosSize( long nX, long nY, long nWidth, long nHeight ) -+{ -+ if( m_pSocket ) -+ { -+ GtkFixed* pContainer = GTK_FIXED(gtk_widget_get_parent(m_pSocket)); -+ gtk_fixed_move( pContainer, m_pSocket, nX, nY ); -+ gtk_widget_set_size_request( m_pSocket, nWidth, nHeight ); -+ gtk_container_resize_children( GTK_CONTAINER(pContainer) ); -+ } -+} -+ -+void GtkSalObject::Show( bool bVisible ) -+{ -+ if( m_pSocket ) -+ { -+ if( bVisible ) -+ gtk_widget_show( m_pSocket ); -+ else -+ gtk_widget_hide( m_pSocket ); -+ } -+} -+ -+const SystemEnvData* GtkSalObject::GetSystemData() const -+{ -+ return &m_aSystemData; -+} -+ -+gboolean GtkSalObject::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer object ) -+{ -+ GtkSalObject* pThis = static_cast(object); -+ -+ if( pEvent->type == GDK_BUTTON_PRESS ) -+ { -+ pThis->CallCallback( SALOBJ_EVENT_TOTOP, nullptr ); -+ } -+ -+ return FALSE; -+} -+ -+gboolean GtkSalObject::signalFocus( GtkWidget*, GdkEventFocus* pEvent, gpointer object ) -+{ -+ GtkSalObject* pThis = static_cast(object); -+ -+ pThis->CallCallback( pEvent->in ? SALOBJ_EVENT_GETFOCUS : SALOBJ_EVENT_LOSEFOCUS, nullptr ); -+ -+ return FALSE; -+} -+ -+void GtkSalObject::signalDestroy( GtkWidget* pObj, gpointer object ) -+{ -+ GtkSalObject* pThis = static_cast(object); -+ if( pObj == pThis->m_pSocket ) -+ { -+ pThis->m_pSocket = nullptr; -+ } -+} -+ -+void GtkSalObject::SetForwardKey( bool bEnable ) -+{ -+ if( bEnable ) -+ gtk_widget_add_events( GTK_WIDGET( m_pSocket ), GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE ); -+ else -+ gtk_widget_set_events( GTK_WIDGET( m_pSocket ), ~(GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE) & gtk_widget_get_events( GTK_WIDGET( m_pSocket ) ) ); -+} - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ --- -2.7.1 - diff --git a/0003-rename-X11WindowProvider-to-a-NativeWindowHandle-pro.patch b/0003-rename-X11WindowProvider-to-a-NativeWindowHandle-pro.patch deleted file mode 100644 index ecabac8..0000000 --- a/0003-rename-X11WindowProvider-to-a-NativeWindowHandle-pro.patch +++ /dev/null @@ -1,453 +0,0 @@ -From 04de1501e65758a6290e66f9591d491bb20c4e6f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Mon, 15 Feb 2016 15:37:37 +0000 -Subject: [PATCH 3/5] rename X11WindowProvider to a NativeWindowHandle provider - -sort of thing and genericize it - -(cherry picked from commit e35e762d564da18b0b508112f3e4d78fd26ba99c) - -Change-Id: I27e1e47f2b371e5269db079cfc1262d056105f80 ---- - vcl/Library_vcl.mk | 2 +- - vcl/inc/unx/gtk/gtkframe.hxx | 7 ++- - vcl/inc/unx/nativewindowhandleprovider.hxx | 25 ++++++++ - vcl/inc/unx/salframe.h | 6 +- - vcl/inc/unx/x11/x11display.hxx | 25 -------- - vcl/inc/unx/x11windowprovider.hxx | 28 --------- - vcl/opengl/x11/gdiimpl.cxx | 4 +- - vcl/unx/generic/app/saldata.cxx | 56 ++++++++++++++++- - vcl/unx/generic/gdi/nativewindowhandleprovider.cxx | 17 +++++ - vcl/unx/generic/gdi/salgdi.cxx | 2 +- - vcl/unx/generic/gdi/x11windowprovider.cxx | 72 ---------------------- - vcl/unx/generic/window/salframe.cxx | 2 +- - vcl/unx/gtk/gtksalframe.cxx | 2 +- - vcl/unx/gtk3/gtk3gtkframe.cxx | 2 +- - 14 files changed, 111 insertions(+), 139 deletions(-) - create mode 100644 vcl/inc/unx/nativewindowhandleprovider.hxx - delete mode 100644 vcl/inc/unx/x11/x11display.hxx - delete mode 100644 vcl/inc/unx/x11windowprovider.hxx - create mode 100644 vcl/unx/generic/gdi/nativewindowhandleprovider.cxx - delete mode 100644 vcl/unx/generic/gdi/x11windowprovider.cxx - -diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk -index a9fe72f..da80ab6 100644 ---- a/vcl/Library_vcl.mk -+++ b/vcl/Library_vcl.mk -@@ -581,7 +581,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ - vcl/unx/generic/plugadapt/salplug \ - vcl/unx/generic/printer/jobdata \ - vcl/unx/generic/printer/ppdparser \ -- vcl/unx/generic/gdi/x11windowprovider \ -+ vcl/unx/generic/gdi/nativewindowhandleprovider \ - vcl/unx/generic/window/screensaverinhibitor \ - $(if $(filter TRUE,$(ENABLE_CUPS)),\ - vcl/unx/generic/printer/cupsmgr \ -diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx -index da629b7..f7edd73 100644 ---- a/vcl/inc/unx/gtk/gtkframe.hxx -+++ b/vcl/inc/unx/gtk/gtkframe.hxx -@@ -33,7 +33,7 @@ - - #include - #include --#include -+#include - #include - #include - -@@ -66,7 +66,8 @@ class GtkDnDTransferable; - typedef void GDBusConnection; - #endif - --class GtkSalFrame : public SalFrame, public X11WindowProvider -+class GtkSalFrame : public SalFrame -+ , public NativeWindowHandleProvider - { - struct IMHandler - { -@@ -518,7 +519,7 @@ public: - - static GtkSalFrame *getFromWindow( GtkWindow *pWindow ); - -- virtual Window GetX11Window() override; -+ virtual sal_uIntPtr GetNativeWindowHandle() override; - - static void KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode, - guint* pGdkKeyCode, GdkModifierType *pGdkModifiers); -diff --git a/vcl/inc/unx/nativewindowhandleprovider.hxx b/vcl/inc/unx/nativewindowhandleprovider.hxx -new file mode 100644 -index 0000000..1d85cb4 ---- /dev/null -+++ b/vcl/inc/unx/nativewindowhandleprovider.hxx -@@ -0,0 +1,25 @@ -+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -+/* -+ * This file is part of the LibreOffice project. -+ * -+ * This Source Code Form is subject to the terms of the Mozilla Public -+ * License, v. 2.0. If a copy of the MPL was not distributed with this -+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. -+ */ -+ -+#ifndef INCLUDED_VCL_UNX_NATIVEWINDOWHANDLEPROVIDER -+#define INCLUDED_VCL_UNX_NATIVEWINDOWHANDLEPROVIDER -+ -+#include -+ -+class VCL_PLUGIN_PUBLIC NativeWindowHandleProvider -+{ -+public: -+ virtual ~NativeWindowHandleProvider(); -+ -+ virtual sal_uIntPtr GetNativeWindowHandle() = 0; -+}; -+ -+#endif -+ -+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/vcl/inc/unx/salframe.h b/vcl/inc/unx/salframe.h -index 9ba1957..9848e1e 100644 ---- a/vcl/inc/unx/salframe.h -+++ b/vcl/inc/unx/salframe.h -@@ -27,7 +27,7 @@ - #include - #include - #include --#include -+#include - #include - #include - #include -@@ -50,7 +50,7 @@ namespace vcl_sal { class WMAdaptor; class NetWMAdaptor; class GnomeWMAdaptor; } - #define SHOWSTATE_NORMAL 1 - #define SHOWSTATE_HIDDEN 2 - --class VCLPLUG_GEN_PUBLIC X11SalFrame : public SalFrame, public X11WindowProvider -+class VCLPLUG_GEN_PUBLIC X11SalFrame : public SalFrame, public NativeWindowHandleProvider - { - friend class vcl_sal::WMAdaptor; - friend class vcl_sal::NetWMAdaptor; -@@ -261,7 +261,7 @@ public: - // done setting up the clipregion - virtual void EndSetClipRegion() override; - -- virtual Window GetX11Window() override; -+ virtual sal_uIntPtr GetNativeWindowHandle() override; - - /// @internal - void setPendingSizeEvent(); -diff --git a/vcl/inc/unx/x11/x11display.hxx b/vcl/inc/unx/x11/x11display.hxx -deleted file mode 100644 -index 9cb2ea5..0000000 ---- a/vcl/inc/unx/x11/x11display.hxx -+++ /dev/null -@@ -1,25 +0,0 @@ --/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ --/* -- * This file is part of the LibreOffice project. -- * -- * This Source Code Form is subject to the terms of the Mozilla Public -- * License, v. 2.0. If a copy of the MPL was not distributed with this -- * file, You can obtain one at http://mozilla.org/MPL/2.0/. -- */ -- --#ifndef INCLUDED_VCL_INC_UNX_X11_X11DISPLAY_HXX --#define INCLUDED_VCL_INC_UNX_X11_X11DISPLAY_HXX -- --#include --#include --#include -- --#include -- --#include -- --VCL_DLLPUBLIC Display* OpenX11Display(OString& rDisplay); -- --#endif // INCLUDED_VCL_INC_UNX_X11_X11DISPLAY_HXX -- --/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/vcl/inc/unx/x11windowprovider.hxx b/vcl/inc/unx/x11windowprovider.hxx -deleted file mode 100644 -index 776c8e4..0000000 ---- a/vcl/inc/unx/x11windowprovider.hxx -+++ /dev/null -@@ -1,28 +0,0 @@ --/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ --/* -- * This file is part of the LibreOffice project. -- * -- * This Source Code Form is subject to the terms of the Mozilla Public -- * License, v. 2.0. If a copy of the MPL was not distributed with this -- * file, You can obtain one at http://mozilla.org/MPL/2.0/. -- */ -- --#ifndef INCLUDED_VCL_UNX_X11WINDOWPROVIDER --#define INCLUDED_VCL_UNX_X11WINDOWPROVIDER -- --#include --#include -- --#include -- --class VCL_PLUGIN_PUBLIC X11WindowProvider --{ --public: -- virtual ~X11WindowProvider(); -- -- virtual Window GetX11Window() = 0; --}; -- --#endif -- --/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx -index b1bc724..fc49e25 100644 ---- a/vcl/opengl/x11/gdiimpl.cxx -+++ b/vcl/opengl/x11/gdiimpl.cxx -@@ -47,12 +47,12 @@ void X11OpenGLSalGraphicsImpl::Init() - - rtl::Reference X11OpenGLSalGraphicsImpl::CreateWinContext() - { -- X11WindowProvider *pProvider = dynamic_cast(mrParent.m_pFrame); -+ NativeWindowHandleProvider *pProvider = dynamic_cast(mrParent.m_pFrame); - - if( !pProvider ) - return nullptr; - -- Window aWin = pProvider->GetX11Window(); -+ sal_uIntPtr aWin = pProvider->GetNativeWindowHandle(); - rtl::Reference pContext = OpenGLContext::Create(); - pContext->setVCLOnly(); - pContext->init( mrParent.GetXDisplay(), aWin, -diff --git a/vcl/unx/generic/app/saldata.cxx b/vcl/unx/generic/app/saldata.cxx -index 3f9d184..92f4679 100644 ---- a/vcl/unx/generic/app/saldata.cxx -+++ b/vcl/unx/generic/app/saldata.cxx -@@ -48,7 +48,9 @@ - #include "unx/sm.hxx" - #include "unx/i18n_im.hxx" - #include "unx/i18n_xkb.hxx" --#include "unx/x11/x11display.hxx" -+#include -+#include -+#include - #include "salinst.hxx" - - #include -@@ -374,6 +376,58 @@ SalXLib::~SalXLib() - close (m_pTimeoutFDS[1]); - } - -+static Display *OpenX11Display(OString& rDisplay) -+{ -+ /* -+ * open connection to X11 Display -+ * try in this order: -+ * o -display command line parameter, -+ * o $DISPLAY environment variable -+ * o default display -+ */ -+ -+ Display *pDisp = nullptr; -+ -+ // is there a -display command line parameter? -+ -+ sal_uInt32 nParams = osl_getCommandArgCount(); -+ OUString aParam; -+ for (sal_uInt32 i=0; i - - #include "salgdiimpl.hxx" --#include "unx/x11windowprovider.hxx" -+#include "unx/nativewindowhandleprovider.hxx" - #include "textrender.hxx" - #include "gdiimpl.hxx" - #include "opengl/x11/gdiimpl.hxx" -diff --git a/vcl/unx/generic/gdi/x11windowprovider.cxx b/vcl/unx/generic/gdi/x11windowprovider.cxx -deleted file mode 100644 -index 5f7d289..0000000 ---- a/vcl/unx/generic/gdi/x11windowprovider.cxx -+++ /dev/null -@@ -1,72 +0,0 @@ --/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ --/* -- * This file is part of the LibreOffice project. -- * -- * This Source Code Form is subject to the terms of the Mozilla Public -- * License, v. 2.0. If a copy of the MPL was not distributed with this -- * file, You can obtain one at http://mozilla.org/MPL/2.0/. -- */ -- --#include -- --#include "unx/x11windowprovider.hxx" --#include "unx/x11/x11display.hxx" -- --X11WindowProvider::~X11WindowProvider() --{ --} -- --Display *OpenX11Display(OString& rDisplay) --{ -- /* -- * open connection to X11 Display -- * try in this order: -- * o -display command line parameter, -- * o $DISPLAY environment variable -- * o default display -- */ -- -- Display *pDisp = nullptr; -- -- // is there a -display command line parameter? -- -- sal_uInt32 nParams = osl_getCommandArgCount(); -- OUString aParam; -- for (sal_uInt32 i=0; i -Date: Mon, 15 Feb 2016 15:55:40 +0000 -Subject: [PATCH 4/5] implement wayland handle passing for gstreamer - -Change-Id: I3b0effe35ad7b37ff7ab3de2a3b78b6312779139 -(cherry picked from commit c0d4f3ad3307c7a0d0fddd8c413ef0cc91d382ae) ---- - vcl/inc/unx/gtk/gtkframe.hxx | 1 + - vcl/unx/gtk3/gtk3gtkframe.cxx | 34 +++++++++++++++++++++++++++++----- - vcl/unx/gtk3/gtk3gtkobject.cxx | 4 +--- - 3 files changed, 31 insertions(+), 8 deletions(-) - -diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx -index f7edd73..20a1e84 100644 ---- a/vcl/inc/unx/gtk/gtkframe.hxx -+++ b/vcl/inc/unx/gtk/gtkframe.hxx -@@ -519,6 +519,7 @@ public: - - static GtkSalFrame *getFromWindow( GtkWindow *pWindow ); - -+ sal_uIntPtr GetNativeWindowHandle(GtkWidget *pWidget); - virtual sal_uIntPtr GetNativeWindowHandle() override; - - static void KeyCodeToGdkKey(const vcl::KeyCode& rKeyCode, -diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx -index a88c5d0..925b185 100644 ---- a/vcl/unx/gtk3/gtk3gtkframe.cxx -+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx -@@ -48,7 +48,12 @@ - #include - #include - #include --#include -+#if defined(GDK_WINDOWING_X11) -+# include -+#endif -+#if defined(GDK_WINDOWING_WAYLAND) -+# include -+#endif - #include - - #include -@@ -1085,9 +1090,7 @@ void GtkSalFrame::InitCommon() - - //system data - m_aSystemData.nSize = sizeof( SystemEnvData ); -- static int nWindow = 0; -- m_aSystemData.aWindow = nWindow; -- ++nWindow; -+ m_aSystemData.aWindow = GetNativeWindowHandle(m_pWindow); - m_aSystemData.aShellWindow = reinterpret_cast(this); - m_aSystemData.pSalFrame = this; - m_aSystemData.pWidget = m_pWindow; -@@ -3926,9 +3929,30 @@ Size GtkSalDisplay::GetScreenSize( int nDisplayScreen ) - return Size( aRect.GetWidth(), aRect.GetHeight() ); - } - -+sal_uIntPtr GtkSalFrame::GetNativeWindowHandle(GtkWidget *pWidget) -+{ -+ (void) this; // Silence loplugin:staticmethods -+ GdkDisplay *pDisplay = getGdkDisplay(); -+ GdkWindow *pWindow = gtk_widget_get_window(pWidget); -+ -+#if defined(GDK_WINDOWING_X11) -+ if (GDK_IS_X11_DISPLAY(pDisplay)) -+ { -+ return GDK_WINDOW_XID(pWindow); -+ } -+#endif -+#if defined(GDK_WINDOWING_WAYLAND) -+ if (GDK_IS_WAYLAND_DISPLAY(pDisplay)) -+ { -+ return reinterpret_cast(gdk_wayland_window_get_wl_surface(pWindow)); -+ } -+#endif -+ return 0; -+} -+ - sal_uIntPtr GtkSalFrame::GetNativeWindowHandle() - { -- return widget_get_xid(m_pWindow); -+ return GetNativeWindowHandle(m_pWindow); - } - - void GtkDragSource::startDrag(const datatransfer::dnd::DragGestureEvent& rEvent, -diff --git a/vcl/unx/gtk3/gtk3gtkobject.cxx b/vcl/unx/gtk3/gtk3gtkobject.cxx -index 8c06b4e..1154033 100644 ---- a/vcl/unx/gtk3/gtk3gtkobject.cxx -+++ b/vcl/unx/gtk3/gtk3gtkobject.cxx -@@ -51,9 +51,7 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, bool bShow ) - - // system data - m_aSystemData.nSize = sizeof( SystemEnvData ); -- static int nWindow = 0; -- m_aSystemData.aWindow = nWindow; -- ++nWindow; -+ m_aSystemData.aWindow = pParent->GetNativeWindowHandle(m_pSocket); - m_aSystemData.aShellWindow = reinterpret_cast(this); - m_aSystemData.pSalFrame = nullptr; - m_aSystemData.pWidget = m_pSocket; --- -2.7.1 - diff --git a/0005-gtk3-wayland-play-video-via-gtksink-gstreamer-elemen.patch b/0005-gtk3-wayland-play-video-via-gtksink-gstreamer-elemen.patch deleted file mode 100644 index 0a8d4b7..0000000 --- a/0005-gtk3-wayland-play-video-via-gtksink-gstreamer-elemen.patch +++ /dev/null @@ -1,640 +0,0 @@ -From 3902c13d2cfcf903c8475fb9f72bccf6f604d2f5 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= -Date: Sun, 20 Dec 2015 10:57:12 +0200 -Subject: [PATCH 5/5] gtk3+wayland: play video via gtksink gstreamer element - -(cherry picked from commit 8543fbc72fafc0d71a8760752ca2ef5b7119cb5c) - -Change-Id: Ib371fa06eda73962cbe94739e69a68b46c26e4bf ---- - avmedia/Library_avmediagst.mk | 16 ++- - avmedia/source/gstreamer/gstplayer.cxx | 226 ++++++++++++++++++--------------- - avmedia/source/gstreamer/gstplayer.hxx | 8 ++ - include/vcl/sysdata.hxx | 2 + - vcl/unx/gtk/gtkobject.cxx | 1 + - vcl/unx/gtk/gtksalframe.cxx | 1 + - vcl/unx/gtk3/gtk3gtkframe.cxx | 1 + - vcl/unx/gtk3/gtk3gtkobject.cxx | 7 +- - 8 files changed, 157 insertions(+), 105 deletions(-) - -diff --git a/avmedia/Library_avmediagst.mk b/avmedia/Library_avmediagst.mk -index a20a32b..35a56ac 100644 ---- a/avmedia/Library_avmediagst.mk -+++ b/avmedia/Library_avmediagst.mk -@@ -16,7 +16,21 @@ $(eval $(call gb_Library_set_include,avmediagst,\ - -I$(SRCDIR)/avmedia/source/inc \ - $(GSTREAMER_1_0_CFLAGS) \ - )) --$(eval $(call gb_Library_add_libs,avmediagst,$(GSTREAMER_1_0_LIBS))) -+ -+$(eval $(call gb_Library_add_libs,avmediagst,\ -+ $(GSTREAMER_1_0_LIBS) \ -+)) -+ -+ifneq ($(ENABLE_GTK3),) -+$(eval $(call gb_Library_add_cxxflags,avmediagst,\ -+ $$(GTK3_CFLAGS) \ -+ -DENABLE_GTKSINK \ -+)) -+ -+$(eval $(call gb_Library_add_libs,avmediagst,\ -+ $(GTK3_LIBS) \ -+)) -+endif - - $(eval $(call gb_Library_use_external,avmediagst,boost_headers)) - -diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx -index 6dd0f5c..0a97c14 100644 ---- a/avmedia/source/gstreamer/gstplayer.cxx -+++ b/avmedia/source/gstreamer/gstplayer.cxx -@@ -53,18 +53,11 @@ - #include - #include - --#if !defined DBG --# if OSL_DEBUG_LEVEL > 2 - #ifdef AVMEDIA_GST_0_10 - # define AVVERSION "gst 0.10: " - #else - # define AVVERSION "gst 1.0: " - #endif --#define DBG(...) do { fprintf (stderr, "%s", AVVERSION); fprintf (stderr, __VA_ARGS__); fprintf (stderr, "\n"); } while (0); --# else --#define DBG(...) --# endif --#endif - - using namespace ::com::sun::star; - -@@ -289,6 +282,10 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : - GstPlayer_BASE( m_aMutex ), - mxMgr( rxMgr ), - mpPlaybin( nullptr ), -+#if defined(ENABLE_GTKSINK) -+ mpGtkWidget( nullptr ), -+#endif -+ mbUseGtkSink( false ), - mbFakeVideo (false ), - mnUnmutedVolume( 0 ), - mbPlayPending ( false ), -@@ -312,12 +309,12 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : - - mbInitialized = gst_init_check( &argc, &argv, &pError ); - -- DBG( "%p Player::Player", this ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " Player::Player" ); - - if (pError != nullptr) - { - // TODO: throw an exception? -- DBG( "%p Player::Player error '%s'", this, pError->message ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " Player::Player error '" << pError->message << "'" ); - g_error_free (pError); - } - } -@@ -326,7 +323,7 @@ Player::Player( const uno::Reference< lang::XMultiServiceFactory >& rxMgr ) : - - Player::~Player() - { -- DBG( "%p Player::~Player", this ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " Player::~Player" ); - if( mbInitialized ) - disposing(); - } -@@ -339,11 +336,19 @@ void SAL_CALL Player::disposing() - - stop(); - -- DBG( "%p Player::disposing", this ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " Player::disposing" ); - - // Release the elements and pipeline - if( mbInitialized ) - { -+#if defined(ENABLE_GTKSINK) -+ if (mpGtkWidget) -+ { -+ gtk_widget_destroy(mpGtkWidget); -+ mpGtkWidget = nullptr; -+ } -+#endif -+ - if( mpPlaybin ) - { - gst_element_set_state( mpPlaybin, GST_STATE_NULL ); -@@ -391,18 +396,20 @@ void Player::processMessage( GstMessage *message ) - start(); - break; - case GST_MESSAGE_STATE_CHANGED: -- if( message->src == GST_OBJECT( mpPlaybin ) ) { -+ if (message->src == GST_OBJECT(mpPlaybin)) -+ { - GstState newstate, pendingstate; - - gst_message_parse_state_changed (message, nullptr, &newstate, &pendingstate); - -- if( newstate == GST_STATE_PAUSED && -- pendingstate == GST_STATE_VOID_PENDING && -- mpXOverlay ) -- gst_video_overlay_expose( mpXOverlay ); -+ if (!mbUseGtkSink && newstate == GST_STATE_PAUSED && -+ pendingstate == GST_STATE_VOID_PENDING && mpXOverlay) -+ { -+ gst_video_overlay_expose(mpXOverlay); -+ } - -- if (mbPlayPending) -- mbPlayPending = ((newstate == GST_STATE_READY) || (newstate == GST_STATE_PAUSED)); -+ if (mbPlayPending) -+ mbPlayPending = ((newstate == GST_STATE_READY) || (newstate == GST_STATE_PAUSED)); - } - default: - break; -@@ -431,8 +438,6 @@ static gboolean wrap_element_query_duration (GstElement *element, GstFormat form - - GstBusSyncReply Player::processSyncMessage( GstMessage *message ) - { --// DBG( "%p processSyncMessage has handle: %s", this, GST_MESSAGE_TYPE_NAME( message ) ); -- - #if OSL_DEBUG_LEVEL > 0 - if ( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_ERROR ) - { -@@ -441,29 +446,32 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) - - gst_message_parse_error( message, &error, &error_debug ); - SAL_WARN( -- "avmedia", -- "gstreamer error: '" << error->message << "' debug: '" -+ "avmedia.gstreamer", -+ "error: '" << error->message << "' debug: '" - << error_debug << "'"); - } - #endif - -+ if (!mbUseGtkSink) -+ { - #ifdef AVMEDIA_GST_0_10 -- if (message->structure && -- !strcmp( gst_structure_get_name( message->structure ), "prepare-xwindow-id" ) ) -+ if (message->structure && -+ !strcmp( gst_structure_get_name( message->structure ), "prepare-xwindow-id" ) ) - #else -- if (gst_is_video_overlay_prepare_window_handle_message (message) ) -+ if (gst_is_video_overlay_prepare_window_handle_message (message) ) - #endif -- { -- DBG( "%p processSyncMessage prepare window id: %s %d", this, -- GST_MESSAGE_TYPE_NAME( message ), (int)mnWindowID ); -- if( mpXOverlay ) -- g_object_unref( G_OBJECT ( mpXOverlay ) ); -- g_object_set( GST_MESSAGE_SRC( message ), "force-aspect-ratio", FALSE, NULL ); -- mpXOverlay = GST_VIDEO_OVERLAY( GST_MESSAGE_SRC( message ) ); -- g_object_ref( G_OBJECT ( mpXOverlay ) ); -- if ( mnWindowID != 0 ) -- gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID ); -- return GST_BUS_DROP; -+ { -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " processSyncMessage prepare window id: " << -+ GST_MESSAGE_TYPE_NAME( message ) << " " << (int)mnWindowID ); -+ if( mpXOverlay ) -+ g_object_unref( G_OBJECT ( mpXOverlay ) ); -+ g_object_set( GST_MESSAGE_SRC( message ), "force-aspect-ratio", FALSE, nullptr ); -+ mpXOverlay = GST_VIDEO_OVERLAY( GST_MESSAGE_SRC( message ) ); -+ g_object_ref( G_OBJECT ( mpXOverlay ) ); -+ if ( mnWindowID != 0 ) -+ gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID ); -+ return GST_BUS_DROP; -+ } - } - - #ifdef AVMEDIA_GST_0_10 -@@ -473,12 +481,11 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) - - gst_message_parse_state_changed (message, nullptr, &newstate, &pendingstate); - -- DBG( "%p state change received, new state %d pending %d", this, -- (int)newstate, (int)pendingstate ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " state change received, new state " << (int)newState << " pending " << (int)pendingstate ); - if( newstate == GST_STATE_PAUSED && - pendingstate == GST_STATE_VOID_PENDING ) { - -- DBG( "%p change to paused received", this ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " change to paused received" ); - - if( mnDuration == 0) { - gint64 gst_duration = 0L; -@@ -489,7 +496,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) - if( mnWidth == 0 ) { - GList *pStreamInfo = nullptr; - -- g_object_get( G_OBJECT( mpPlaybin ), "stream-info", &pStreamInfo, NULL ); -+ g_object_get( G_OBJECT( mpPlaybin ), "stream-info", &pStreamInfo, nullptr ); - - for ( ; pStreamInfo != nullptr; pStreamInfo = pStreamInfo->next) { - GObject *pInfo = G_OBJECT( pStreamInfo->data ); -@@ -498,7 +505,7 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) - continue; - - int nType; -- g_object_get( pInfo, "type", &nType, NULL ); -+ g_object_get( pInfo, "type", &nType, nullptr ); - GEnumValue *pValue = g_enum_get_value( G_PARAM_SPEC_ENUM( g_object_class_find_property( G_OBJECT_GET_CLASS( pInfo ), "type" ) )->enum_class, - nType ); - -@@ -506,12 +513,12 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) - GstStructure *pStructure; - GstPad *pPad; - -- g_object_get( pInfo, "object", &pPad, NULL ); -+ g_object_get( pInfo, "object", &pPad, nullptr ); - pStructure = gst_caps_get_structure( GST_PAD_CAPS( pPad ), 0 ); - if( pStructure ) { - gst_structure_get_int( pStructure, "width", &mnWidth ); - gst_structure_get_int( pStructure, "height", &mnHeight ); -- DBG( "queried size: %d x %d", mnWidth, mnHeight ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION "queried size: " << mnWidth << "x" << mnHeight ); - } - g_object_unref (pPad); - } -@@ -542,11 +549,11 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) - if( gst_structure_get( gst_caps_get_structure( caps, 0 ), - "width", G_TYPE_INT, &w, - "height", G_TYPE_INT, &h, -- NULL ) ) { -+ nullptr ) ) { - mnWidth = w; - mnHeight = h; - -- DBG( "queried size: %d x %d", mnWidth, mnHeight ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION "queried size: " << mnWidth << "x" << mnHeight ); - - maSizeCondition.set(); - } -@@ -562,7 +569,6 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) - maSizeCondition.set(); - } - } else if( GST_MESSAGE_TYPE( message ) == GST_MESSAGE_ERROR ) { -- DBG( "Error !\n" ); - if( mnWidth == 0 ) { - // an error occurred, set condition so that OOo thread doesn't wait for us - maSizeCondition.set(); -@@ -574,41 +580,48 @@ GstBusSyncReply Player::processSyncMessage( GstMessage *message ) - - void Player::preparePlaybin( const OUString& rURL, GstElement *pSink ) - { -- GstBus *pBus; -+#if defined(ENABLE_GTKSINK) -+ if (mpGtkWidget) -+ { -+ gtk_widget_destroy(mpGtkWidget); -+ mpGtkWidget = nullptr; -+ } -+#endif - -- if( mpPlaybin != nullptr ) { -- gst_element_set_state( mpPlaybin, GST_STATE_NULL ); -- mbPlayPending = false; -- g_object_unref( mpPlaybin ); -- } -+ if (mpPlaybin != nullptr) -+ { -+ gst_element_set_state( mpPlaybin, GST_STATE_NULL ); -+ mbPlayPending = false; -+ g_object_unref( mpPlaybin ); -+ } - -- mpPlaybin = gst_element_factory_make( "playbin", nullptr ); -- if( pSink != nullptr ) // used for getting preferred size etc. -- { -- g_object_set( G_OBJECT( mpPlaybin ), "video-sink", pSink, NULL ); -- mbFakeVideo = true; -- } -- else -- mbFakeVideo = false; -+ mpPlaybin = gst_element_factory_make( "playbin", nullptr ); -+ if( pSink != nullptr ) // used for getting preferred size etc. -+ { -+ g_object_set( G_OBJECT( mpPlaybin ), "video-sink", pSink, nullptr ); -+ mbFakeVideo = true; -+ } -+ else -+ mbFakeVideo = false; - -- OString ascURL = OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 ); -- g_object_set( G_OBJECT( mpPlaybin ), "uri", ascURL.getStr() , NULL ); -+ OString ascURL = OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 ); -+ g_object_set( G_OBJECT( mpPlaybin ), "uri", ascURL.getStr() , nullptr ); - -- pBus = gst_element_get_bus( mpPlaybin ); -- if (mbWatchID) -- { -- g_source_remove(mnWatchID); -- mbWatchID = false; -- } -- mnWatchID = gst_bus_add_watch( pBus, pipeline_bus_callback, this ); -- mbWatchID = true; -- DBG( "%p set sync handler", this ); -+ GstBus *pBus = gst_element_get_bus( mpPlaybin ); -+ if (mbWatchID) -+ { -+ g_source_remove(mnWatchID); -+ mbWatchID = false; -+ } -+ mnWatchID = gst_bus_add_watch( pBus, pipeline_bus_callback, this ); -+ mbWatchID = true; -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " set sync handler" ); - #ifdef AVMEDIA_GST_0_10 -- gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this ); -+ gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this ); - #else -- gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this, nullptr ); -+ gst_bus_set_sync_handler( pBus, pipeline_bus_sync_handler, this, nullptr ); - #endif -- g_object_unref( pBus ); -+ g_object_unref( pBus ); - } - - bool Player::create( const OUString& rURL ) -@@ -617,7 +630,7 @@ bool Player::create( const OUString& rURL ) - - // create all the elements and link them - -- DBG("create player, URL: %s", OUStringToOString( rURL, RTL_TEXTENCODING_UTF8 ).getStr()); -+ SAL_INFO( "avmedia.gstreamer", "create player, URL: '" << rURL << "'" ); - - if( mbInitialized && !rURL.isEmpty() ) - { -@@ -665,7 +678,7 @@ void SAL_CALL Player::stop() - gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); - - mbPlayPending = false; -- DBG( "stop %p", mpPlaybin ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION "stop " << mpPlaybin ); - } - - -@@ -683,7 +696,7 @@ sal_Bool SAL_CALL Player::isPlaying() - bRet = GST_STATE_PLAYING == GST_STATE( mpPlaybin ); - } - -- DBG( "isPlaying %d", bRet ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION "isPlaying " << bRet ); - - return bRet; - } -@@ -723,7 +736,7 @@ void SAL_CALL Player::setMediaTime( double fTime ) - if( !isPlaying() ) - gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); - -- DBG( "seek to: %" SAL_PRIdINT64 " ns original: %lf s", gst_position, fTime ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION "seek to: " << gst_position << " ns original: " << fTime << " s" ); - } - } - -@@ -771,7 +784,7 @@ void SAL_CALL Player::setMute( sal_Bool bSet ) - { - ::osl::MutexGuard aGuard(m_aMutex); - -- DBG( "set mute: %d muted: %d unmuted volume: %lf", bSet, mbMuted, mnUnmutedVolume ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION "set mute: " << bSet << " muted: " << mbMuted << " unmuted volume: " << mnUnmutedVolume ); - - // change the volume to 0 or the unmuted volume - if( mpPlaybin && mbMuted != bool(bSet) ) -@@ -782,7 +795,7 @@ void SAL_CALL Player::setMute( sal_Bool bSet ) - nVolume = 0.0; - } - -- g_object_set( G_OBJECT( mpPlaybin ), "volume", nVolume, NULL ); -+ g_object_set( G_OBJECT( mpPlaybin ), "volume", nVolume, nullptr ); - - mbMuted = bSet; - } -@@ -807,12 +820,12 @@ void SAL_CALL Player::setVolumeDB( sal_Int16 nVolumeDB ) - - mnUnmutedVolume = pow( 10.0, nVolumeDB / 20.0 ); - -- DBG( "set volume: %d gst volume: %lf", nVolumeDB, mnUnmutedVolume ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION "set volume: " << nVolumeDB << " gst volume: " << mnUnmutedVolume ); - - // change volume - if( !mbMuted && mpPlaybin ) - { -- g_object_set( G_OBJECT( mpPlaybin ), "volume", (gdouble) mnUnmutedVolume, NULL ); -+ g_object_set( G_OBJECT( mpPlaybin ), "volume", (gdouble) mnUnmutedVolume, nullptr ); - } - } - -@@ -828,7 +841,7 @@ sal_Int16 SAL_CALL Player::getVolumeDB() - if( mpPlaybin ) { - double nGstVolume = 0.0; - -- g_object_get( G_OBJECT( mpPlaybin ), "volume", &nGstVolume, NULL ); -+ g_object_get( G_OBJECT( mpPlaybin ), "volume", &nGstVolume, nullptr ); - - nVolumeDB = (sal_Int16) ( 20.0*log10 ( nGstVolume ) ); - } -@@ -847,18 +860,15 @@ awt::Size SAL_CALL Player::getPreferredPlayerWindowSize() - - if( maURL.isEmpty() ) - { -- DBG( "%p Player::getPreferredPlayerWindowSize - empty URL => 0x0", this ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " Player::getPreferredPlayerWindowSize - empty URL => 0x0" ); - return aSize; - } - -- DBG( "%p pre-Player::getPreferredPlayerWindowSize, member %d x %d", this, mnWidth, mnHeight ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " pre-Player::getPreferredPlayerWindowSize, member " << mnWidth << "x" << mnHeight ); - --#if OSL_DEBUG_LEVEL > 2 -- osl::Condition::Result aResult = --#endif -- maSizeCondition.wait( std::chrono::seconds(10) ); -+ osl::Condition::Result aResult = maSizeCondition.wait( std::chrono::seconds(10) ); - -- DBG( "%p Player::getPreferredPlayerWindowSize after waitCondition %d, member %d x %d", this, aResult, mnWidth, mnHeight ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << this << " Player::getPreferredPlayerWindowSize after waitCondition " << aResult << ", member " << mnWidth << "x" << mnHeight ); - - if( mnWidth != 0 && mnHeight != 0 ) { - aSize.Width = mnWidth; -@@ -881,7 +891,7 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co - if( mbFakeVideo ) - preparePlaybin( maURL, nullptr ); - -- DBG( "Player::createPlayerWindow %d %d length: %d", aSize.Width, aSize.Height, rArguments.getLength() ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << "Player::createPlayerWindow " << aSize.Width << "x" << aSize.Height << " length: " << rArguments.getLength() ); - - if( aSize.Width > 0 && aSize.Height > 0 ) - { -@@ -898,11 +908,31 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co - OSL_ASSERT(pEnvData); - if (pEnvData) - { -- mnWindowID = pEnvData->aWindow; -- DBG( "set window id to %d XOverlay %p\n", (int)mnWindowID, mpXOverlay); -- gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); -- if ( mpXOverlay != nullptr ) -- gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID ); -+#if defined(ENABLE_GTKSINK) -+ GstElement *pVideosink = g_strcmp0(pEnvData->pToolkit, "gtk3") == 0 ? -+ gst_element_factory_make("gtksink", "gtksink") : nullptr; -+ if (pVideosink) -+ { -+ mbUseGtkSink = true; -+ g_object_get(pVideosink, "widget", &mpGtkWidget, nullptr); -+ GtkWidget *pParent = (GtkWidget*)(pEnvData->pWidget); -+ gtk_container_add (GTK_CONTAINER(pParent), mpGtkWidget); -+ -+ g_object_set( G_OBJECT( mpPlaybin ), "video-sink", pVideosink, nullptr); -+ g_object_set( G_OBJECT( mpPlaybin ), "force-aspect-ratio", FALSE, nullptr); -+ -+ gtk_widget_show_all (pParent); -+ } -+ else -+#endif -+ { -+ mbUseGtkSink = false; -+ mnWindowID = pEnvData->aWindow; -+ SAL_INFO( "avmedia.gstreamer", AVVERSION "set window id to " << (int)mnWindowID << " XOverlay " << mpXOverlay); -+ gst_element_set_state( mpPlaybin, GST_STATE_PAUSED ); -+ if ( mpXOverlay != nullptr ) -+ gst_video_overlay_set_window_handle( mpXOverlay, mnWindowID ); -+ } - } - } - } -@@ -910,8 +940,6 @@ uno::Reference< ::media::XPlayerWindow > SAL_CALL Player::createPlayerWindow( co - return xRet; - } - -- -- - uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() - throw (uno::RuntimeException, std::exception) - { -@@ -921,7 +949,7 @@ uno::Reference< media::XFrameGrabber > SAL_CALL Player::createFrameGrabber() - - if( ( aPrefSize.Width > 0 ) && ( aPrefSize.Height > 0 ) ) - pFrameGrabber = FrameGrabber::create( maURL ); -- DBG( "created FrameGrabber %p", pFrameGrabber ); -+ SAL_INFO( "avmedia.gstreamer", AVVERSION << "created FrameGrabber " << pFrameGrabber ); - - return pFrameGrabber; - } -diff --git a/avmedia/source/gstreamer/gstplayer.hxx b/avmedia/source/gstreamer/gstplayer.hxx -index 52095b0..ffc5133 100644 ---- a/avmedia/source/gstreamer/gstplayer.hxx -+++ b/avmedia/source/gstreamer/gstplayer.hxx -@@ -27,6 +27,10 @@ - #include - #include - -+#if defined(ENABLE_GTKSINK) -+# include -+#endif -+ - typedef struct _GstVideoOverlay GstVideoOverlay; - - namespace avmedia { namespace gstreamer { -@@ -83,6 +87,10 @@ protected: - - // Add elements and pipeline here - GstElement* mpPlaybin; // the playbin is also a pipeline -+#if defined(ENABLE_GTKSINK) -+ GtkWidget* mpGtkWidget; -+#endif -+ bool mbUseGtkSink; - bool mbFakeVideo; - - gdouble mnUnmutedVolume; -diff --git a/include/vcl/sysdata.hxx b/include/vcl/sysdata.hxx -index 5ae9947..02e0c1e 100644 ---- a/include/vcl/sysdata.hxx -+++ b/include/vcl/sysdata.hxx -@@ -72,6 +72,7 @@ struct SystemEnvData - void* pAppContext; // the application context in use - long aShellWindow; // the window of the frame's shell - void* pShellWidget; // the frame's shell widget -+ const char* pToolkit; // the toolkit in use (gtk2 vs gtk3) - #endif - - SystemEnvData() -@@ -95,6 +96,7 @@ struct SystemEnvData - , pAppContext(nullptr) - , aShellWindow(0) - , pShellWidget(nullptr) -+ , pToolkit(nullptr) - #endif - { - } -diff --git a/vcl/unx/gtk/gtkobject.cxx b/vcl/unx/gtk/gtkobject.cxx -index cc78ff5..18aa63a 100644 ---- a/vcl/unx/gtk/gtkobject.cxx -+++ b/vcl/unx/gtk/gtkobject.cxx -@@ -63,6 +63,7 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, bool bShow ) - m_aSystemData.nScreen = pParent->getXScreenNumber().getXScreen(); - m_aSystemData.pAppContext = nullptr; - m_aSystemData.pShellWidget = GTK_WIDGET(pParent->getWindow()); -+ m_aSystemData.pToolkit = "gtk2"; - - g_signal_connect( G_OBJECT(m_pSocket), "button-press-event", G_CALLBACK(signalButton), this ); - g_signal_connect( G_OBJECT(m_pSocket), "button-release-event", G_CALLBACK(signalButton), this ); -diff --git a/vcl/unx/gtk/gtksalframe.cxx b/vcl/unx/gtk/gtksalframe.cxx -index d44207e..7a7c293 100644 ---- a/vcl/unx/gtk/gtksalframe.cxx -+++ b/vcl/unx/gtk/gtksalframe.cxx -@@ -1022,6 +1022,7 @@ void GtkSalFrame::InitCommon() - m_aSystemData.nScreen = m_nXScreen.getXScreen(); - m_aSystemData.pAppContext = nullptr; - m_aSystemData.pShellWidget = m_aSystemData.pWidget; -+ m_aSystemData.pToolkit = "gtk2"; - - m_bGraphics = false; - m_pGraphics = NULL; -diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx -index 925b185..3b34385 100644 ---- a/vcl/unx/gtk3/gtk3gtkframe.cxx -+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx -@@ -1097,6 +1097,7 @@ void GtkSalFrame::InitCommon() - m_aSystemData.nScreen = m_nXScreen.getXScreen(); - m_aSystemData.pAppContext = nullptr; - m_aSystemData.pShellWidget = m_aSystemData.pWidget; -+ m_aSystemData.pToolkit = "gtk3"; - - m_bGraphics = false; - m_pGraphics = nullptr; -diff --git a/vcl/unx/gtk3/gtk3gtkobject.cxx b/vcl/unx/gtk3/gtk3gtkobject.cxx -index 1154033..8f1c032 100644 ---- a/vcl/unx/gtk3/gtk3gtkobject.cxx -+++ b/vcl/unx/gtk3/gtk3gtkobject.cxx -@@ -36,7 +36,7 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, bool bShow ) - if( pParent ) - { - // our plug window -- m_pSocket = gtk_drawing_area_new(); -+ m_pSocket = gtk_grid_new(); - Show( bShow ); - // insert into container - gtk_fixed_put( pParent->getFixedContainer(), -@@ -45,10 +45,6 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, bool bShow ) - // realize so we can get a window id - gtk_widget_realize( m_pSocket ); - -- // make it transparent; some plugins may not insert -- // their own window here but use the socket window itself -- gtk_widget_set_app_paintable( m_pSocket, TRUE ); -- - // system data - m_aSystemData.nSize = sizeof( SystemEnvData ); - m_aSystemData.aWindow = pParent->GetNativeWindowHandle(m_pSocket); -@@ -58,6 +54,7 @@ GtkSalObject::GtkSalObject( GtkSalFrame* pParent, bool bShow ) - m_aSystemData.nScreen = pParent->getXScreenNumber().getXScreen(); - m_aSystemData.pAppContext = nullptr; - m_aSystemData.pShellWidget = GTK_WIDGET(pParent->getWindow()); -+ m_aSystemData.pToolkit = "gtk3"; - - g_signal_connect( G_OBJECT(m_pSocket), "button-press-event", G_CALLBACK(signalButton), this ); - g_signal_connect( G_OBJECT(m_pSocket), "button-release-event", G_CALLBACK(signalButton), this ); --- -2.7.1 - diff --git a/0008-gtk3-implement-native-context-menus.patch b/0008-gtk3-implement-native-context-menus.patch index 50a6c7f..a4ff7b6 100644 --- a/0008-gtk3-implement-native-context-menus.patch +++ b/0008-gtk3-implement-native-context-menus.patch @@ -51,7 +51,7 @@ index 1d58b7a..d95d25c 100644 GMenuModel* mpMenuModel; GActionGroup* mpActionGroup; - GtkSalMenu* GetMenuForItemCommand( gchar* aCommand, gboolean bGetSubmenu ); + GtkSalMenu* GetMenuForItemCommand( gchar* aCommand, int& rDupsToSkip, gboolean bGetSubmenu ); - void ImplUpdate( gboolean bRecurse ); + void ImplUpdate(bool bRecurse, bool bRemoveDisabledEntries); void ActivateAllSubmenus(Menu* pMenuBar); @@ -486,7 +486,7 @@ index 346e42d..7bc9232 100644 UpdateFull(); g_lo_menu_insert_section( pMenuModel, 0, nullptr, mpMenuModel ); -@@ -618,14 +746,9 @@ GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* aCommand, gboolean bGetSub +@@ -618,16 +746,11 @@ GtkSalMenu* GtkSalMenu::GetMenuForItemCommand( gchar* aCommand, gboolean bGetSub void GtkSalMenu::DispatchCommand( gint itemId, const gchar *aCommand ) { SolarMutexGuard aGuard; @@ -494,7 +494,9 @@ index 346e42d..7bc9232 100644 - if ( !mbMenuBar ) - return; - - GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast(aCommand), FALSE ); + int nDupsToSkip; + aCommand = DetermineDupIndex(aCommand, nDupsToSkip); + GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast(aCommand), nDupsToSkip, FALSE ); Menu* pSubMenu = ( pSalSubMenu != nullptr ) ? pSalSubMenu->GetMenu() : nullptr; - - mpVCLMenu->HandleMenuCommandEvent( pSubMenu, itemId ); @@ -519,9 +521,9 @@ index 346e42d..7bc9232 100644 - if ( !mbMenuBar ) - return; - - GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast(aMenuCommand), TRUE ); - - if ( pSalSubMenu != nullptr ) { + int nDupsToSkip; + aMenuCommand = DetermineDupIndex(aMenuCommand, nDupsToSkip); + GtkSalMenu* pSalSubMenu = GetMenuForItemCommand( const_cast(aMenuCommand), nDupsToSkip, TRUE ); @@ -675,15 +792,14 @@ void GtkSalMenu::Deactivate( const gchar* aMenuCommand ) void GtkSalMenu::Display( bool bVisible ) diff --git a/libreoffice.spec b/libreoffice.spec index 66e5867..5fd6832 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -1,5 +1,5 @@ # download path contains version without the last (fourth) digit -%define libo_version 5.1.1 +%define libo_version 5.1.2 # Should contain .alphaX / .betaX, if this is pre-release (actually # pre-RC) version. The pre-release string is part of tarball file names, # so we need a way to define it easily at one place. @@ -56,8 +56,8 @@ Summary: Free Software Productivity Suite Name: libreoffice Epoch: 1 -Version: %{libo_version}.3 -Release: 3%{?libo_prerelease}%{?dist} +Version: %{libo_version}.1 +Release: 1%{?libo_prerelease}%{?dist} License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and Artistic and MPLv2.0 and CC0 URL: http://www.libreoffice.org/ @@ -239,34 +239,26 @@ Patch5: 0001-never-run-autogen.sh.patch Patch6: 0001-add-X-TryExec-entries-to-desktop-files.patch # not upstreamed Patch7: 0001-disable-PSD-import-test-which-deadlocks-on-ARM.patch -Patch8: 0001-Related-rhbz-1281906-set-a-min-size-on-un-resizeable.patch -Patch9: 0001-but-only-for-dialog.patch -Patch10: 0003-gtk3-wayland-start-floating-windows-hidden.patch -Patch11: 0001-tdf-95450-avoid-double-swap-on-big-endian-arches.patch -Patch12: 0001-these-popups-should-start-invisible-and-take-default.patch -Patch13: 0002-disable-tearability-of-color-window.patch -Patch14: 0001-rhbz-1168757-propagate-selected-slides-to-print-dial.patch -Patch15: 0001-hack-out-optimization-to-build.patch -Patch16: 0001-generate-better-unit-test-assert-message.patch -Patch17: 0001-gtk3-adapt-to-3.20-style-changes.patch -Patch18: 0001-unused-vcl-IsWindowSystemAvailable.patch -Patch19: 0002-split-the-gtk2-and-gtk3-gtkobjects.patch -Patch20: 0003-rename-X11WindowProvider-to-a-NativeWindowHandle-pro.patch -Patch21: 0004-implement-wayland-handle-passing-for-gstreamer.patch -Patch22: 0005-gtk3-wayland-play-video-via-gtksink-gstreamer-elemen.patch -Patch23: 0001-gtk3-get-app-menu-working-again-under-gtk3.patch -Patch24: 0001-tdf-97665-Let-s-hope-that-over-activation-isn-t-real.patch -Patch25: 0002-gtk3-some-changes-towards-enabling-native-gtk3-popup.patch -Patch26: 0003-gtk3-vcl-popups-flush-any-unexecuted-Select-events-o.patch -Patch27: 0004-gtk3-replace-old-action-if-same-command-is-added.patch -Patch28: 0005-gtk3-handle-items-without-commands.patch -Patch29: 0006-mark-checkable-toolbox-menu-entries-as-checkable.patch -Patch30: 0007-set-gtk-layout-direction-to-match-ours.patch -Patch31: 0008-gtk3-implement-native-context-menus.patch -Patch32: 0001-Resolves-rhbz-1315385-use-preferred-size-if-widget-s.patch -Patch33: 0001-gtk3-various-bits-means-different-things-again.patch -Patch34: 0001-Resolves-tdf-98638-sometimes-menu-grab-doesn-t-take.patch -Patch35: 0001-Resolves-tdf-98636.patch +Patch8: 0001-but-only-for-dialog.patch +Patch9: 0003-gtk3-wayland-start-floating-windows-hidden.patch +Patch10: 0001-tdf-95450-avoid-double-swap-on-big-endian-arches.patch +Patch11: 0001-these-popups-should-start-invisible-and-take-default.patch +Patch12: 0002-disable-tearability-of-color-window.patch +Patch13: 0001-rhbz-1168757-propagate-selected-slides-to-print-dial.patch +Patch14: 0001-hack-out-optimization-to-build.patch +Patch15: 0001-generate-better-unit-test-assert-message.patch +Patch16: 0001-tdf-97665-Let-s-hope-that-over-activation-isn-t-real.patch +Patch17: 0002-gtk3-some-changes-towards-enabling-native-gtk3-popup.patch +Patch18: 0003-gtk3-vcl-popups-flush-any-unexecuted-Select-events-o.patch +Patch19: 0004-gtk3-replace-old-action-if-same-command-is-added.patch +Patch20: 0005-gtk3-handle-items-without-commands.patch +Patch21: 0006-mark-checkable-toolbox-menu-entries-as-checkable.patch +Patch22: 0007-set-gtk-layout-direction-to-match-ours.patch +Patch23: 0008-gtk3-implement-native-context-menus.patch +Patch24: 0001-Resolves-rhbz-1315385-use-preferred-size-if-widget-s.patch +Patch25: 0001-gtk3-various-bits-means-different-things-again.patch +Patch26: 0001-Resolves-tdf-98638-sometimes-menu-grab-doesn-t-take.patch +Patch27: 0001-Resolves-tdf-98636.patch %if ! 0%{?rhel} Patch400: 0001-Update-liborcus-to-0.11.0.patch @@ -2262,7 +2254,8 @@ done %endif %changelog -* Sat Mar 12 2016 David Tardon - 1:5.1.1.3-3 +* Wed Mar 16 2016 David Tardon - 1:5.1.2.1-1 +- update to 5.1.2 rc1 - split VCL plugins into subpackages - rename libreoffice-kde to libreoffice-kde4 - only recommend fonts diff --git a/sources b/sources index 7b982a9..787a2fa 100644 --- a/sources +++ b/sources @@ -7,6 +7,6 @@ a7983f859eafb2677d7ff386a023bc40 a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2. 0168229624cfac409e766913506961a8 0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz 12fb8b5b0d5132726e57b9b9fc7e22c4 libreoffice-multiliblauncher.sh 4b87018f7fff1d054939d19920b751a0 4b87018f7fff1d054939d19920b751a0-collada2gltf-master-cb1d97788a.tar.bz2 -5354a6172015603ba057a2fbbfc9977e libreoffice-5.1.1.3.tar.xz -c4bde6b9f65eea1b0d7e6dc73537cdab libreoffice-help-5.1.1.3.tar.xz -4cfbacd4328863aaf08107e7d3b329a7 libreoffice-translations-5.1.1.3.tar.xz +81f5f045fc82f9704e3d12479cd66139 libreoffice-5.1.2.1.tar.xz +f66f2ec791f3d985c6b890bac84652ae libreoffice-help-5.1.2.1.tar.xz +f61491559c3c1a2a442272a6dd84f2c7 libreoffice-translations-5.1.2.1.tar.xz