Changeset b0ae23f in mainline for uspace/srv/hid
- Timestamp:
- 2023-01-17T15:21:13Z (3 years ago)
- 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)
- Location:
- uspace/srv/hid/display
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/dsops.c
r46a47c0 rb0ae23f 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 51 51 static errno_t disp_window_get_max_rect(void *, sysarg_t, gfx_rect_t *); 52 52 static errno_t disp_window_resize_req(void *, sysarg_t, 53 display_wnd_rsztype_t, gfx_coord2_t * );53 display_wnd_rsztype_t, gfx_coord2_t *, sysarg_t); 54 54 static errno_t disp_window_resize(void *, sysarg_t, gfx_coord2_t *, 55 55 gfx_rect_t *); … … 206 206 207 207 static errno_t disp_window_resize_req(void *arg, sysarg_t wnd_id, 208 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos )208 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos, sysarg_t pos_id) 209 209 { 210 210 ds_client_t *client = (ds_client_t *) arg; … … 223 223 224 224 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_resize_req()"); 225 ds_window_resize_req(wnd, rsztype, pos );225 ds_window_resize_req(wnd, rsztype, pos, pos_id); 226 226 ds_display_unlock(client->display); 227 227 return EOK; -
uspace/srv/hid/display/test/window.c
r46a47c0 rb0ae23f 758 758 display_wnd_params_t params; 759 759 gfx_coord2_t pos; 760 sysarg_t pos_id; 760 761 errno_t rc; 761 762 … … 783 784 pos.x = 42; 784 785 pos.y = 43; 785 ds_window_resize_req(wnd, display_wr_top_right, &pos); 786 pos_id = 44; 787 ds_window_resize_req(wnd, display_wr_top_right, &pos, pos_id); 786 788 787 789 PCUT_ASSERT_INT_EQUALS(dsw_resizing, wnd->state); -
uspace/srv/hid/display/types/display/window.h
r46a47c0 rb0ae23f 103 103 /** Original position before started to move or resize the window */ 104 104 gfx_coord2_t orig_pos; 105 /** Positioning device that started the resize */ 106 sysarg_t orig_pos_id; 105 107 /** Window resize type (if state is dsw_resizing) */ 106 108 display_wnd_rsztype_t rsztype; -
uspace/srv/hid/display/window.c
r46a47c0 rb0ae23f 510 510 * @param rsztype Resize type (which part of window is being dragged) 511 511 * @param pos Position where mouse button was pressed 512 * @param pos_id Positioning device ID 512 513 */ 513 514 static void ds_window_start_resize(ds_window_t *wnd, 514 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos )515 display_wnd_rsztype_t rsztype, gfx_coord2_t *pos, sysarg_t pos_id) 515 516 { 516 517 ds_seat_t *seat; … … 523 524 return; 524 525 526 /* Determine which seat started the resize */ 527 seat = ds_display_seat_by_idev(wnd->display, pos_id); 528 if (seat == NULL) 529 return; 530 525 531 wnd->orig_pos = *pos; 532 wnd->orig_pos_id = pos_id; 526 533 wnd->state = dsw_resizing; 527 534 wnd->rsztype = rsztype; 528 535 wnd->preview_rect = wnd->rect; 529 536 530 // TODO Multi-seat: need client to tell us which seat started the resize!531 seat = ds_display_first_seat(wnd->display);532 537 ctype = display_cursor_from_wrsz(rsztype); 533 538 ds_seat_set_wm_cursor(seat, wnd->display->cursor[ctype]); … … 559 564 ds_client_post_resize_event(wnd->client, wnd, &nrect); 560 565 561 // TODO Multi-seat: Need to know which seat started the resize! 562 seat = ds_display_first_seat(wnd->display); 563 ds_seat_set_wm_cursor(seat, NULL); 566 /* Determine which seat started the resize */ 567 seat = ds_display_seat_by_idev(wnd->display, wnd->orig_pos_id); 568 if (seat != NULL) 569 ds_seat_set_wm_cursor(seat, NULL); 564 570 565 571 (void) ds_display_paint(wnd->display, NULL); … … 787 793 * @param pos Position where the pointer was when the resize started 788 794 * relative to the window 795 * @param pos_id Positioning device ID 789 796 * @param event Button press event 790 797 */ 791 798 void ds_window_resize_req(ds_window_t *wnd, display_wnd_rsztype_t rsztype, 792 gfx_coord2_t *pos )799 gfx_coord2_t *pos, sysarg_t pos_id) 793 800 { 794 801 gfx_coord2_t orig_pos; 795 802 796 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_resize_req (%d, %d, %d )",797 (int) rsztype, (int) pos->x, (int) pos->y);803 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_resize_req (%d, %d, %d, %d)", 804 (int)rsztype, (int)pos->x, (int)pos->y, (int)pos_id); 798 805 799 806 gfx_coord2_add(&wnd->dpos, pos, &orig_pos); 800 ds_window_start_resize(wnd, rsztype, &orig_pos );807 ds_window_start_resize(wnd, rsztype, &orig_pos, pos_id); 801 808 } 802 809 -
uspace/srv/hid/display/window.h
r46a47c0 rb0ae23f 68 68 extern void ds_window_get_max_rect(ds_window_t *, gfx_rect_t *); 69 69 extern void ds_window_resize_req(ds_window_t *, display_wnd_rsztype_t, 70 gfx_coord2_t * );70 gfx_coord2_t *, sysarg_t); 71 71 extern errno_t ds_window_resize(ds_window_t *, gfx_coord2_t *, gfx_rect_t *); 72 72 extern errno_t ds_window_minimize(ds_window_t *);
Note:
See TracChangeset
for help on using the changeset viewer.