Changeset 5d9403d5 in mainline for uspace/app/taskbar/tbsmenu.c


Ignore:
Timestamp:
2023-10-13T20:27:14Z (15 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7aa9fa1b
Parents:
788c76e3
Message:

Open start menu using Enter, fix input device ID

Pressing Enter opens start menu, but only if it is focused.
Need to fix input device ID so that the menu is opened in the
correct seat, both in case of clicking and in case a key is
pressed to open the menu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskbar/tbsmenu.c

    r788c76e3 r5d9403d5  
    9292            (void *)tbsmenu);
    9393
     94        ui_pbutton_set_default(tbsmenu->sbutton, true);
     95
    9496        rc = ui_fixed_add(fixed, ui_pbutton_ctl(tbsmenu->sbutton));
    9597        if (rc != EOK)
     
    166168        tbsmenu->rect = *rect;
    167169        ui_pbutton_set_rect(tbsmenu->sbutton, rect);
     170}
     171
     172/** Open taskbar start menu.
     173 *
     174 * @param tbsmenu Start menu
     175 */
     176void tbsmenu_open(tbsmenu_t *tbsmenu)
     177{
     178        (void) ui_menu_open(tbsmenu->smenu, &tbsmenu->rect,
     179            tbsmenu->ev_idev_id);
     180}
     181
     182/** Close taskbar start menu.
     183 *
     184 * @param tbsmenu Start menu
     185 */
     186void tbsmenu_close(tbsmenu_t *tbsmenu)
     187{
     188        ui_menu_close(tbsmenu->smenu);
     189}
     190
     191/** Determine if taskbar start menu is open.
     192 *
     193 * @param tbsmenu Start menu
     194 * @return @c true iff start menu is open
     195 */
     196bool tbsmenu_is_open(tbsmenu_t *tbsmenu)
     197{
     198        return ui_menu_is_open(tbsmenu->smenu);
    168199}
    169200
     
    352383        tbsmenu_t *tbsmenu = (tbsmenu_t *)arg;
    353384
    354         if (!ui_menu_is_open(tbsmenu->smenu)) {
    355                 // XXX ev_pos_id is not set!!!
    356                 (void) ui_menu_open(tbsmenu->smenu, &tbsmenu->rect,
    357                     tbsmenu->ev_pos_id);
     385        if (!tbsmenu_is_open(tbsmenu)) {
     386                tbsmenu_open(tbsmenu);
    358387        } else {
    359388                /* menu is open */
    360                 ui_menu_close(tbsmenu->smenu);
     389                tbsmenu_close(tbsmenu);
    361390        }
    362391}
Note: See TracChangeset for help on using the changeset viewer.