Changeset 8279aab in mainline
- Timestamp:
- 2025-01-07T12:26:56Z (2 weeks ago)
- Branches:
- master
- Children:
- 4e1221c
- Parents:
- 12dd36c
- git-author:
- Jiri Svoboda <jiri@…> (2025-01-06 19:26:42)
- git-committer:
- Jiri Svoboda <jiri@…> (2025-01-07 12:26:56)
- Location:
- uspace/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/display/include/display.h
r12dd36c r8279aab 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 48 48 extern errno_t display_open(const char *, display_t **); 49 49 extern void display_close(display_t *); 50 extern void display_lock(display_t *); 51 extern void display_unlock(display_t *); 50 52 extern errno_t display_get_info(display_t *, display_info_t *); 51 53 -
uspace/lib/display/src/display.c
r12dd36c r8279aab 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 138 138 } 139 139 140 /* 141 * Lock display. 142 * 143 * While display is locked, display event handlers will not be called. 144 * 145 * @param display Display 146 */ 147 void display_lock(display_t *display) 148 { 149 fibril_mutex_lock(&display->lock); 150 } 151 152 /* 153 * Unlock display. 154 * 155 * @param display Display 156 */ 157 void display_unlock(display_t *display) 158 { 159 fibril_mutex_unlock(&display->lock); 160 } 161 140 162 /** Initialize window parameters structure. 141 163 * … … 700 722 display_wnd_ev_t event; 701 723 724 display_lock(display); 725 702 726 while (true) { 703 fibril_mutex_lock(&display->lock);704 705 727 if (display->sess != NULL) 706 728 rc = display_get_event(display, &window, &event); 707 729 else 708 730 rc = ENOENT; 709 710 fibril_mutex_unlock(&display->lock);711 731 712 732 if (rc != EOK) … … 752 772 } 753 773 774 display_unlock(display); 754 775 async_answer_0(icall, EOK); 755 776 } -
uspace/lib/ui/src/ui.c
r12dd36c r8279aab 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 568 568 void ui_lock(ui_t *ui) 569 569 { 570 if (ui->display != NULL) 571 display_lock(ui->display); 570 572 fibril_mutex_lock(&ui->lock); 571 573 } … … 582 584 { 583 585 fibril_mutex_unlock(&ui->lock); 586 if (ui->display != NULL) 587 display_unlock(ui->display); 584 588 } 585 589 -
uspace/lib/ui/src/window.c
r12dd36c r8279aab 1 1 /* 2 * Copyright (c) 202 4Jiri Svoboda2 * Copyright (c) 2025 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 978 978 ui_t *ui = window->ui; 979 979 980 ui_lock(ui);980 fibril_mutex_lock(&ui->lock); 981 981 ui_window_send_close(window); 982 ui_unlock(ui);982 fibril_mutex_unlock(&ui->lock); 983 983 } 984 984 … … 989 989 ui_t *ui = window->ui; 990 990 991 ui_lock(ui);991 fibril_mutex_lock(&ui->lock); 992 992 (void)nfocus; 993 993 … … 998 998 999 999 ui_window_send_focus(window, nfocus); 1000 ui_unlock(ui);1000 fibril_mutex_unlock(&ui->lock); 1001 1001 } 1002 1002 … … 1007 1007 ui_t *ui = window->ui; 1008 1008 1009 ui_lock(ui);1009 fibril_mutex_lock(&ui->lock); 1010 1010 ui_window_send_kbd(window, kbd_event); 1011 ui_unlock(ui);1011 fibril_mutex_unlock(&ui->lock); 1012 1012 } 1013 1013 … … 1023 1023 return; 1024 1024 1025 ui_lock(ui);1025 fibril_mutex_lock(&ui->lock); 1026 1026 1027 1027 claim = ui_wdecor_pos_event(window->wdecor, event); 1028 1028 if (claim == ui_claimed) { 1029 ui_unlock(ui);1029 fibril_mutex_unlock(&ui->lock); 1030 1030 return; 1031 1031 } 1032 1032 1033 1033 ui_window_send_pos(window, event); 1034 ui_unlock(ui);1034 fibril_mutex_unlock(&ui->lock); 1035 1035 } 1036 1036 … … 1048 1048 return; 1049 1049 1050 ui_lock(ui);1050 fibril_mutex_lock(&ui->lock); 1051 1051 (void) ui_window_resize(window, rect); 1052 1052 ui_window_send_resize(window); 1053 ui_unlock(ui);1053 fibril_mutex_unlock(&ui->lock); 1054 1054 } 1055 1055 … … 1060 1060 ui_t *ui = window->ui; 1061 1061 1062 ui_lock(ui);1062 fibril_mutex_lock(&ui->lock); 1063 1063 1064 1064 if (window->wdecor != NULL && nfocus == 0) { … … 1068 1068 1069 1069 ui_window_send_unfocus(window, nfocus); 1070 ui_unlock(ui);1070 fibril_mutex_unlock(&ui->lock); 1071 1071 } 1072 1072
Note:
See TracChangeset
for help on using the changeset viewer.