Changeset 3be5366 in mainline for uspace/srv/hid/display/window.c


Ignore:
Timestamp:
2023-01-19T12:09:34Z (15 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6828a56
Parents:
aaa3b855
git-author:
Jiri Svoboda <jiri@…> (2023-01-19 18:09:23)
git-committer:
Jiri Svoboda <jiri@…> (2023-01-19 12:09:34)
Message:

Add pos_id information to move request, too

This will become useful momentarily.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/window.c

    raaa3b855 r3be5366  
    437437 * @param wnd Window
    438438 * @param pos Position where mouse button was pressed
    439  */
    440 static void ds_window_start_move(ds_window_t *wnd, gfx_coord2_t *pos)
     439 * @param pos_id Positioning device ID
     440 */
     441static void ds_window_start_move(ds_window_t *wnd, gfx_coord2_t *pos,
     442    sysarg_t pos_id)
    441443{
    442444        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_start_move (%d, %d)",
     
    447449
    448450        wnd->orig_pos = *pos;
     451        wnd->orig_pos_id = pos_id;
    449452        wnd->state = dsw_moving;
    450453        wnd->preview_pos = wnd->dpos;
     
    476479        wnd->dpos = nwpos;
    477480        wnd->state = dsw_idle;
     481        wnd->orig_pos_id = 0;
    478482
    479483        (void) ds_display_paint(wnd->display, NULL);
     
    569573                ds_seat_set_wm_cursor(seat, NULL);
    570574
     575        wnd->orig_pos_id = 0;
     576
    571577        (void) ds_display_paint(wnd->display, NULL);
    572578}
     
    629635        pos_event_t tevent;
    630636        gfx_coord2_t pos;
     637        sysarg_t pos_id;
    631638        gfx_rect_t drect;
    632639        bool inside;
     
    638645        pos.x = event->hpos;
    639646        pos.y = event->vpos;
     647        pos_id = event->pos_id;
    640648        gfx_rect_translate(&wnd->dpos, &wnd->rect, &drect);
    641649        inside = gfx_pix_inside_rect(&pos, &drect);
     
    643651        if (event->type == POS_PRESS && event->btn_num == 2 && inside &&
    644652            (wnd->flags & wndf_maximized) == 0) {
    645                 ds_window_start_move(wnd, &pos);
     653                ds_window_start_move(wnd, &pos, pos_id);
    646654                return EOK;
    647655        }
     
    746754 * @param pos Position where the pointer was when the move started
    747755 *            relative to the window
     756 * @param pos_id Positioning device ID
    748757 * @param event Button press event
    749758 */
    750 void ds_window_move_req(ds_window_t *wnd, gfx_coord2_t *pos)
     759void ds_window_move_req(ds_window_t *wnd, gfx_coord2_t *pos, sysarg_t pos_id)
    751760{
    752761        gfx_coord2_t orig_pos;
     
    756765
    757766        gfx_coord2_add(&wnd->dpos, pos, &orig_pos);
    758         ds_window_start_move(wnd, &orig_pos);
     767        ds_window_start_move(wnd, &orig_pos, pos_id);
    759768}
    760769
Note: See TracChangeset for help on using the changeset viewer.