Changeset b0ae23f in mainline for uspace/lib/ui/src/wdecor.c


Ignore:
Timestamp:
2023-01-17T15:21:13Z (15 months 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/ui/src/wdecor.c

    r46a47c0 rb0ae23f  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2023 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    477477 * @param rsztype Resize type
    478478 * @param pos Position where the button was pressed
     479 * @param pos_id Positioning device ID
    479480 */
    480481void ui_wdecor_resize(ui_wdecor_t *wdecor, ui_wdecor_rsztype_t rsztype,
    481     gfx_coord2_t *pos)
     482    gfx_coord2_t *pos, sysarg_t pos_id)
    482483{
    483484        if (wdecor->cb != NULL && wdecor->cb->resize != NULL)
    484                 wdecor->cb->resize(wdecor, wdecor->arg, rsztype, pos);
     485                wdecor->cb->resize(wdecor, wdecor->arg, rsztype, pos, pos_id);
    485486}
    486487
     
    826827        /* Press on window border? */
    827828        if (rsztype != ui_wr_none && event->type == POS_PRESS)
    828                 ui_wdecor_resize(wdecor, rsztype, &pos);
     829                ui_wdecor_resize(wdecor, rsztype, &pos, event->pos_id);
    829830}
    830831
Note: See TracChangeset for help on using the changeset viewer.