Changeset 1543d4c in mainline


Ignore:
Timestamp:
2023-10-16T17:47:29Z (7 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4030072
Parents:
9e240c1
Message:

Properly close drop-down menu on second menu-bar entry click

Note that this does not work in console due to current limitations
in libui's window emulation.

Location:
uspace
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/src/menubar.c

    r9e240c1 r1543d4c  
    563563                        mbar->active = true;
    564564
    565                         /* Open the menu, close if already open. */
    566                         if (mdd == mbar->selected)
    567                                 ui_menu_bar_select(mbar, NULL, false, pos_id);
    568                         else
     565                        /* Open the menu, if not already open. */
     566                        if (mdd != mbar->selected)
    569567                                ui_menu_bar_select(mbar, mdd, true, pos_id);
    570568
  • uspace/srv/hid/display/seat.c

    r9e240c1 r1543d4c  
    515515        wnd = ds_display_window_by_pos(seat->display, &seat->pntpos);
    516516
    517         /* Click outside popup window */
    518         if (event->type == POS_PRESS && wnd != seat->popup) {
    519                 /* Close popup window */
    520                 ds_seat_set_popup(seat, NULL);
    521         }
    522 
    523517        /* Deliver event to popup window. */
    524         if (seat->popup != NULL) {
     518        if (seat->popup != NULL && event->type != POS_PRESS) {
    525519                rc = ds_window_post_pos_event(seat->popup, event);
    526520                if (rc != EOK)
     
    546540                 * to the same window above.
    547541                 */
    548                 if (wnd != seat->popup) {
     542                if (wnd != seat->popup || event->type == POS_PRESS) {
    549543                        rc = ds_window_post_pos_event(wnd, event);
    550544                        if (rc != EOK)
     
    556550        }
    557551
     552        /* Click outside popup window */
     553        if (event->type == POS_PRESS && wnd != seat->popup) {
     554                /* Close popup window */
     555                ds_seat_set_popup(seat, NULL);
     556        }
     557
    558558        return EOK;
    559559}
Note: See TracChangeset for help on using the changeset viewer.