Changeset b0ae23f in mainline for uspace/lib/display/test/display.c


Ignore:
Timestamp:
2023-01-17T15:21:13Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a0d4afe
Parents:
46a47c0
git-author:
Jiri Svoboda <jiri@…> (2023-01-17 18:21:02)
git-committer:
Jiri Svoboda <jiri@…> (2023-01-17 15:21:13)
Message:

Change the correct pointer's shape when resizing window

The request to resize a window originates from the client. The display
server forces the cursor to a double-arrow shape regardless of whether
it is over the window or not, until the resize is done. This is to
make sure the cursor keeps that shape even if it moves outside of
the current boundaries of the window. With multiple pointers we need
to know which one to change. This is done by passing the pos_id from
button press event that starts the resize all the way to
ds_window_start_resize(). Then it needs to be stored in the window
structure for use when it is time to restore the cursor.

File:
1 edited

Legend:

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

    r46a47c0 rb0ae23f  
    6363static errno_t test_window_get_max_rect(void *, sysarg_t, gfx_rect_t *);
    6464static errno_t test_window_resize_req(void *, sysarg_t, display_wnd_rsztype_t,
    65     gfx_coord2_t *);
     65    gfx_coord2_t *, sysarg_t);
    6666static errno_t test_window_resize(void *, sysarg_t, gfx_coord2_t *,
    6767    gfx_rect_t *);
     
    141141        display_wnd_rsztype_t resize_req_rsztype;
    142142        gfx_coord2_t resize_req_pos;
     143        sysarg_t resize_req_pos_id;
    143144
    144145        bool window_resize_called;
     
    831832        display_wnd_rsztype_t rsztype;
    832833        gfx_coord2_t pos;
     834        sysarg_t pos_id;
    833835
    834836        async_set_fallback_port_handler(test_display_conn, &resp);
     
    863865        pos.x = 42;
    864866        pos.y = 43;
    865 
    866         rc = display_window_resize_req(wnd, rsztype, &pos);
     867        pos_id = 44;
     868
     869        rc = display_window_resize_req(wnd, rsztype, &pos, pos_id);
    867870        PCUT_ASSERT_TRUE(resp.window_resize_req_called);
    868871        PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
     
    871874        PCUT_ASSERT_INT_EQUALS(pos.x, resp.resize_req_pos.x);
    872875        PCUT_ASSERT_INT_EQUALS(pos.y, resp.resize_req_pos.y);
     876        PCUT_ASSERT_INT_EQUALS(pos_id, resp.resize_req_pos_id);
    873877
    874878        display_window_destroy(wnd);
     
    889893        display_wnd_rsztype_t rsztype;
    890894        gfx_coord2_t pos;
     895        sysarg_t pos_id;
    891896
    892897        async_set_fallback_port_handler(test_display_conn, &resp);
     
    921926        pos.x = 42;
    922927        pos.y = 43;
    923 
    924         rc = display_window_resize_req(wnd, rsztype, &pos);
     928        pos_id = 44;
     929
     930        rc = display_window_resize_req(wnd, rsztype, &pos, pos_id);
    925931        PCUT_ASSERT_TRUE(resp.window_resize_req_called);
    926932        PCUT_ASSERT_ERRNO_VAL(resp.rc, rc);
     
    929935        PCUT_ASSERT_INT_EQUALS(pos.x, resp.resize_req_pos.x);
    930936        PCUT_ASSERT_INT_EQUALS(pos.y, resp.resize_req_pos.y);
     937        PCUT_ASSERT_INT_EQUALS(pos_id, resp.resize_req_pos_id);
    931938
    932939        display_window_destroy(wnd);
     
    21882195
    21892196static errno_t test_window_resize_req(void *arg, sysarg_t wnd_id,
    2190     display_wnd_rsztype_t rsztype, gfx_coord2_t *pos)
     2197    display_wnd_rsztype_t rsztype, gfx_coord2_t *pos, sysarg_t pos_id)
    21912198{
    21922199        test_response_t *resp = (test_response_t *) arg;
     
    21962203        resp->resize_req_wnd_id = wnd_id;
    21972204        resp->resize_req_pos = *pos;
     2205        resp->resize_req_pos_id = pos_id;
    21982206        return resp->rc;
    21992207}
Note: See TracChangeset for help on using the changeset viewer.