diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-04-06 16:18:13 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-04-06 16:18:41 +0100 |
commit | 95b720f6d7ba2639c06ba07c3f70aca871a45950 (patch) | |
tree | 97654e80487679996736354f9dcbb6baf62ee460 /vcl | |
parent | d02a015593fc129d55e03e2b6d4caacd4e6d3787 (diff) |
revert to fix tdf#98783 missing menubar
Change-Id: Ia322149a7ed461f528af856d9907fe4620f9e97f
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/osx/salinst.h | 2 | ||||
-rw-r--r-- | vcl/inc/salinst.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtkinst.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/unx/gtk/gtksalmenu.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/win/salinst.h | 2 | ||||
-rw-r--r-- | vcl/osx/salmenu.cxx | 2 | ||||
-rw-r--r-- | vcl/source/app/salvtables.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 15 | ||||
-rw-r--r-- | vcl/unx/gtk/gtkinst.cxx | 19 | ||||
-rw-r--r-- | vcl/unx/gtk/gtksalmenu.cxx | 28 | ||||
-rw-r--r-- | vcl/win/window/salmenu.cxx | 2 |
11 files changed, 31 insertions, 48 deletions
diff --git a/vcl/inc/osx/salinst.h b/vcl/inc/osx/salinst.h index fec12ecea07f..972ad7be8cbe 100644 --- a/vcl/inc/osx/salinst.h +++ b/vcl/inc/osx/salinst.h @@ -111,7 +111,7 @@ public: virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) override; virtual bool AnyInput( VclInputFlags nType ) override; - virtual SalMenu* CreateMenu( bool bMenuBar, Menu* pVCLMenu, SystemWindow* pAssociatedSystemWindow ) override; + virtual SalMenu* CreateMenu( bool bMenuBar, Menu* pVCLMenu ) override; virtual void DestroyMenu( SalMenu* ) override; virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ) override; virtual void DestroyMenuItem( SalMenuItem* ) override; diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx index 6486ae67e04f..6502679d426a 100644 --- a/vcl/inc/salinst.hxx +++ b/vcl/inc/salinst.hxx @@ -53,7 +53,6 @@ struct SalItemParams; class SalSession; struct SystemGraphicsData; struct SystemWindowData; -class SystemWindow; class Menu; enum class VclInputFlags; enum class SalFrameStyleFlags; @@ -138,7 +137,7 @@ public: virtual bool AnyInput( VclInputFlags nType ) = 0; // menus - virtual SalMenu* CreateMenu( bool bMenuBar, Menu* pMenu, SystemWindow* pAssociatedSystemWindow ); + virtual SalMenu* CreateMenu( bool bMenuBar, Menu* pMenu ); virtual void DestroyMenu( SalMenu* pMenu); virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ); virtual void DestroyMenuItem( SalMenuItem* pItem ); diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx index 5fec57974483..6f1f9999bc9b 100644 --- a/vcl/inc/unx/gtk/gtkinst.hxx +++ b/vcl/inc/unx/gtk/gtkinst.hxx @@ -199,7 +199,7 @@ public: virtual SalSystem* CreateSalSystem() override; virtual SalInfoPrinter* CreateInfoPrinter(SalPrinterQueueInfo* pPrinterQueueInfo, ImplJobSetup* pJobSetup) override; virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ) override; - virtual SalMenu* CreateMenu( bool, Menu*, SystemWindow* ) override; + virtual SalMenu* CreateMenu( bool, Menu* ) override; virtual void DestroyMenu( SalMenu* pMenu ) override; virtual SalMenuItem* CreateMenuItem( const SalItemParams* ) override; virtual void DestroyMenuItem( SalMenuItem* pItem ) override; diff --git a/vcl/inc/unx/gtk/gtksalmenu.hxx b/vcl/inc/unx/gtk/gtksalmenu.hxx index 95789a0fa1d2..240f22f029c0 100644 --- a/vcl/inc/unx/gtk/gtksalmenu.hxx +++ b/vcl/inc/unx/gtk/gtksalmenu.hxx @@ -59,7 +59,7 @@ private: void ActivateAllSubmenus(Menu* pMenuBar); public: - GtkSalMenu(bool bMenuBar, GActionGroup* pActionGroup); + GtkSalMenu( bool bMenuBar ); virtual ~GtkSalMenu(); virtual bool VisibleMenuBar() override; // must return TRUE to actually DISPLAY native menu bars diff --git a/vcl/inc/win/salinst.h b/vcl/inc/win/salinst.h index 35d3d408fbd2..b6408ea4f322 100644 --- a/vcl/inc/win/salinst.h +++ b/vcl/inc/win/salinst.h @@ -74,7 +74,7 @@ public: virtual SalYieldResult DoYield(bool bWait, bool bHandleAllCurrentEvents, sal_uLong nReleased) override; virtual bool AnyInput( VclInputFlags nType ) override; - virtual SalMenu* CreateMenu( bool bMenuBar, Menu*, SystemWindow* ) override; + virtual SalMenu* CreateMenu( bool bMenuBar, Menu* ) override; virtual void DestroyMenu( SalMenu* ) override; virtual SalMenuItem* CreateMenuItem( const SalItemParams* pItemData ) override; virtual void DestroyMenuItem( SalMenuItem* ) override; diff --git a/vcl/osx/salmenu.cxx b/vcl/osx/salmenu.cxx index ad6ce395a2dc..00f099105818 100644 --- a/vcl/osx/salmenu.cxx +++ b/vcl/osx/salmenu.cxx @@ -220,7 +220,7 @@ static void initAppMenu() } } -SalMenu* AquaSalInstance::CreateMenu( bool bMenuBar, Menu* pVCLMenu, SystemWindow* /*pAssociatedSystemWindow*/ ) +SalMenu* AquaSalInstance::CreateMenu( bool bMenuBar, Menu* pVCLMenu ) { initAppMenu(); diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 116c772c3324..c135cdf42294 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -65,7 +65,7 @@ SalInstance::~SalInstance() { } -SalMenu* SalInstance::CreateMenu( bool, Menu*, SystemWindow* ) +SalMenu* SalInstance::CreateMenu( bool, Menu* ) { // default: no native menus return nullptr; diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index c31887e2d013..810525ba1234 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -2488,15 +2488,14 @@ MenuBarWindow* MenuBar::getMenuBarWindow() return pWin; } -MenuBar::MenuBar(SystemWindow* pAssociatedSystemWindow) +MenuBar::MenuBar() : Menu(), mbCloseBtnVisible(false), mbFloatBtnVisible(false), mbHideBtnVisible(false), - mbDisplayable(true), - mxAssociatedSystemWindow(pAssociatedSystemWindow) + mbDisplayable(true) { - mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(true, this, mxAssociatedSystemWindow.get()); + mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(true, this); } MenuBar::MenuBar( const MenuBar& rMenu ) @@ -2506,7 +2505,7 @@ MenuBar::MenuBar( const MenuBar& rMenu ) mbHideBtnVisible(false), mbDisplayable(true) { - mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(true, this, mxAssociatedSystemWindow.get()); + mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(true, this); *this = rMenu; } @@ -2780,13 +2779,13 @@ MenuFloatingWindow * PopupMenu::ImplGetFloatingWindow() const { PopupMenu::PopupMenu() : pRefAutoSubMenu(nullptr) { - mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this, nullptr); + mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this); } PopupMenu::PopupMenu( const ResId& rResId ) : pRefAutoSubMenu(nullptr) { - mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this, nullptr); + mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this); ResMgr* pMgr = rResId.GetResMgr(); if( ! pMgr ) @@ -2820,7 +2819,7 @@ PopupMenu::PopupMenu( const PopupMenu& rMenu ) : Menu(), pRefAutoSubMenu(nullptr) { - mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this, nullptr); + mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu(false, this); *this = rMenu; } diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx index 0bdaf3ee7a9f..368cdfb2c577 100644 --- a/vcl/unx/gtk/gtkinst.cxx +++ b/vcl/unx/gtk/gtkinst.cxx @@ -32,7 +32,6 @@ #include <headless/svpvd.hxx> #include <headless/svpbmp.hxx> #include <vcl/inputtypes.hxx> -#include <vcl/syswin.hxx> #include <unx/genpspgraphics.h> #include <rtl/strbuf.hxx> #include <rtl/uri.hxx> @@ -348,24 +347,10 @@ SalBitmap* GtkInstance::CreateSalBitmap() #ifdef ENABLE_GMENU_INTEGRATION -SalMenu* GtkInstance::CreateMenu( bool bMenuBar, Menu* pVCLMenu, SystemWindow* pAssociatedSystemWindow ) +SalMenu* GtkInstance::CreateMenu( bool bMenuBar, Menu* pVCLMenu ) { EnsureInit(); - - GtkSalFrame *pFrame = pAssociatedSystemWindow ? dynamic_cast<GtkSalFrame*>(pAssociatedSystemWindow->ImplGetFrame()) - : nullptr; - - GActionGroup* pActionGroup; - if (pFrame) - { - GtkWidget* pWidget = pFrame->getWindow(); - GdkWindow* gdkWindow = gtk_widget_get_window( pWidget ); - pActionGroup = G_ACTION_GROUP( g_object_get_data( G_OBJECT( gdkWindow ), "g-lo-action-group" ) ); - } - else - pActionGroup = nullptr; - - GtkSalMenu* pSalMenu = new GtkSalMenu(bMenuBar, pActionGroup); + GtkSalMenu* pSalMenu = new GtkSalMenu( bMenuBar ); pSalMenu->SetMenu( pVCLMenu ); return pSalMenu; } diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx index 6c904ced957e..44e555918f0a 100644 --- a/vcl/unx/gtk/gtksalmenu.cxx +++ b/vcl/unx/gtk/gtksalmenu.cxx @@ -456,26 +456,16 @@ bool GtkSalMenu::ShowNativePopupMenu(FloatingWindow* pWin, const Rectangle& rRec * GtkSalMenu */ -GtkSalMenu::GtkSalMenu( bool bMenuBar, GActionGroup *pActionGroup ) : +GtkSalMenu::GtkSalMenu( bool bMenuBar ) : mbMenuBar( bMenuBar ), mpMenuBarWidget( nullptr ), mpCloseButton( nullptr ), mpVCLMenu( nullptr ), mpParentSalMenu( nullptr ), mpFrame( nullptr ), - mpActionGroup(pActionGroup) + mpMenuModel( nullptr ), + mpActionGroup( nullptr ) { - if (bMenuBar) - mpMenuModel = G_MENU_MODEL(g_lo_menu_new()); - else - mpMenuModel = nullptr; - - GLOActionGroup* pLOActionGroup = G_LO_ACTION_GROUP( mpActionGroup ); - if (pLOActionGroup) - { - g_lo_action_group_clear(pLOActionGroup); - g_lo_action_group_set_top_menu(pLOActionGroup, static_cast<gpointer>(this)); - } } void GtkSalMenu::SetMenuModel(GMenuModel* pMenuModel) @@ -674,12 +664,22 @@ void GtkSalMenu::SetFrame(const SalFrame* pFrame) GdkWindow* gdkWindow = gtk_widget_get_window( pWidget ); GLOMenu* pMenuModel = G_LO_MENU( g_object_get_data( G_OBJECT( gdkWindow ), "g-lo-menubar" ) ); - SAL_INFO("vcl.unity", "Found menu model: " << pMenuModel); + GLOActionGroup* pActionGroup = G_LO_ACTION_GROUP( g_object_get_data( G_OBJECT( gdkWindow ), "g-lo-action-group" ) ); + SAL_INFO("vcl.unity", "Found menu model: " << pMenuModel << " and action group: " << pActionGroup); if ( pMenuModel ) { if ( g_menu_model_get_n_items( G_MENU_MODEL( pMenuModel ) ) > 0 ) g_lo_menu_remove( pMenuModel, 0 ); + + mpMenuModel = G_MENU_MODEL( g_lo_menu_new() ); + } + + if ( pActionGroup ) + { + g_lo_action_group_clear( pActionGroup ); + g_lo_action_group_set_top_menu(pActionGroup, static_cast<gpointer>(this)); + mpActionGroup = G_ACTION_GROUP( pActionGroup ); } // Generate the main menu structure. diff --git a/vcl/win/window/salmenu.cxx b/vcl/win/window/salmenu.cxx index 1f038bedbe3f..0b623e25b1b4 100644 --- a/vcl/win/window/salmenu.cxx +++ b/vcl/win/window/salmenu.cxx @@ -43,7 +43,7 @@ bool SalData::IsKnownMenuHandle( HMENU hMenu ) // WinSalInst factory methods -SalMenu* WinSalInstance::CreateMenu( bool bMenuBar, Menu*, SystemWindow* /*pAssociatedSystemWindow*/ ) +SalMenu* WinSalInstance::CreateMenu( bool bMenuBar, Menu* ) { WinSalMenu *pSalMenu = new WinSalMenu(); |