Changeset 913add60 in mainline for uspace/srv/hid/display/main.c


Ignore:
Timestamp:
2022-10-31T10:53:53Z (16 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b92d4b
Parents:
7cc30e9
git-author:
Jiri Svoboda <jiri@…> (2022-10-30 10:53:48)
git-committer:
Jiri Svoboda <jiri@…> (2022-10-31 10:53:53)
Message:

Deliver WM events for windows being added and removed

File:
1 edited

Legend:

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

    r7cc30e9 r913add60  
    5656#include "seat.h"
    5757#include "window.h"
     58#include "wmclient.h"
    5859#include "wmops.h"
    5960
    6061static void display_client_conn(ipc_call_t *, void *);
    6162static void display_client_ev_pending(void *);
     63static void display_wmclient_ev_pending(void *);
    6264static void display_gc_conn(ipc_call_t *, void *);
    6365static void display_wndmgt_conn(ipc_call_t *, void *);
     
    8082};
    8183
     84static ds_wmclient_cb_t display_wmclient_cb = {
     85        .ev_pending = display_wmclient_ev_pending
     86};
     87
    8288static void display_client_ev_pending(void *arg)
    8389{
     
    8591
    8692        display_srv_ev_pending(srv);
     93}
     94
     95static void display_wmclient_ev_pending(void *arg)
     96{
     97        wndmgt_srv_t *srv = (wndmgt_srv_t *) arg;
     98
     99        wndmgt_srv_ev_pending(srv);
    87100}
    88101
     
    189202        if (svc_id != 0) {
    190203                /* Create client object */
     204                ds_display_lock(disp);
    191205                rc = ds_client_create(disp, &display_client_cb, &srv, &client);
     206                ds_display_unlock(disp);
    192207                if (rc != EOK) {
    193208                        async_answer_0(icall, ENOMEM);
     
    243258{
    244259        ds_display_t *disp = (ds_display_t *) arg;
     260        errno_t rc;
    245261        wndmgt_srv_t srv;
     262        ds_wmclient_t *wmclient = NULL;
     263
     264        /* Create WM client object */
     265        ds_display_lock(disp);
     266        rc = ds_wmclient_create(disp, &display_wmclient_cb, &srv, &wmclient);
     267        ds_display_unlock(disp);
     268        if (rc != EOK) {
     269                async_answer_0(icall, ENOMEM);
     270                return;
     271        }
    246272
    247273        /* Set up protocol structure */
    248274        wndmgt_srv_initialize(&srv);
    249275        srv.ops = &wndmgt_srv_ops;
    250         srv.arg = disp;
     276        srv.arg = wmclient;
    251277
    252278        /* Handle connection */
    253279        wndmgt_conn(icall, &srv);
     280
     281        ds_display_lock(disp);
     282        ds_wmclient_destroy(wmclient);
     283        ds_display_unlock(disp);
    254284}
    255285
Note: See TracChangeset for help on using the changeset viewer.