Changeset dc5c303 in mainline for uspace/app/taskbar/wndlist.c
- Timestamp:
- 2023-12-28T13:59:23Z (2 years ago)
- Children:
- 6b66de6b
- Parents:
- 42c2e65 (diff), f87ff8e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - git-author:
- boba-buba <120932204+boba-buba@…> (2023-12-28 13:59:23)
- git-committer:
- GitHub <noreply@…> (2023-12-28 13:59:23)
- File:
-
- 1 edited
-
uspace/app/taskbar/wndlist.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/wndlist.c
r42c2e65 rdc5c303 30 30 * @{ 31 31 */ 32 /** @file Task bar window list32 /** @file Taskbar window list 33 33 */ 34 34 … … 45 45 #include <ui/ui.h> 46 46 #include <ui/window.h> 47 #include "clock.h"48 47 #include "wndlist.h" 49 48 … … 81 80 }; 82 81 83 /** Create task bar window list.82 /** Create taskbar window list. 84 83 * 85 84 * @param window Containing window 86 85 * @param fixed Fixed layout to which buttons will be added 87 * @param wndmgt Window management service88 86 * @param rwndlist Place to store pointer to new window list 89 87 * @return @c EOK on success or an error code … … 178 176 } 179 177 180 /** Destroy task bar window list. */ 178 /** Destroy taskbar window list. 179 * 180 * @param wndlist Window list 181 */ 181 182 void wndlist_destroy(wndlist_t *wndlist) 182 183 { … … 253 254 wndlist_set_entry_rect(wndlist, entry); 254 255 if (paint) 255 return ui_pbutton_paint(entry->button);256 return wndlist_paint_entry(entry); 256 257 } 257 258 … … 319 320 wndlist_set_entry_rect(wndlist, e); 320 321 if (paint) { 321 rc = ui_pbutton_paint(e->button);322 rc = wndlist_paint_entry(e); 322 323 if (rc != EOK) 323 324 return rc; … … 401 402 ui_pbutton_set_light(entry->button, active); 402 403 403 rc = ui_pbutton_paint(entry->button);404 rc = wndlist_paint_entry(entry); 404 405 if (rc != EOK) 405 406 return rc; 406 407 407 return wndlist_repaint(wndlist);408 return EOK; 408 409 } 409 410 … … 469 470 } 470 471 471 /** Compute and set window list entry rectangle. 472 * 473 * Compute rectangle for window list entry and set it. 472 /** Paint window list entry. 474 473 * 475 474 * @param entry Window list entry 476 475 * @return EOK on success or an error code 477 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 */ 478 493 errno_t wndlist_unpaint_entry(wndlist_entry_t *entry) 479 494 { 480 495 errno_t rc; 496 ui_t *ui; 481 497 gfx_context_t *gc; 482 498 ui_resource_t *res; 483 499 gfx_color_t *color; 484 500 501 ui = ui_window_get_ui(entry->wndlist->window); 485 502 gc = ui_window_get_gc(entry->wndlist->window); 486 503 res = ui_window_get_res(entry->wndlist->window); 487 504 color = ui_resource_get_wnd_face_color(res); 488 505 506 if (ui_is_suspended(ui)) 507 return EOK; 508 489 509 rc = gfx_set_color(gc, color); 490 510 if (rc != EOK) … … 511 531 wndlist_t *wndlist = (wndlist_t *)arg; 512 532 wndmgt_window_info_t *winfo = NULL; 533 ui_t *ui; 513 534 errno_t rc; 535 536 ui = ui_window_get_ui(wndlist->window); 537 ui_lock(ui); 514 538 515 539 rc = wndmgt_get_window_info(wndlist->wndmgt, wnd_id, &winfo); … … 527 551 528 552 wndmgt_free_window_info(winfo); 553 ui_unlock(ui); 529 554 return; 530 555 error: 531 556 if (winfo != NULL) 532 557 wndmgt_free_window_info(winfo); 558 ui_unlock(ui); 533 559 } 534 560 … … 542 568 wndlist_t *wndlist = (wndlist_t *)arg; 543 569 wndlist_entry_t *entry; 570 ui_t *ui; 571 572 ui = ui_window_get_ui(wndlist->window); 573 ui_lock(ui); 544 574 545 575 entry = wndlist_entry_by_id(wndlist, wnd_id); 546 if (entry == NULL) 576 if (entry == NULL) { 577 ui_unlock(ui); 547 578 return; 579 } 548 580 549 581 (void) wndlist_remove(wndlist, entry, true); 582 ui_unlock(ui); 550 583 } 551 584 … … 560 593 wndmgt_window_info_t *winfo = NULL; 561 594 wndlist_entry_t *entry; 595 ui_t *ui; 562 596 errno_t rc; 563 597 598 ui = ui_window_get_ui(wndlist->window); 599 ui_lock(ui); 600 564 601 entry = wndlist_entry_by_id(wndlist, wnd_id); 565 if (entry == NULL) 602 if (entry == NULL) { 603 ui_unlock(ui); 566 604 return; 605 } 567 606 568 607 rc = wndmgt_get_window_info(wndlist->wndmgt, wnd_id, &winfo); 569 if (rc != EOK) 608 if (rc != EOK) { 609 ui_unlock(ui); 570 610 return; 611 } 571 612 572 613 (void) wndlist_update(wndlist, entry, winfo->caption, 573 614 winfo->nfocus != 0); 574 615 wndmgt_free_window_info(winfo); 616 ui_unlock(ui); 575 617 } 576 618 … … 661 703 errno_t wndlist_repaint(wndlist_t *wndlist) 662 704 { 705 if (ui_is_suspended(ui_window_get_ui(wndlist->window))) 706 return EOK; 707 663 708 return ui_window_paint(wndlist->window); 664 709 } … … 675 720 676 721 /* ID of device that clicked the button */ 677 dev_id = entry->wndlist->ev_ pos_id;722 dev_id = entry->wndlist->ev_idev_id; 678 723 679 724 (void) wndmgt_activate_window(entry->wndlist->wndmgt,
Note:
See TracChangeset
for help on using the changeset viewer.
