Changeset 1af103e in mainline for uspace/lib/ui/src/wdecor.c


Ignore:
Timestamp:
2023-09-13T17:29:07Z (9 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
61643c8
Parents:
46bd63c9
Message:

System menu (WIP)

The system menu provides browsable, keyboard-accessible access to window
management functions (such as closing, minimizing, maximizing, resizing,
moving).

File:
1 edited

Legend:

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

    r46bd63c9 r1af103e  
    421421}
    422422
     423/** Send decoration sysmenu event.
     424 *
     425 * @param wdecor Window decoration
     426 * @param idev_id Input device ID
     427 */
     428void ui_wdecor_sysmenu(ui_wdecor_t *wdecor, sysarg_t idev_id)
     429{
     430        if (wdecor->cb != NULL && wdecor->cb->sysmenu != NULL)
     431                wdecor->cb->sysmenu(wdecor, wdecor->arg, idev_id);
     432}
     433
    423434/** Send decoration minimize event.
    424435 *
     
    805816}
    806817
     818/** Handle window decoration keyboard event.
     819 *
     820 * @param wdecor Window decoration
     821 * @param kbd_event Keyboard event
     822 * @return @c ui_claimed iff event was claimed
     823 */
     824ui_evclaim_t ui_wdecor_kbd_event(ui_wdecor_t *wdecor, kbd_event_t *event)
     825{
     826        (void)wdecor;
     827
     828        if (event->type == KEY_PRESS && (event->mods & (KM_CTRL | KM_ALT |
     829            KM_SHIFT)) == 0) {
     830                if (event->key == KC_F9)
     831                        ui_wdecor_sysmenu(wdecor, event->kbd_id);
     832        }
     833
     834        return ui_unclaimed;
     835}
     836
    807837/** Handle window frame position event.
    808838 *
Note: See TracChangeset for help on using the changeset viewer.