Changeset 77ffa01 in mainline for uspace/lib/ui/src/window.c
- Timestamp:
- 2021-02-27T21:34:15Z (3 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9c7dc8e
- Parents:
- b433f68
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/window.c
rb433f68 r77ffa01 34 34 */ 35 35 36 #include <congfx/console.h> 36 37 #include <display.h> 37 38 #include <errno.h> … … 130 131 gfx_bitmap_t *bmp = NULL; 131 132 mem_gc_t *memgc = NULL; 133 console_gc_t *cgc; 132 134 errno_t rc; 135 136 if (ui->root_wnd != NULL) 137 return EEXIST; 133 138 134 139 window = calloc(1, sizeof(ui_window_t)); … … 194 199 if (rc != EOK) 195 200 goto error; 201 } else if (ui->console != NULL) { 202 rc = console_gc_create(ui->console, NULL, &cgc); 203 if (rc != EOK) 204 goto error; 205 206 gc = console_gc_get_ctx(cgc); 196 207 } else { 197 208 /* Needed for unit tests */ … … 207 218 gfx_bitmap_params_init(&bparams); 208 219 #ifndef CONFIG_WIN_DOUBLE_BUF 209 bparams.flags |= bmpf_direct_output; 220 /* Console does not support direct output */ 221 if (ui->display != NULL) 222 bparams.flags |= bmpf_direct_output; 210 223 #endif 211 224 … … 262 275 window->cursor = ui_curs_arrow; 263 276 *rwindow = window; 277 278 ui->root_wnd = window; 264 279 return EOK; 265 280 error: … … 303 318 gfx_bitmap_destroy(window->bmp); 304 319 gfx_context_delete(window->gc); 305 display_window_destroy(window->dwindow); 320 if (window->dwindow != NULL) 321 display_window_destroy(window->dwindow); 306 322 free(window); 307 323 } … … 650 666 ui_window_t *window = (ui_window_t *) arg; 651 667 652 (void) display_window_move_req(window->dwindow, pos); 668 if (window->dwindow != NULL) 669 (void) display_window_move_req(window->dwindow, pos); 653 670 } 654 671 … … 665 682 ui_window_t *window = (ui_window_t *) arg; 666 683 667 (void) display_window_resize_req(window->dwindow, rsztype, pos); 684 if (window->dwindow != NULL) 685 (void) display_window_resize_req(window->dwindow, rsztype, pos); 668 686 } 669 687 … … 703 721 } 704 722 705 (void) display_window_set_cursor(window->dwindow, dcursor); 723 if (window->dwindow != NULL) 724 (void) display_window_set_cursor(window->dwindow, dcursor); 706 725 window->cursor = cursor; 707 726 }
Note:
See TracChangeset
for help on using the changeset viewer.