Changeset 6e91475 in mainline for uspace/app/taskbar/wndlist.c


Ignore:
Timestamp:
2022-11-19T17:46:27Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
68d68e9
Parents:
d19d15b
Message:

I can see an invisible button in the task bar

Who're you gonna call?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskbar/wndlist.c

    rd19d15b r6e91475  
    215215        list_append(&entry->lentries, &wndlist->entries);
    216216
    217         /* Set the button rectangle */
     217        entry->visible = false;
     218
     219        /* Set the button rectangle and add it to layout, if applicable */
    218220        wndlist_set_entry_rect(wndlist, entry);
    219221
     
    221223        ui_pbutton_set_cb(entry->button, &wndlist_button_cb, (void *)entry);
    222224
    223         rc = ui_fixed_add(wndlist->fixed, ui_pbutton_ctl(entry->button));
    224         if (rc != EOK)
    225                 goto error;
    226 
    227         if (paint) {
     225        if (paint && entry->visible) {
    228226                rc = ui_pbutton_paint(entry->button);
    229227                if (rc != EOK)
     
    339337        if (rect.p1.x > wndlist->rect.p1.x) {
    340338                /* Make entry invisible */
    341                 rect.p0.x = 0;
    342                 rect.p0.y = 0;
    343                 rect.p1.x = 0;
    344                 rect.p1.y = 0;
     339                if (entry->visible) {
     340                        ui_fixed_remove(wndlist->fixed,
     341                            ui_pbutton_ctl(entry->button));
     342                        entry->visible = false;
     343                }
     344        } else {
     345                /* Make entry visible */
     346                if (!entry->visible) {
     347                        ui_fixed_add(wndlist->fixed,
     348                            ui_pbutton_ctl(entry->button));
     349                        entry->visible = true;
     350                }
    345351        }
    346352
Note: See TracChangeset for help on using the changeset viewer.