Changeset 8d1bcd7 in mainline for uspace/lib/ui/src/wdecor.c
- Timestamp:
- 2023-09-26T20:26:55Z (16 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5afc1aa
- Parents:
- ed1a948
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/wdecor.c
red1a948 r8d1bcd7 406 406 ui_wdecor_get_geom(wdecor, &geom); 407 407 (void) ui_wdecor_sysmenu_hdl_paint(wdecor, &geom.sysmenu_hdl_rect); 408 (void) gfx_update(wdecor->res->gc); 408 409 } 409 410 … … 540 541 } 541 542 542 /** Send decoration sysmenu event.543 /** Send decoration sysmenu open event. 543 544 * 544 545 * @param wdecor Window decoration 545 546 * @param idev_id Input device ID 546 547 */ 547 void ui_wdecor_sysmenu(ui_wdecor_t *wdecor, sysarg_t idev_id) 548 { 549 if (wdecor->cb != NULL && wdecor->cb->sysmenu != NULL) 550 wdecor->cb->sysmenu(wdecor, wdecor->arg, idev_id); 548 void ui_wdecor_sysmenu_open(ui_wdecor_t *wdecor, sysarg_t idev_id) 549 { 550 if (wdecor->cb != NULL && wdecor->cb->sysmenu_open != NULL) 551 wdecor->cb->sysmenu_open(wdecor, wdecor->arg, idev_id); 552 } 553 554 /** Send decoration sysmenu left event. 555 * 556 * @param wdecor Window decoration 557 * @param idev_id Input device ID 558 */ 559 void ui_wdecor_sysmenu_left(ui_wdecor_t *wdecor, sysarg_t idev_id) 560 { 561 if (wdecor->cb != NULL && wdecor->cb->sysmenu_left != NULL) 562 wdecor->cb->sysmenu_left(wdecor, wdecor->arg, idev_id); 563 } 564 565 /** Send decoration sysmenu right event. 566 * 567 * @param wdecor Window decoration 568 * @param idev_id Input device ID 569 */ 570 void ui_wdecor_sysmenu_right(ui_wdecor_t *wdecor, sysarg_t idev_id) 571 { 572 if (wdecor->cb != NULL && wdecor->cb->sysmenu_right != NULL) 573 wdecor->cb->sysmenu_right(wdecor, wdecor->arg, idev_id); 574 } 575 576 /** Send decoration sysmenu accelerator event. 577 * 578 * @param wdecor Window decoration 579 * @param c Accelerator character 580 * @param idev_id Input device ID 581 */ 582 void ui_wdecor_sysmenu_accel(ui_wdecor_t *wdecor, char32_t c, sysarg_t idev_id) 583 { 584 if (wdecor->cb != NULL && wdecor->cb->sysmenu_right != NULL) 585 wdecor->cb->sysmenu_accel(wdecor, wdecor->arg, c, idev_id); 551 586 } 552 587 … … 986 1021 ui_evclaim_t ui_wdecor_kbd_event(ui_wdecor_t *wdecor, kbd_event_t *event) 987 1022 { 988 (void)wdecor;989 990 1023 if (event->type == KEY_PRESS && (event->mods & (KM_CTRL | KM_ALT | 991 1024 KM_SHIFT)) == 0) { 992 if (event->key == KC_F 9) {1025 if (event->key == KC_F10) { 993 1026 ui_wdecor_sysmenu_hdl_set_active(wdecor, true); 994 ui_wdecor_sysmenu(wdecor, event->kbd_id); 1027 ui_wdecor_sysmenu_open(wdecor, event->kbd_id); 1028 return ui_claimed; 1029 } 1030 } 1031 1032 /* System menu handle events (if active) */ 1033 if (event->type == KEY_PRESS && (event->mods & (KM_CTRL | KM_ALT | 1034 KM_SHIFT)) == 0 && wdecor->sysmenu_hdl_active) { 1035 switch (event->key) { 1036 case KC_ESCAPE: 1037 ui_wdecor_sysmenu_hdl_set_active(wdecor, false); 1038 return ui_claimed; 1039 case KC_LEFT: 1040 ui_wdecor_sysmenu_left(wdecor, event->kbd_id); 1041 return ui_claimed; 1042 case KC_RIGHT: 1043 ui_wdecor_sysmenu_right(wdecor, event->kbd_id); 1044 return ui_claimed; 1045 case KC_DOWN: 1046 ui_wdecor_sysmenu_open(wdecor, event->kbd_id); 1047 return ui_claimed; 1048 default: 1049 break; 1050 } 1051 1052 if (event->c != '\0') { 1053 /* Could be an accelerator key */ 1054 ui_wdecor_sysmenu_accel(wdecor, event->c, 1055 event->kbd_id); 995 1056 } 996 1057 } … … 1050 1111 gfx_pix_inside_rect(&pos, &geom.sysmenu_hdl_rect)) { 1051 1112 ui_wdecor_sysmenu_hdl_set_active(wdecor, true); 1052 ui_wdecor_sysmenu (wdecor, event->pos_id);1113 ui_wdecor_sysmenu_open(wdecor, event->pos_id); 1053 1114 return ui_claimed; 1054 1115 }
Note:
See TracChangeset
for help on using the changeset viewer.