diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2013-11-03 21:59:55 +0400 |
---|---|---|
committer | Ivan Timofeev <timofeev.i.s@gmail.com> | 2013-11-03 22:08:40 +0400 |
commit | 2e25016289d5f565ba4080625950ef6ca6487d34 (patch) | |
tree | 5ba8a554c6dd3067970109f993bcfd52730225c0 /vcl | |
parent | 574d7d9c79e40c09bee34d3e692d1d88d6a2b975 (diff) |
fdo#70885: disable app menu under Unity
Change-Id: I90ca2f5dd8d2678dff74ae5599e640c9a69aee33
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/desktops.hxx | 1 | ||||
-rw-r--r-- | vcl/unx/generic/desktopdetect/desktopdetector.cxx | 12 | ||||
-rw-r--r-- | vcl/unx/generic/plugadapt/salplug.cxx | 3 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtksalframe.cxx | 9 |
4 files changed, 20 insertions, 5 deletions
diff --git a/vcl/inc/unx/desktops.hxx b/vcl/inc/unx/desktops.hxx index f67e8ca9a8ba..0515cf587f8d 100644 --- a/vcl/inc/unx/desktops.hxx +++ b/vcl/inc/unx/desktops.hxx @@ -24,6 +24,7 @@ enum DesktopType { DESKTOP_NONE, // headless, i.e. no X connection at all DESKTOP_UNKNOWN, // unknown desktop, simple WM, etc. DESKTOP_GNOME, + DESKTOP_UNITY, DESKTOP_XFCE, DESKTOP_MATE, DESKTOP_KDE, diff --git a/vcl/unx/generic/desktopdetect/desktopdetector.cxx b/vcl/unx/generic/desktopdetect/desktopdetector.cxx index f18bf0a73108..1d5d223fee29 100644 --- a/vcl/unx/generic/desktopdetect/desktopdetector.cxx +++ b/vcl/unx/generic/desktopdetect/desktopdetector.cxx @@ -291,6 +291,8 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() return DESKTOP_KDE4; if ( aOver.equalsIgnoreAsciiCase( "gnome" ) ) return DESKTOP_GNOME; + if ( aOver.equalsIgnoreAsciiCase( "unity" ) ) + return DESKTOP_UNITY; if ( aOver.equalsIgnoreAsciiCase( "xfce" ) ) return DESKTOP_XFCE; if ( aOver.equalsIgnoreAsciiCase( "mate" ) ) @@ -351,12 +353,18 @@ DESKTOP_DETECTOR_PUBLIC DesktopType get_desktop_environment() const char *pSession; OString aDesktopSession; - if ( ( pSession = getenv( "DESKTOP_SESSION" ) ) ) aDesktopSession = OString( pSession, strlen( pSession ) ); + const char *pDesktop; + OString aCurrentDesktop; + if ( ( pDesktop = getenv( "XDG_CURRENT_DESKTOP" ) ) ) + aCurrentDesktop = OString( pDesktop, strlen( pDesktop ) ); + // fast environment variable checks - if ( aDesktopSession.equalsIgnoreAsciiCase( "gnome" ) ) + if ( aCurrentDesktop.equalsIgnoreAsciiCase( "unity" ) ) + ret = DESKTOP_UNITY; + else if ( aDesktopSession.equalsIgnoreAsciiCase( "gnome" ) ) ret = DESKTOP_GNOME; else if ( aDesktopSession.equalsIgnoreAsciiCase( "mate" ) ) ret = DESKTOP_MATE; diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx index ddd04222ed66..56d9fe525560 100644 --- a/vcl/unx/generic/plugadapt/salplug.cxx +++ b/vcl/unx/generic/plugadapt/salplug.cxx @@ -184,6 +184,7 @@ static SalInstance* autodetect_plugin() if ( desktop == DESKTOP_NONE ) pList = pHeadlessFallbackList; else if ( desktop == DESKTOP_GNOME || + desktop == DESKTOP_UNITY || desktop == DESKTOP_XFCE || desktop == DESKTOP_MATE ) pList = pStandardFallbackList; @@ -286,7 +287,7 @@ const OUString& SalGetDesktopEnvironment() { // Order to match desktops.hxx' DesktopType static const char * const desktop_strings[] = { - "none", "unknown", "GNOME", + "none", "unknown", "GNOME", "UNITY", "XFCE", "MATE", "TDE", "KDE", "KDE4" }; static OUString aRet; diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 58d402c1b726..5651dcfcebb6 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -656,7 +656,6 @@ gboolean ensure_dbus_setup( gpointer data ) 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 ); - gdk_x11_window_set_utf8_property( gdkWindow, "_GTK_APP_MENU_OBJECT_PATH", "/org/libreoffice/menus/appmenu" ); // Publish the menu model and the action group. SAL_INFO("vcl.unity", "exporting menu model at " << pMenuModel << " for window " << windowId); @@ -665,9 +664,15 @@ gboolean ensure_dbus_setup( gpointer data ) pSalFrame->m_nActionGroupExportId = g_dbus_connection_export_action_group( pSessionBus, aDBusWindowPath, pActionGroup, NULL); pSalFrame->m_nHudAwarenessId = hud_awareness_register( pSessionBus, aDBusMenubarPath, hud_activated, pSalFrame, NULL, NULL ); + // 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 ) + if( pMgr && !bDesktopIsUnity ) { GMenu *menu = g_menu_new (); GMenuItem* item; |