Changeset 5d380b6 in mainline for uspace/lib/display/test/display.c


Ignore:
Timestamp:
2023-01-20T11:50:41Z (23 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b1f0a14
Parents:
6828a56
git-author:
Jiri Svoboda <jiri@…> (2023-01-20 19:50:21)
git-committer:
Jiri Svoboda <jiri@…> (2023-01-20 11:50:41)
Message:

Create menu windows in the correct seat

Add a mechanism to set the seat of a new display window, UI window,
UI popup - input device ID. This is set to the ID of the device which
activated the menu (mouse, keyboard). The display server determines
the correct seat from there.

This makes sure clicking outside closes the correct pop-up window.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/display/test/display.c

    r6828a56 r5d380b6  
    118118        gfx_rect_t create_rect;
    119119        gfx_coord2_t create_min_size;
     120        sysarg_t create_idev_id;
    120121        bool window_destroy_called;
    121122        sysarg_t destroy_wnd_id;
     
    237238        params.min_size.x = 11;
    238239        params.min_size.y = 12;
     240        params.idev_id = 42;
    239241
    240242        rc = display_window_create(disp, &params, &test_display_wnd_cb,
     
    247249        PCUT_ASSERT_EQUALS(params.min_size.x, resp.create_min_size.x);
    248250        PCUT_ASSERT_EQUALS(params.min_size.y, resp.create_min_size.y);
     251        PCUT_ASSERT_EQUALS(params.idev_id, resp.create_idev_id);
    249252        PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
    250253        PCUT_ASSERT_NULL(wnd);
     
    289292        params.rect.p0.x = 100;
    290293        params.rect.p0.y = 100;
     294        params.idev_id = 42;
    291295
    292296        rc = display_window_create(disp, &params, &test_display_wnd_cb,
     
    297301        PCUT_ASSERT_EQUALS(params.rect.p1.x, resp.create_rect.p1.x);
    298302        PCUT_ASSERT_EQUALS(params.rect.p1.y, resp.create_rect.p1.y);
     303        PCUT_ASSERT_EQUALS(params.idev_id, resp.create_idev_id);
    299304        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
    300305        PCUT_ASSERT_NOT_NULL(wnd);
     
    21382143        resp->create_rect = params->rect;
    21392144        resp->create_min_size = params->min_size;
     2145        resp->create_idev_id = params->idev_id;
    21402146        if (resp->rc == EOK)
    21412147                *rwnd_id = resp->wnd_id;
Note: See TracChangeset for help on using the changeset viewer.