Changeset ee3b28a9 in mainline for uspace/app/taskbar/tbsmenu.c


Ignore:
Timestamp:
2024-02-26T13:30:48Z (12 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
d92b8e8f
Parents:
90ba06c
git-author:
Jiri Svoboda <jiri@…> (2024-02-25 16:12:29)
git-committer:
Jiri Svoboda <jiri@…> (2024-02-26 13:30:48)
Message:

Notify taskbar when start menu changes

File:
1 edited

Legend:

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

    r90ba06c ree3b28a9  
    135135        errno_t rc;
    136136
     137        if (tbsmenu->repopath != NULL)
     138                free(tbsmenu->repopath);
     139
     140        tbsmenu->repopath = str_dup(repopath);
     141        if (tbsmenu->repopath == NULL)
     142                return ENOMEM;
     143
     144        /* Remove existing entries */
     145        tentry = tbsmenu_first(tbsmenu);
     146        while (tentry != NULL) {
     147                tbsmenu_remove(tbsmenu, tentry, false);
     148                tentry = tbsmenu_first(tbsmenu);
     149        }
     150
    137151        rc = tbarcfg_open(repopath, &tbcfg);
    138152        if (rc != EOK)
     
    170184}
    171185
     186/** Reload start menu from repository (or schedule reload).
     187 *
     188 * @param tbsmenu Start menu
     189 */
     190void tbsmenu_reload(tbsmenu_t *tbsmenu)
     191{
     192        if (!tbsmenu_is_open(tbsmenu))
     193                (void) tbsmenu_load(tbsmenu, tbsmenu->repopath);
     194        else
     195                tbsmenu->needs_reload = true;
     196}
     197
    172198/** Set start menu rectangle.
    173199 *
     
    198224{
    199225        ui_menu_close(tbsmenu->smenu);
     226
     227        if (tbsmenu->needs_reload)
     228                (void) tbsmenu_load(tbsmenu, tbsmenu->repopath);
    200229}
    201230
Note: See TracChangeset for help on using the changeset viewer.