diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/unx/gtk/gtkframe.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 20 |
2 files changed, 16 insertions, 6 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx index 056585b7828b..69261368ddd9 100644 --- a/vcl/inc/unx/gtk/gtkframe.hxx +++ b/vcl/inc/unx/gtk/gtkframe.hxx @@ -217,7 +217,6 @@ class GtkSalFrame : public SalFrame friend void on_registrar_available (GDBusConnection*, const gchar*, const gchar*, gpointer); friend void on_registrar_unavailable (GDBusConnection*, const gchar*, gpointer); guint m_nWatcherId; - guint m_nHudAwarenessId; void Init( SalFrame* pParent, sal_uLong nStyle ); void Init( SystemParentData* pSysData ); @@ -304,6 +303,7 @@ public: guint m_nMenuExportId; guint m_nActionGroupExportId; + guint m_nHudAwarenessId; // dispatches an event, returns true if dispatched // and false else; if true was returned the event should diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 9cce0f81d865..9fa7a5f31c47 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -513,6 +513,11 @@ static void ObjectDestroyedNotify( gpointer data ) } } +static void hud_activated( gboolean hud_active, gpointer user_data ) +{ + printf("HUD active state: %d\n", hud_active); +} + gboolean ensure_dbus_setup( gpointer data ) { GtkSalFrame* pSalFrame = reinterpret_cast< GtkSalFrame* >( data ); @@ -549,6 +554,7 @@ gboolean ensure_dbus_setup( gpointer data ) SAL_INFO("vcl.unity", "exporting menu model at " << pMenuModel << " for window " << windowId); pSalFrame->m_nMenuExportId = g_dbus_connection_export_menu_model (pSessionBus, aDBusMenubarPath, pMenuModel, NULL); pSalFrame->m_nActionGroupExportId = g_dbus_connection_export_action_group( pSessionBus, aDBusPath, pActionGroup, NULL); + pSalFrame->m_nHudAwarenessId = hud_awareness_register( pSessionBus, aDBusMenubarPath, hud_activated, pSalFrame, NULL, NULL ); g_free( aDBusPath ); g_free( aDBusWindowPath ); @@ -674,10 +680,12 @@ GtkSalFrame::~GtkSalFrame() if ( pSessionBus ) { - if(m_nMenuExportId) - g_dbus_connection_unexport_menu_model(pSessionBus, m_nMenuExportId); - if(m_nActionGroupExportId) - g_dbus_connection_unexport_action_group(pSessionBus, m_nActionGroupExportId); + if ( m_nHudAwarenessId ) + hud_awareness_unregister( pSessionBus, m_nHudAwarenessId ); + if ( m_nMenuExportId ) + g_dbus_connection_unexport_menu_model( pSessionBus, m_nMenuExportId ); + if ( m_nActionGroupExportId ) + g_dbus_connection_unexport_action_group( pSessionBus, m_nActionGroupExportId ); } gtk_widget_destroy( m_pWindow ); } @@ -795,6 +803,9 @@ void GtkSalFrame::InitCommon() m_bSetFocusOnMap = false; m_pSalMenu = NULL; m_nWatcherId = 0; + m_nMenuExportId = 0; + m_nActionGroupExportId = 0; + m_nHudAwarenessId = 0; gtk_widget_set_app_paintable( m_pWindow, TRUE ); gtk_widget_set_double_buffered( m_pWindow, FALSE ); @@ -1108,7 +1119,6 @@ void GtkSalFrame::Init( SalFrame* pParent, sal_uLong nStyle ) { // Enable DBus native menu if available. ensure_dbus_setup( this ); - //EnsureAppMenuWatch(); guint32 nUserTime = 0; if( (nStyle & (SAL_FRAME_STYLE_OWNERDRAWDECORATION|SAL_FRAME_STYLE_TOOLWINDOW)) == 0 ) |