Changeset f1f433d in mainline for uspace/srv/hid/display/wmclient.c


Ignore:
Timestamp:
2022-11-04T20:54:04Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a6d44b7
Parents:
fc00f0d
Message:

Update window button when window caption changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/wmclient.c

    rfc00f0d rf1f433d  
    184184}
    185185
     186/** Post window changed event to the WM client's message queue.
     187 *
     188 * @param wmclient WM client
     189 * @param wnd_id Window ID of the added window
     190 *
     191 * @return EOK on success or an error code
     192 */
     193errno_t ds_wmclient_post_wnd_changed_event(ds_wmclient_t *wmclient,
     194    sysarg_t wnd_id)
     195{
     196        ds_wmclient_ev_t *wevent;
     197
     198        wevent = calloc(1, sizeof(ds_wmclient_ev_t));
     199        if (wevent == NULL)
     200                return ENOMEM;
     201
     202        wevent->wmclient = wmclient;
     203        wevent->event.etype = wmev_window_changed;
     204        wevent->event.wnd_id = wnd_id;
     205        list_append(&wevent->levents, &wmclient->events);
     206
     207        /* Notify the client */
     208        // TODO Do not send more than once until client drains the queue
     209        if (wmclient->cb != NULL && wmclient->cb->ev_pending != NULL)
     210                wmclient->cb->ev_pending(wmclient->cb_arg);
     211
     212        return EOK;
     213}
     214
    186215/** @}
    187216 */
Note: See TracChangeset for help on using the changeset viewer.