summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-11-14 09:40:46 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-11-14 13:53:01 +0100
commit6bea834b4a4cc50b5eb3d53cf685ecb5e5ada315 (patch)
tree0bfc0b2a6116dcf2e17a75f6aaeb6e478ef31069 /vcl/unx
parent62a803dc46c1ffb5cba7f094868ce339feeecfda (diff)
only enable unity integration with enabled dbus and gio
Change-Id: I418e3c57e7c201529020864b1f4677ec4c24e2c8
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/gtk/app/gtkinst.cxx16
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx25
2 files changed, 36 insertions, 5 deletions
diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx
index 642d785472de..38786f7ccce7 100644
--- a/vcl/unx/gtk/app/gtkinst.cxx
+++ b/vcl/unx/gtk/app/gtkinst.cxx
@@ -510,6 +510,7 @@ SalBitmap* GtkInstance::CreateSalBitmap()
#endif
}
+#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
SalMenu* GtkInstance::CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu )
{
GtkSalMenu* pSalMenu = new GtkSalMenu( bMenuBar );
@@ -517,27 +518,42 @@ SalMenu* GtkInstance::CreateMenu( sal_Bool bMenuBar, Menu* pVCLMenu )
return static_cast<SalMenu*>( pSalMenu );
}
+#else
+SalMenu* GtkInstance::CreateMenu( sal_Bool, Menu* ) { return NULL; }
+#endif
+#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
void GtkInstance::DestroyMenu( SalMenu* pMenu )
{
(void)pMenu;
delete pMenu;
// OSL_ENSURE( pMenu == 0, "DestroyMenu called with non-native menus" );
}
+#else
+void GtkInstance::DestroyMenu( SalMenu* ) {}
+#endif
+#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
SalMenuItem* GtkInstance::CreateMenuItem( const SalItemParams* pItemData )
{
GtkSalMenuItem* pMenuItem = new GtkSalMenuItem( pItemData );
return static_cast<SalMenuItem*>( pMenuItem );
}
+#else
+SalMenuItem* GtkInstance::CreateMenuItem( const SalItemParams* ) { return NULL; }
+#endif
+#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
void GtkInstance::DestroyMenuItem( SalMenuItem* pItem )
{
(void)pItem;
delete pItem;
// OSL_ENSURE( pItem == 0, "DestroyMenu called with non-native menus" );
}
+#else
+void GtkInstance::DestroyMenuItem( SalMenuItem* ) {}
+#endif
SalTimer* GtkInstance::CreateSalTimer()
{
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index 80e4d193230c..0f76ce22f7a2 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -22,10 +22,6 @@
#include <unx/gtk/gtkdata.hxx>
#include <unx/gtk/gtkinst.hxx>
#include <unx/gtk/gtkgdi.hxx>
-#include <unx/gtk/glomenu.h>
-#include <unx/gtk/gloactiongroup.h>
-#include <unx/gtk/gtksalmenu.hxx>
-#include <unx/gtk/hudawareness.h>
#include <vcl/keycodes.hxx>
#include <unx/wmadaptor.hxx>
#include <unx/sm.hxx>
@@ -39,6 +35,12 @@
#if !GTK_CHECK_VERSION(3,0,0)
#include <unx/x11/xlimits.hxx>
#endif
+#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
+#include <unx/gtk/glomenu.h>
+#include <unx/gtk/gloactiongroup.h>
+#include <unx/gtk/gtksalmenu.hxx>
+#include <unx/gtk/hudawareness.h>
+#endif
#include <gtk/gtk.h>
#include <tools/prex.h>
@@ -99,7 +101,10 @@ using namespace com::sun::star;
int GtkSalFrame::m_nFloats = 0;
+#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
static GDBusConnection* pSessionBus = NULL;
+#endif
+
static sal_uInt16 GetKeyModCode( guint state )
{
sal_uInt16 nCode = 0;
@@ -479,7 +484,7 @@ GtkSalFrame::GtkSalFrame( SystemParentData* pSysData )
Init( pSysData );
}
-#if !GTK_CHECK_VERSION(3,0,0)
+#if !GTK_CHECK_VERSION(3,0,0) && defined(ENABLE_DBUS) && defined(ENABLE_GIO)
static void
gdk_x11_window_set_utf8_property (GdkWindow *window,
const gchar *name,
@@ -506,6 +511,7 @@ gdk_x11_window_set_utf8_property (GdkWindow *window,
// AppMenu watch functions.
+#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
static void ObjectDestroyedNotify( gpointer data )
{
if ( data ) {
@@ -609,9 +615,11 @@ void on_registrar_unavailable( GDBusConnection * /*connection*/,
pGtkSalMenu->Display( sal_False );
}
}
+#endif
void GtkSalFrame::EnsureAppMenuWatch()
{
+#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
if ( !m_nWatcherId )
{
// Get a DBus session connection.
@@ -634,6 +642,7 @@ void GtkSalFrame::EnsureAppMenuWatch()
}
//ensure_dbus_setup( this );
+#endif
}
GtkSalFrame::~GtkSalFrame()
@@ -679,12 +688,15 @@ GtkSalFrame::~GtkSalFrame()
gtk_widget_destroy( GTK_WIDGET( m_pFixedContainer ) );
{
SolarMutexGuard aGuard;
+#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
if(m_nWatcherId)
g_bus_unwatch_name(m_nWatcherId);
+#endif
if( m_pWindow )
{
g_object_set_data( G_OBJECT( m_pWindow ), "SalFrame", NULL );
+#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
if ( pSessionBus )
{
if ( m_nHudAwarenessId )
@@ -694,6 +706,7 @@ GtkSalFrame::~GtkSalFrame()
if ( m_nActionGroupExportId )
g_dbus_connection_unexport_action_group( pSessionBus, m_nActionGroupExportId );
}
+#endif
gtk_widget_destroy( m_pWindow );
}
}
@@ -1124,8 +1137,10 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle )
#if !GTK_CHECK_VERSION(3,0,0)
if( eWinType == GTK_WINDOW_TOPLEVEL )
{
+#if defined(ENABLE_DBUS) && defined(ENABLE_GIO)
// Enable DBus native menu if available.
ensure_dbus_setup( this );
+#endif
guint32 nUserTime = 0;
if( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_TOOLWINDOW)) == 0 )