diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 8 | ||||
-rw-r--r-- | src/device-menu-mgr.c | 9 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index dba0a9e..5209869 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,11 @@ libexec_PROGRAMS = \ - indicator-session-service \ + indicator-session-service + +if BUILD_GTKLOGOUTHELPER +libexec_PROGRAMS += \ gtk-logout-helper +endif ################### # Indicator Stuff @@ -124,6 +128,7 @@ indicator_session_service_LDADD = \ # GTK Logout Stuff ################# +if BUILD_GTKLOGOUTHELPER gtk_logout_helper_SOURCES = \ gtk-logout-helper.c \ settings-helper.c \ @@ -142,6 +147,7 @@ gtk_logout_helper_LDADD = \ $(SESSIONSERVICE_LIBS) \ $(GTKLOGOUTHELPER_LIBS) \ $(GCONF_LIBS) +endif ############### diff --git a/src/device-menu-mgr.c b/src/device-menu-mgr.c index 5a63be3..926090f 100644 --- a/src/device-menu-mgr.c +++ b/src/device-menu-mgr.c @@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <config.h> #include <libdbusmenu-glib/client.h> #include <libdbusmenu-gtk3/menuitem.h> @@ -410,7 +411,11 @@ static void show_dialog (DbusmenuMenuitem * mi, guint timestamp, gchar * type) { +#ifdef HAVE_GTKLOGOUTHELPER gchar * helper = g_build_filename(LIBEXECDIR, "gtk-logout-helper", NULL); +#else + gchar * helper = g_build_filename("gnome-session-quit", NULL); +#endif /* HAVE_GTKLOGOUTHELPER */ gchar * dialog_line = g_strdup_printf("%s --%s", helper, type); g_free(helper); @@ -726,7 +731,11 @@ device_menu_mgr_build_static_items (DeviceMenuMgr* self, gboolean greeter_mode) dbusmenu_menuitem_child_append (self->root_item, shutdown_mi); g_signal_connect (G_OBJECT(shutdown_mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, +#ifdef HAVE_GTKLOGOUTHELPER G_CALLBACK(show_dialog), "shutdown"); +#else + G_CALLBACK(show_dialog), "power-off"); +#endif /* HAVE_GTKLOGOUTHELPER */ RestartShutdownLogoutMenuItems * restart_shutdown_logout_mi = g_new0 (RestartShutdownLogoutMenuItems, 1); restart_shutdown_logout_mi->logout_mi = logout_mi; |