Changeset 983052c in mainline for uspace/app/taskbar/wndlist.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/app/taskbar/wndlist.c
r9bec33a r983052c 254 254 wndlist_set_entry_rect(wndlist, entry); 255 255 if (paint) 256 return ui_pbutton_paint(entry->button);256 return wndlist_paint_entry(entry); 257 257 } 258 258 … … 320 320 wndlist_set_entry_rect(wndlist, e); 321 321 if (paint) { 322 rc = ui_pbutton_paint(e->button);322 rc = wndlist_paint_entry(e); 323 323 if (rc != EOK) 324 324 return rc; … … 402 402 ui_pbutton_set_light(entry->button, active); 403 403 404 rc = ui_pbutton_paint(entry->button);404 rc = wndlist_paint_entry(entry); 405 405 if (rc != EOK) 406 406 return rc; 407 407 408 return wndlist_repaint(wndlist);408 return EOK; 409 409 } 410 410 … … 470 470 } 471 471 472 /** Unpaint window list entry.472 /** Paint window list entry. 473 473 * 474 474 * @param entry Window list entry 475 475 * @return EOK on success or an error code 476 476 */ 477 errno_t wndlist_paint_entry(wndlist_entry_t *entry) 478 { 479 ui_t *ui; 480 481 ui = ui_window_get_ui(entry->wndlist->window); 482 if (ui_is_suspended(ui)) 483 return EOK; 484 485 return ui_pbutton_paint(entry->button); 486 } 487 488 /** Unpaint window list entry. 489 * 490 * @param entry Window list entry 491 * @return EOK on success or an error code 492 */ 477 493 errno_t wndlist_unpaint_entry(wndlist_entry_t *entry) 478 494 { 479 495 errno_t rc; 496 ui_t *ui; 480 497 gfx_context_t *gc; 481 498 ui_resource_t *res; 482 499 gfx_color_t *color; 483 500 501 ui = ui_window_get_ui(entry->wndlist->window); 484 502 gc = ui_window_get_gc(entry->wndlist->window); 485 503 res = ui_window_get_res(entry->wndlist->window); 486 504 color = ui_resource_get_wnd_face_color(res); 487 505 506 if (ui_is_suspended(ui)) 507 return EOK; 508 488 509 rc = gfx_set_color(gc, color); 489 510 if (rc != EOK) … … 510 531 wndlist_t *wndlist = (wndlist_t *)arg; 511 532 wndmgt_window_info_t *winfo = NULL; 533 ui_t *ui; 512 534 errno_t rc; 535 536 ui = ui_window_get_ui(wndlist->window); 537 ui_lock(ui); 513 538 514 539 rc = wndmgt_get_window_info(wndlist->wndmgt, wnd_id, &winfo); … … 526 551 527 552 wndmgt_free_window_info(winfo); 553 ui_unlock(ui); 528 554 return; 529 555 error: 530 556 if (winfo != NULL) 531 557 wndmgt_free_window_info(winfo); 558 ui_unlock(ui); 532 559 } 533 560 … … 541 568 wndlist_t *wndlist = (wndlist_t *)arg; 542 569 wndlist_entry_t *entry; 570 ui_t *ui; 571 572 ui = ui_window_get_ui(wndlist->window); 573 ui_lock(ui); 543 574 544 575 entry = wndlist_entry_by_id(wndlist, wnd_id); 545 if (entry == NULL) 576 if (entry == NULL) { 577 ui_unlock(ui); 546 578 return; 579 } 547 580 548 581 (void) wndlist_remove(wndlist, entry, true); 582 ui_unlock(ui); 549 583 } 550 584 … … 559 593 wndmgt_window_info_t *winfo = NULL; 560 594 wndlist_entry_t *entry; 595 ui_t *ui; 561 596 errno_t rc; 562 597 598 ui = ui_window_get_ui(wndlist->window); 599 ui_lock(ui); 600 563 601 entry = wndlist_entry_by_id(wndlist, wnd_id); 564 if (entry == NULL) 602 if (entry == NULL) { 603 ui_unlock(ui); 565 604 return; 605 } 566 606 567 607 rc = wndmgt_get_window_info(wndlist->wndmgt, wnd_id, &winfo); 568 if (rc != EOK) 608 if (rc != EOK) { 609 ui_unlock(ui); 569 610 return; 611 } 570 612 571 613 (void) wndlist_update(wndlist, entry, winfo->caption, 572 614 winfo->nfocus != 0); 573 615 wndmgt_free_window_info(winfo); 616 ui_unlock(ui); 574 617 } 575 618 … … 660 703 errno_t wndlist_repaint(wndlist_t *wndlist) 661 704 { 705 if (ui_is_suspended(ui_window_get_ui(wndlist->window))) 706 return EOK; 707 662 708 return ui_window_paint(wndlist->window); 663 709 }
Note:
See TracChangeset
for help on using the changeset viewer.