Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Menu Hotkeys in NCurses #107

Merged
merged 2 commits into from
Oct 16, 2020
Merged

Fix Menu Hotkeys in NCurses #107

merged 2 commits into from
Oct 16, 2020

Conversation

shundhammer
Copy link
Contributor

@shundhammer shundhammer commented Oct 15, 2020

Bugzilla

Problem

The hotkeys in NCurses menus were gone: Both in the pulldown menus of a MenuBar and in the pop-up menus of a MenuButton.

Fix

I bisected the recent commits on NCurses and found the offending commits. I broke down the more recent one even more and found it was just that one function that broke it. Reverting that function to the previous really simplistic content fixed the problem.

We'll still have to check what exactly the underlying problem was; right now it's just breaking down commits and experimenting what helps and what does not.

How to Test

Use the UI examples:

y2base ./MenuBar1.rb ncurses
y2base ./MenuButton1.rb ncurses

Also use the NCurses package selector:

sudo yast sw_single

Open the menus and check if the hotkeys are highlighted and do something.

@mvidner
Copy link
Member

mvidner commented Oct 16, 2020

I have tested the bug and the fix using this script which I will add to yast/yast-ruby-bindings#251

#!/bin/sh

# Test https://bugzilla.suse.com/show_bug.cgi?id=1177760
# Menu items lose their hotkeys

set -u                          # unset variables are an error
MYDIR=$(dirname "$0")
# shellcheck source=/dev/null # that file is checked separately
. "$MYDIR"/tmux-uitest.sh
BUG=1177760
BASE=menu_hotkeys_$BUG

tmux_new_session "/usr/sbin/yast /usr/share/doc/packages/yast2-ycp-ui-bindings/examples/MenuBar1.rb" || exit
trap tmux_cleanup EXIT

tmux_await "File.*Edit.*View" || exit
sleep 0.1                       # draw the rest of the screen
tmux_capture_pane_to "${BASE}-1-initial"

tmux_send_keys M-V # &View
tmux_capture_pane_to "${BASE}-2-view-menu-activated"

tmux_send_keys M-N # &Normal
tmux_capture_pane_to "${BASE}-3-normal-menu-item-activated"

if ! tmux_grep "Last Event"; then
    echo "The script does not echo what it should"
    exit 1
fi

if ! tmux_grep "view_normal"; then
    echo "view_normal was not activated, bug boo#$BUG exists"
    exit 1
fi

tmux_send_keys M-Q # &Quit
exit 0

@mvidner mvidner merged commit bdb68d4 into libyui:master Oct 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants