It is now possible, per io-error's request, to disable session support when
compiling pekwm.
| configure.ac | |
| 67 | @@ -67,6 +67,23 @@ |
| 67 | CONFIGOPTS="$CONFIGOPTS --disable-shape" |
| 68 | fi |
| 69 | |
| 70 | dnl Check for session support |
| 71 | AC_MSG_CHECKING([whether to build session support]) |
| 72 | AC_ARG_ENABLE(session, |
| 73 | AC_HELP_STRING([--enable-session], |
| 74 | [enable session support [default=yes]]), , |
| 75 | [enable_session=yes]) |
| 76 | if test "x$enable_session" = "xyes"; then |
| 77 | AC_MSG_RESULT([yes]) |
| 78 | AC_CHECK_LIB(SM, SmcOpenConnection, |
| 79 | AC_DEFINE(HAVE_SESSION, [1], [Define to 1 if you want session support]) |
| 80 | LIBS="$LIBS -lSM" |
| 81 | FEATURES="$FEATURES session") |
| 82 | else |
| 83 | AC_MSG_RESULT([no]) |
| 84 | fi |
| 85 | AM_CONDITIONAL([HAVE_SESSION], [test "x$HAVE_SESSION" = "x1"]) |
| 86 | |
| 87 | dnl Check for Xinerama support |
| 88 | AC_MSG_CHECKING([whether to build support for the Xinerama extension]) |
| 89 | AC_ARG_ENABLE(xinerama, |
| ... | |
| src/Session.cc | |
| 15 | @@ -15,6 +15,8 @@ |
| 15 | #include "config.h" |
| 16 | #endif // HAVE_CONFIG_H |
| 17 | |
| 18 | #ifdef HAVE_SESSION |
| 19 | |
| 20 | #include "Session.hh" |
| 21 | #include "Util.hh" |
| 22 | |
| ... | |
| 353 | @@ -351,3 +353,5 @@ |
| 353 | free(prop.name); |
| 354 | free(prop.type); |
| 355 | } |
| 356 | |
| 357 | #endif // HAVE_SESSION |
| ... | |
| src/Session.hh | |
| 13 | @@ -13,6 +13,8 @@ |
| 13 | #include "config.h" |
| 14 | #endif // HAVE_CONFIG_H |
| 15 | |
| 16 | #ifdef HAVE_SESSION |
| 17 | |
| 18 | #include <string> |
| 19 | |
| 20 | extern "C" { |
| ... | |
| 66 | @@ -64,4 +66,6 @@ |
| 66 | static const int ERROR_BUF_SIZE; /**< Session manager buffer size */ |
| 67 | }; |
| 68 | |
| 69 | #endif // HAVE_SESSION |
| 70 | |
| 71 | #endif // _SESSION_HH_ |
| ... | |
| src/Makefile.am | |
| 50 | @@ -50,7 +50,6 @@ |
| 50 | ScreenResources.cc ScreenResources.hh \ |
| 51 | StatusWindow.cc StatusWindow.hh \ |
| 52 | SearchDialog.cc SearchDialog.hh \ |
| 53 | Session.cc Session.hh \ |
| 54 | Theme.cc Theme.hh \ |
| 55 | TextureHandler.cc TextureHandler.hh \ |
| 56 | Timer.hh Types.hh \ |
| ... | |
| 61 | @@ -62,6 +61,10 @@ |
| 61 | main.cc \ |
| 62 | pekwm.hh |
| 63 | |
| 64 | if HAVE_SESSION |
| 65 | pekwm_SOURCES += Session.cc Session.hh |
| 66 | endif |
| 67 | |
| 68 | distclean-local: |
| 69 | rm -f *\~ .\#* |
| 70 | |
| ... | |
| src/main.cc | |
| 21 | @@ -21,7 +21,9 @@ |
| 21 | #include "Frame.hh" |
| 22 | #include "WindowManager.hh" |
| 23 | #include "Util.hh" |
| 24 | #ifdef HAVE_SESSION |
| 25 | #include "Session.hh" |
| 26 | #endif // HAVE_SESSION |
| 27 | |
| 28 | #include <iostream> |
| 29 | #include <string> |
| ... | |
| 122 | @@ -120,13 +122,17 @@ |
| 122 | #endif // DEBUG |
| 123 | |
| 124 | // Setup session before starting pekwm |
| 125 | #ifdef HAVE_SESSION |
| 126 | Session *session = new Session(argc, argv); |
| 127 | #endif // HAVE_SESSION |
| 128 | WindowManager *wm = WindowManager::start(command_line, config_file, replace); |
| 129 | |
| 130 | if (wm) { |
| 131 | #ifdef HAVE_SESSION |
| 132 | // Hookup shutdown flag and run the main loop if window manager was |
| 133 | // created |
| 134 | session->setShutdownFlag(wm->getShutdownFlag()); |
| 135 | #endif // HAVE_SESSION |
| 136 | wm->doEventLoop(); |
| 137 | |
| 138 | // see if we wanted to restart |
| ... | |
| 141 | @@ -135,7 +141,9 @@ |
| 141 | |
| 142 | // cleanup before restarting |
| 143 | WindowManager::destroy(); |
| 144 | #ifdef HAVE_SESSION |
| 145 | delete session; |
| 146 | #endif // HAVE_SESSION |
| 147 | Util::iconv_deinit(); |
| 148 | |
| 149 | execlp("/bin/sh", "sh" , "-c", command.c_str(), (char*) 0); |
| ... | |
| 152 | @@ -144,7 +152,9 @@ |
| 152 | } |
| 153 | |
| 154 | // Cleanup |
| 155 | #ifdef HAVE_SESSION |
| 156 | delete session; |
| 157 | #endif // HAVE_SESSION |
| 158 | Util::iconv_deinit(); |
| 159 | |
| 160 | return 0; |
| ... | |