Changeset c77cfd8 in mainline for uspace/app/taskbar/taskbar.c


Ignore:
Timestamp:
2022-10-04T19:55:25Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e0e612b
Parents:
3fd38b2
Message:

Proper timer cleanup, unit tests

Destroying a timer that sets itself again (i.e., runs periodically) is
a little tricky. It requires a handshake (similar to destroying a worker
thread). Realizing that this handshake works correctly is a little bit
mind boggling.

File:
1 edited

Legend:

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

    r3fd38b2 rc77cfd8  
    9292        rc = ui_get_rect(taskbar->ui, &scr_rect);
    9393        if (rc != EOK) {
    94                 printf("Error getting screen dimensions.\n");
    95                 goto error;
     94                if (str_cmp(display_spec, UI_DISPLAY_NULL) != 0) {
     95                        printf("Error getting screen dimensions.\n");
     96                        goto error;
     97                }
     98
     99                /* For the sake of unit tests */
     100                scr_rect.p0.x = 0;
     101                scr_rect.p0.y = 0;
     102                scr_rect.p1.x = 100;
     103                scr_rect.p1.y = 100;
    96104        }
    97105
     
    194202void taskbar_destroy(taskbar_t *taskbar)
    195203{
     204        ui_fixed_remove(taskbar->fixed,  taskbar_clock_ctl(taskbar->clock));
    196205        taskbar_clock_destroy(taskbar->clock);
    197206        ui_window_destroy(taskbar->window);
Note: See TracChangeset for help on using the changeset viewer.