summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2015-10-31 18:04:55 +0100
committerDave Davenport <qball@gmpclient.org>2015-10-31 18:04:55 +0100
commit02b99e6f95edf512a5048732e3389b371684c7a2 (patch)
tree188218088fff46b8763573375fe458b2c0b5a8bc
parentf9e7bc0775724a348e14c32437eeaffc255a6ffd (diff)
Fix: 256 Do not accept custom entry when not applicable.
Add test to reproducet .
-rw-r--r--Makefile.am16
-rw-r--r--source/dialogs/window.c2
-rwxr-xr-xtest/run_issue_256.sh22
3 files changed, 32 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am
index b01ed5aa..adbc86b0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -161,19 +161,21 @@ test: ${bin_PROGRAMS}
.PHONY: test-x
test-x: ${bin_PROGRAMS}
echo "Test 1"
- $(top_srcdir)/test/run_test.sh 123 $(top_builddir)/textbox_test $(top_builddir) $(top_srcdir)/doc/example.xresources
+ $(top_srcdir)/test/run_test.sh 123 $(top_builddir)/textbox_test $(top_builddir)
echo "Test 2"
- $(top_srcdir)/test/run_test.sh 200 $(top_srcdir)/test/run_errormsg_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
+ $(top_srcdir)/test/run_test.sh 200 $(top_srcdir)/test/run_errormsg_test.sh $(top_builddir)
echo "Test 3"
- $(top_srcdir)/test/run_test.sh 201 $(top_srcdir)/test/run_switchdialog_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
+ $(top_srcdir)/test/run_test.sh 201 $(top_srcdir)/test/run_switchdialog_test.sh $(top_builddir)
echo "Test 4"
- $(top_srcdir)/test/run_test.sh 202 $(top_srcdir)/test/run_dmenu_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
+ $(top_srcdir)/test/run_test.sh 202 $(top_srcdir)/test/run_dmenu_test.sh $(top_builddir)
echo "Test 5"
- $(top_srcdir)/test/run_test.sh 203 $(top_srcdir)/test/run_dmenu_custom_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
+ $(top_srcdir)/test/run_test.sh 203 $(top_srcdir)/test/run_dmenu_custom_test.sh $(top_builddir)
echo "Test 6"
- $(top_srcdir)/test/run_test.sh 204 $(top_srcdir)/test/run_run_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
+ $(top_srcdir)/test/run_test.sh 204 $(top_srcdir)/test/run_run_test.sh $(top_builddir)
echo "Test 7"
- $(top_srcdir)/test/run_test.sh 205 $(top_srcdir)/test/run_script_test.sh $(top_builddir) $(top_srcdir)/doc/example.xresources
+ $(top_srcdir)/test/run_test.sh 205 $(top_srcdir)/test/run_script_test.sh $(top_builddir)
+ echo "Issue 256"
+ $(top_srcdir)/test/run_test.sh 206 $(top_srcdir)/test/run_issue_256.sh $(top_builddir)
echo "End tests"
diff --git a/source/dialogs/window.c b/source/dialogs/window.c
index c02a901d..2b1ef6c5 100644
--- a/source/dialogs/window.c
+++ b/source/dialogs/window.c
@@ -514,7 +514,7 @@ static SwitcherMode window_mode_result ( int mretv, G_GNUC_UNUSED char **input,
else if ( ( mretv & MENU_QUICK_SWITCH ) == MENU_QUICK_SWITCH ) {
retv = ( mretv & MENU_LOWER_MASK );
}
- else if ( ( mretv & ( MENU_OK | MENU_CUSTOM_INPUT ) ) && (selected_line < rmpd->cmd_list_length) && rmpd->cmd_list[selected_line] ) {
+ else if ( ( mretv & ( MENU_OK ) ) && rmpd->cmd_list[selected_line] ) {
if ( rmpd->config_i3_mode ) {
// Hack for i3.
i3_support_focus_window ( rmpd->ids->array[selected_line] );
diff --git a/test/run_issue_256.sh b/test/run_issue_256.sh
new file mode 100755
index 00000000..ea804245
--- /dev/null
+++ b/test/run_issue_256.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+
+rofi -show window -modi window &
+RPID=$!
+
+# send enter.
+sleep 5;
+xdotool key 't'
+sleep 0.4
+xdotool key 'r'
+sleep 0.4
+xdotool key 'u'
+sleep 0.4
+xdotool key 'e'
+sleep 0.4
+xdotool key Return
+
+# Get result, kill xvfb
+wait ${RPID}
+RETV=$?
+
+exit ${RETV}