Changeset e022819 in mainline for uspace/srv/hid/display/client.c


Ignore:
Timestamp:
2020-03-14T00:30:53Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
03c8081
Parents:
1e4a937
Message:

Resizing windows

File:
1 edited

Legend:

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

    r1e4a937 re022819  
    316316}
    317317
     318/** Post resize event to the client's message queue.
     319 *
     320 * @param client Client
     321 * @param ewindow Window that the message is targetted to
     322 * @param rect New window rectangle
     323 *
     324 * @return EOK on success or an error code
     325 */
     326errno_t ds_client_post_resize_event(ds_client_t *client, ds_window_t *ewindow,
     327    gfx_rect_t *rect)
     328{
     329        ds_window_ev_t *wevent;
     330
     331        wevent = calloc(1, sizeof(ds_window_ev_t));
     332        if (wevent == NULL)
     333                return ENOMEM;
     334
     335        wevent->window = ewindow;
     336        wevent->event.etype = wev_resize;
     337        wevent->event.ev.resize.rect = *rect;
     338        list_append(&wevent->levents, &client->events);
     339
     340        /* Notify the client */
     341        // TODO Do not send more than once until client drains the queue
     342        if (client->cb != NULL && client->cb->ev_pending != NULL)
     343                client->cb->ev_pending(client->cb_arg);
     344
     345        return EOK;
     346}
     347
    318348/** Post unfocus event to the client's message queue.
    319349 *
Note: See TracChangeset for help on using the changeset viewer.