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


Ignore:
Timestamp:
2024-03-04T14:12:26Z (3 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
e229148
Parents:
ee3b28a9
git-author:
Jiri Svoboda <jiri@…> (2024-03-03 18:12:02)
git-committer:
Jiri Svoboda <jiri@…> (2024-03-04 14:12:26)
Message:

Start menu support for passing input device ID (multiseat)

File:
1 edited

Legend:

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

    ree3b28a9 rd92b8e8f  
    131131        gfx_rect_t scr_rect;
    132132        gfx_rect_t rect;
     133        char *dspec = NULL;
     134        char *qmark;
    133135        errno_t rc;
    134136
    135137        taskbar = calloc(1, sizeof(taskbar_t));
    136138        if (taskbar == NULL) {
     139                printf("Out of memory.\n");
    137140                rc = ENOMEM;
    138141                goto error;
    139142        }
     143
     144        dspec = str_dup(display_spec);
     145        if (dspec == NULL) {
     146                printf("Out of memory.\n");
     147                rc = ENOMEM;
     148                goto error;
     149        }
     150
     151        /* Remove additional arguments */
     152        qmark = str_chr(dspec, '?');
     153        if (qmark != NULL)
     154                *qmark = '\0';
    140155
    141156        rc = ui_create(display_spec, &taskbar->ui);
     
    198213        }
    199214
    200         rc = tbsmenu_create(taskbar->window, taskbar->fixed, &taskbar->tbsmenu);
     215        rc = tbsmenu_create(taskbar->window, taskbar->fixed, dspec,
     216            &taskbar->tbsmenu);
    201217        if (rc != EOK) {
    202218                printf("Error creating start menu.\n");
     
    293309        }
    294310
     311        free(dspec);
    295312        *rtaskbar = taskbar;
    296313        return EOK;
    297314error:
     315        if (dspec != NULL)
     316                free(dspec);
    298317        if (taskbar->lst != NULL)
    299318                tbarcfg_listener_destroy(taskbar->lst);
     
    308327        if (taskbar->ui != NULL)
    309328                ui_destroy(taskbar->ui);
     329        free(taskbar);
    310330        return rc;
    311331
Note: See TracChangeset for help on using the changeset viewer.