Fix: 256 Do not accept custom entry when not applicable.

Add test to reproducet .
This commit is contained in:
Dave Davenport 2015-10-31 18:04:55 +01:00
parent f9e7bc0775
commit 02b99e6f95
3 changed files with 32 additions and 8 deletions

View File

@ -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"

View File

@ -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] );

22
test/run_issue_256.sh Executable file
View File

@ -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}