summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac12
-rw-r--r--include/dialogs/window.h4
-rw-r--r--source/dialogs/combi.c8
-rw-r--r--source/dialogs/window.c6
-rw-r--r--source/rofi.c5
5 files changed, 33 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 34b32332..9c2624be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,18 @@ AC_ARG_ENABLE(gcov,
[ --enable-gcov Enable source code coverage testing using gcov],
[CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage"])
+
+dnl
+dnl
+dnl
+
+AC_ARG_ENABLE([windowmode],
+ AC_HELP_STRING([--enable-window],[Enable window mode]))
+
+AS_IF([ test "x$enable_windowmode" != "xno"], [
+AC_DEFINE([WINDOW_MODE],[1],[Enable the window mode])
+])
+
##
# Check dependencies
##
diff --git a/include/dialogs/window.h b/include/dialogs/window.h
index 4ebd091c..096d475e 100644
--- a/include/dialogs/window.h
+++ b/include/dialogs/window.h
@@ -1,6 +1,10 @@
#ifndef __WINDOW_DIALOG_H__
#define __WINDOW_DIALOG_H__
+#include <config.h>
+#ifdef WINDOW_MODE
+
extern Switcher window_mode;
extern Switcher window_mode_cd;
+#endif // WINDOW_MODE
#endif // __WINDOW_DIALOG_H__
diff --git a/source/dialogs/combi.c b/source/dialogs/combi.c
index 58addf77..6e3c103d 100644
--- a/source/dialogs/combi.c
+++ b/source/dialogs/combi.c
@@ -66,11 +66,17 @@ static void combi_mode_parse_switchers ( Switcher *sw )
sizeof ( Switcher* ) * ( pd->num_switchers + 1 ) );
// Window switcher.
+ #ifdef WINDOW_MODE
if ( strcasecmp ( token, "window" ) == 0 ) {
pd->switchers[pd->num_switchers++] = &window_mode;
}
+ else if ( strcasecmp ( token, "windowcd" ) == 0 ) {
+ pd->switchers[pd->num_switchers++] = &window_mode_cd;
+ }
+ else
+ #endif // WINDOW_MODE
// SSh dialog
- else if ( strcasecmp ( token, "ssh" ) == 0 ) {
+ if ( strcasecmp ( token, "ssh" ) == 0 ) {
pd->switchers[pd->num_switchers++] = &ssh_mode;
}
// Run dialog
diff --git a/source/dialogs/window.c b/source/dialogs/window.c
index 6bee5418..7a39b189 100644
--- a/source/dialogs/window.c
+++ b/source/dialogs/window.c
@@ -25,6 +25,9 @@
*
*/
#include <config.h>
+
+#ifdef WINDOW_MODE
+
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
@@ -592,3 +595,6 @@ Switcher window_mode_cd =
.private_data = NULL,
.free = NULL
};
+
+#endif // WINDOW_MODE
+
diff --git a/source/rofi.c b/source/rofi.c
index 339f964e..423f1671 100644
--- a/source/rofi.c
+++ b/source/rofi.c
@@ -1659,6 +1659,7 @@ static void setup_switchers ( void )
switchers[num_switchers].tb = NULL;
// Window switcher.
+ #ifdef WINDOW_MODE
if ( strcasecmp ( token, "window" ) == 0 ) {
switchers[num_switchers].sw = &window_mode;
num_switchers++;
@@ -1667,8 +1668,10 @@ static void setup_switchers ( void )
switchers[num_switchers].sw = &window_mode_cd;
num_switchers++;
}
+ else
+ #endif // WINDOW_MODE
// SSh dialog
- else if ( strcasecmp ( token, "ssh" ) == 0 ) {
+ if ( strcasecmp ( token, "ssh" ) == 0 ) {
switchers[num_switchers].sw = &ssh_mode;
num_switchers++;
}