vcl/inc/unx/desktops.hxx | 1 + vcl/unx/generic/desktopdetect/desktopdetector.cxx | 12 ++++++++++-- vcl/unx/generic/plugadapt/salplug.cxx | 3 ++- vcl/unx/gtk/window/gtksalframe.cxx | 9 +++++++-- 4 files changed, 20 insertions(+), 5 deletions(-)
New commits: commit 2e25016289d5f565ba4080625950ef6ca6487d34 Author: Ivan Timofeev <[email protected]> Date: Sun Nov 3 21:59:55 2013 +0400 fdo#70885: disable app menu under Unity Change-Id: I90ca2f5dd8d2678dff74ae5599e640c9a69aee33 diff --git a/vcl/inc/unx/desktops.hxx b/vcl/inc/unx/desktops.hxx index f67e8ca..0515cf5 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 f18bf0a..1d5d223 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 ddd0422..56d9fe5 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 58d402c..5651dcf 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; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
