Changeset 983052c in mainline for uspace/lib/ui/src/ui.c
- Timestamp:
- 2023-10-10T12:30:54Z (15 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bd2fab5
- Parents:
- 9bec33a
- git-author:
- Jiri Svoboda <jiri@…> (2023-10-09 18:30:06)
- git-committer:
- Jiri Svoboda <jiri@…> (2023-10-10 12:30:54)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/ui.c
r9bec33a r983052c 338 338 switch (event->type) { 339 339 case CEV_KEY: 340 ui_lock(ui); 340 341 ui_window_send_kbd(awnd, &event->ev.key); 342 ui_unlock(ui); 341 343 break; 342 344 case CEV_POS: … … 348 350 claim = ui_wdecor_pos_event(awnd->wdecor, &pos); 349 351 /* Note: If event is claimed, awnd might not be valid anymore */ 350 if (claim == ui_unclaimed) 352 if (claim == ui_unclaimed) { 353 ui_lock(ui); 351 354 ui_window_send_pos(awnd, &pos); 355 ui_unlock(ui); 356 } 352 357 353 358 break; … … 454 459 errno_t ui_suspend(ui_t *ui) 455 460 { 456 if (ui->cgc == NULL) 461 errno_t rc; 462 463 assert(!ui->suspended); 464 465 if (ui->cgc == NULL) { 466 ui->suspended = true; 457 467 return EOK; 468 } 458 469 459 470 (void) console_set_caption(ui->console, ""); 460 return console_gc_suspend(ui->cgc); 471 rc = console_gc_suspend(ui->cgc); 472 if (rc != EOK) 473 return rc; 474 475 ui->suspended = true; 476 return EOK; 461 477 } 462 478 … … 477 493 cons_event_t ev; 478 494 479 if (ui->cgc == NULL) 495 assert(ui->suspended); 496 497 if (ui->cgc == NULL) { 498 ui->suspended = false; 480 499 return EOK; 500 } 481 501 482 502 rc = console_get_pos(ui->console, &col, &row); … … 510 530 return rc; 511 531 532 ui->suspended = false; 533 512 534 awnd = ui_window_get_active(ui); 513 535 if (awnd != NULL) 514 536 (void) console_set_caption(ui->console, awnd->wdecor->caption); 515 537 516 return gfx_cursor_set_visible(console_gc_get_ctx(ui->cgc), false); 538 rc = gfx_cursor_set_visible(console_gc_get_ctx(ui->cgc), false); 539 if (rc != EOK) 540 return rc; 541 542 return EOK; 543 } 544 545 /** Determine if UI is suspended. 546 * 547 * @param ui UI 548 * @return @c true iff UI is suspended 549 */ 550 bool ui_is_suspended(ui_t *ui) 551 { 552 return ui->suspended; 517 553 } 518 554
Note:
See TracChangeset
for help on using the changeset viewer.