Changeset 3be5366 in mainline for uspace/srv
- Timestamp:
- 2023-01-19T12:09:34Z (3 years ago)
- 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)
- Location:
- uspace/srv/hid/display
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/dsops.c
raaa3b855 r3be5366 46 46 static errno_t disp_window_create(void *, display_wnd_params_t *, sysarg_t *); 47 47 static errno_t disp_window_destroy(void *, sysarg_t); 48 static errno_t disp_window_move_req(void *, sysarg_t, gfx_coord2_t *); 48 static errno_t disp_window_move_req(void *, sysarg_t, gfx_coord2_t *, 49 sysarg_t); 49 50 static errno_t disp_window_move(void *, sysarg_t, gfx_coord2_t *); 50 51 static errno_t disp_window_get_pos(void *, sysarg_t, gfx_coord2_t *); … … 127 128 128 129 static errno_t disp_window_move_req(void *arg, sysarg_t wnd_id, 129 gfx_coord2_t *pos )130 gfx_coord2_t *pos, sysarg_t pos_id) 130 131 { 131 132 ds_client_t *client = (ds_client_t *) arg; … … 141 142 142 143 log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_move_req()"); 143 ds_window_move_req(wnd, pos );144 ds_window_move_req(wnd, pos, pos_id); 144 145 ds_display_unlock(client->display); 145 146 return EOK; -
uspace/srv/hid/display/test/window.c
raaa3b855 r3be5366 711 711 display_wnd_params_t params; 712 712 gfx_coord2_t pos; 713 sysarg_t pos_id; 713 714 errno_t rc; 714 715 … … 736 737 pos.x = 42; 737 738 pos.y = 43; 738 ds_window_move_req(wnd, &pos); 739 pos_id = 44; 740 ds_window_move_req(wnd, &pos, pos_id); 739 741 740 742 PCUT_ASSERT_INT_EQUALS(dsw_moving, wnd->state); 741 743 PCUT_ASSERT_INT_EQUALS(pos.x, wnd->orig_pos.x); 742 744 PCUT_ASSERT_INT_EQUALS(pos.y, wnd->orig_pos.y); 745 PCUT_ASSERT_INT_EQUALS(pos_id, wnd->orig_pos_id); 743 746 744 747 ds_window_destroy(wnd); … … 791 794 PCUT_ASSERT_INT_EQUALS(pos.x, wnd->orig_pos.x); 792 795 PCUT_ASSERT_INT_EQUALS(pos.y, wnd->orig_pos.y); 796 PCUT_ASSERT_INT_EQUALS(pos_id, wnd->orig_pos_id); 793 797 794 798 ds_window_destroy(wnd); -
uspace/srv/hid/display/types/display/window.h
raaa3b855 r3be5366 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 */105 /** Positioning device that started the move or resize */ 106 106 sysarg_t orig_pos_id; 107 107 /** Window resize type (if state is dsw_resizing) */ -
uspace/srv/hid/display/window.c
raaa3b855 r3be5366 437 437 * @param wnd Window 438 438 * @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 */ 441 static void ds_window_start_move(ds_window_t *wnd, gfx_coord2_t *pos, 442 sysarg_t pos_id) 441 443 { 442 444 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_start_move (%d, %d)", … … 447 449 448 450 wnd->orig_pos = *pos; 451 wnd->orig_pos_id = pos_id; 449 452 wnd->state = dsw_moving; 450 453 wnd->preview_pos = wnd->dpos; … … 476 479 wnd->dpos = nwpos; 477 480 wnd->state = dsw_idle; 481 wnd->orig_pos_id = 0; 478 482 479 483 (void) ds_display_paint(wnd->display, NULL); … … 569 573 ds_seat_set_wm_cursor(seat, NULL); 570 574 575 wnd->orig_pos_id = 0; 576 571 577 (void) ds_display_paint(wnd->display, NULL); 572 578 } … … 629 635 pos_event_t tevent; 630 636 gfx_coord2_t pos; 637 sysarg_t pos_id; 631 638 gfx_rect_t drect; 632 639 bool inside; … … 638 645 pos.x = event->hpos; 639 646 pos.y = event->vpos; 647 pos_id = event->pos_id; 640 648 gfx_rect_translate(&wnd->dpos, &wnd->rect, &drect); 641 649 inside = gfx_pix_inside_rect(&pos, &drect); … … 643 651 if (event->type == POS_PRESS && event->btn_num == 2 && inside && 644 652 (wnd->flags & wndf_maximized) == 0) { 645 ds_window_start_move(wnd, &pos );653 ds_window_start_move(wnd, &pos, pos_id); 646 654 return EOK; 647 655 } … … 746 754 * @param pos Position where the pointer was when the move started 747 755 * relative to the window 756 * @param pos_id Positioning device ID 748 757 * @param event Button press event 749 758 */ 750 void ds_window_move_req(ds_window_t *wnd, gfx_coord2_t *pos )759 void ds_window_move_req(ds_window_t *wnd, gfx_coord2_t *pos, sysarg_t pos_id) 751 760 { 752 761 gfx_coord2_t orig_pos; … … 756 765 757 766 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); 759 768 } 760 769 -
uspace/srv/hid/display/window.h
raaa3b855 r3be5366 63 63 extern errno_t ds_window_post_focus_event(ds_window_t *); 64 64 extern errno_t ds_window_post_unfocus_event(ds_window_t *); 65 extern void ds_window_move_req(ds_window_t *, gfx_coord2_t * );65 extern void ds_window_move_req(ds_window_t *, gfx_coord2_t *, sysarg_t); 66 66 extern void ds_window_move(ds_window_t *, gfx_coord2_t *); 67 67 extern void ds_window_get_pos(ds_window_t *, gfx_coord2_t *);
Note:
See TracChangeset
for help on using the changeset viewer.