Changeset a2e104e in mainline for uspace/lib/display/src/display.c


Ignore:
Timestamp:
2020-03-05T11:23:41Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1e4a937
Parents:
338d0935
git-author:
Jiri Svoboda <jiri@…> (2020-03-04 19:23:29)
git-committer:
Jiri Svoboda <jiri@…> (2020-03-05 11:23:41)
Message:

Move windows by dragging decoration

Or dragging anywhere with button 2. Need to add Ctrl/Alt/Shift state
to pos_event_t and change the latter to Alt-drag/Shift-drag.

File:
1 edited

Legend:

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

    r338d0935 ra2e104e  
    244244}
    245245
     246/** Request a window move.
     247 *
     248 * Request the display service to initiate a user window move operation
     249 * (i.e. let the user move the window). Used when the client detects
     250 * mouse press on the title bar or such.
     251 *
     252 * @param window Window
     253 * @return EOK on success or an error code
     254 */
     255errno_t display_window_move_req(display_window_t *window, gfx_coord2_t *pos)
     256{
     257        async_exch_t *exch;
     258        aid_t req;
     259        ipc_call_t answer;
     260        errno_t rc;
     261
     262        exch = async_exchange_begin(window->display->sess);
     263        req = async_send_1(exch, DISPLAY_WINDOW_MOVE_REQ, window->id, &answer);
     264        rc = async_data_write_start(exch, (void *)pos, sizeof (gfx_coord2_t));
     265        async_exchange_end(exch);
     266        if (rc != EOK) {
     267                async_forget(req);
     268                return rc;
     269        }
     270
     271        async_wait_for(req, &rc);
     272        if (rc != EOK)
     273                return rc;
     274
     275        return EOK;
     276}
     277
    246278/** Resize display window.
    247279 *
     
    283315 * @param nrect New bounding rectangle
    284316 * @param offs
    285  * @return EOK on success or an error code. In both cases @a window must
    286  *         not be accessed anymore
     317 * @return EOK on success or an error code
    287318 */
    288319errno_t display_window_resize(display_window_t *window, gfx_coord2_t *offs,
Note: See TracChangeset for help on using the changeset viewer.