Changeset 1e4a937 in mainline for uspace/lib/display/src/display.c


Ignore:
Timestamp:
2020-03-09T11:03:58Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e022819
Parents:
a2e104e
git-author:
Jiri Svoboda <jiri@…> (2020-03-08 10:02:08)
git-committer:
Jiri Svoboda <jiri@…> (2020-03-09 11:03:58)
Message:

Add libdisplay method for initiating window resize

File:
1 edited

Legend:

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

    ra2e104e r1e4a937  
    251251 *
    252252 * @param window Window
     253 * @param pos Position in the window where the button was pressed
    253254 * @return EOK on success or an error code
    254255 */
     
    262263        exch = async_exchange_begin(window->display->sess);
    263264        req = async_send_1(exch, DISPLAY_WINDOW_MOVE_REQ, window->id, &answer);
     265        rc = async_data_write_start(exch, (void *)pos, sizeof (gfx_coord2_t));
     266        async_exchange_end(exch);
     267        if (rc != EOK) {
     268                async_forget(req);
     269                return rc;
     270        }
     271
     272        async_wait_for(req, &rc);
     273        if (rc != EOK)
     274                return rc;
     275
     276        return EOK;
     277}
     278
     279/** Request a window resize.
     280 *
     281 * Request the display service to initiate a user window resize operation
     282 * (i.e. let the user resize the window). Used when the client detects
     283 * mouse press on the window frame or such.
     284 *
     285 * @param window Window
     286 * @param rsztype Resize type (which part of window frame is being dragged)
     287 * @param pos Position in the window where the button was pressed
     288 * @return EOK on success or an error code
     289 */
     290errno_t display_window_resize_req(display_window_t *window,
     291    display_wnd_rsztype_t rsztype, gfx_coord2_t *pos)
     292{
     293        async_exch_t *exch;
     294        aid_t req;
     295        ipc_call_t answer;
     296        errno_t rc;
     297
     298        exch = async_exchange_begin(window->display->sess);
     299        req = async_send_2(exch, DISPLAY_WINDOW_RESIZE_REQ, window->id,
     300            (sysarg_t) rsztype, &answer);
    264301        rc = async_data_write_start(exch, (void *)pos, sizeof (gfx_coord2_t));
    265302        async_exchange_end(exch);
Note: See TracChangeset for help on using the changeset viewer.