Changeset 9adae25 in mainline
- Timestamp:
- 2023-10-16T09:26:58Z (15 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1ce7ff
- Parents:
- 489f405
- git-author:
- Jiri Svoboda <jiri@…> (2023-10-15 09:26:00)
- git-committer:
- Jiri Svoboda <jiri@…> (2023-10-16 09:26:58)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/gfxdemo/gfxdemo.c
r489f405 r9adae25 51 51 #include <ui/window.h> 52 52 #include <ui/wdecor.h> 53 #include "gfxdemo.h" 53 54 54 55 static void wnd_close_event(void *); … … 77 78 static gfx_coord_t vpad; 78 79 static console_ctrl_t *con = NULL; 80 static ui_t *ui; 79 81 80 82 /** Determine if we are running in text mode. … … 100 102 cons_event_t cevent; 101 103 104 if (ui != NULL) 105 ui_unlock(ui); 102 106 fibril_mutex_lock(&quit_lock); 103 107 if (!quit) { … … 120 124 } 121 125 fibril_mutex_unlock(&quit_lock); 126 if (ui != NULL) 127 ui_lock(ui); 122 128 } 123 129 … … 1099 1105 } 1100 1106 1107 static errno_t demo_ui_fibril(void *arg) 1108 { 1109 demo_ui_args_t *args = (demo_ui_args_t *)arg; 1110 errno_t rc; 1111 1112 ui_lock(args->ui); 1113 rc = demo_loop(args->gc, args->dims.x, args->dims.y); 1114 ui_unlock(args->ui); 1115 ui_quit(args->ui); 1116 return rc; 1117 } 1118 1101 1119 /** Run demo on UI. */ 1102 1120 static errno_t demo_ui(const char *display_spec) 1103 1121 { 1104 ui_t *ui = NULL;1105 1122 ui_wnd_params_t params; 1106 1123 ui_window_t *window = NULL; … … 1111 1128 gfx_rect_t ui_rect; 1112 1129 gfx_coord2_t dims; 1130 demo_ui_args_t args; 1131 fid_t fid; 1113 1132 errno_t rc; 1114 1133 … … 1169 1188 task_retval(0); 1170 1189 1171 rc = demo_loop(gc, dims.x, dims.y); 1172 if (rc != EOK) 1173 goto error; 1174 1190 args.gc = gc; 1191 args.dims = dims; 1192 args.ui = ui; 1193 1194 fid = fibril_create(demo_ui_fibril, (void *)&args); 1195 if (fid == 0) { 1196 rc = ENOMEM; 1197 goto error; 1198 } 1199 1200 fibril_add_ready(fid); 1201 1202 ui_run(ui); 1175 1203 ui_window_destroy(window); 1176 1204 ui_destroy(ui);
Note:
See TracChangeset
for help on using the changeset viewer.