Changeset 6828a56 in mainline for uspace/srv/hid/display/window.c
- Timestamp:
- 2023-01-19T13:51:14Z (23 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5d380b6
- Parents:
- 3be5366
- git-author:
- Jiri Svoboda <jiri@…> (2023-01-19 19:50:50)
- git-committer:
- Jiri Svoboda <jiri@…> (2023-01-19 13:51:14)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/window.c
r3be5366 r6828a56 656 656 657 657 if (event->type == POS_RELEASE) { 658 if (wnd->state == dsw_moving) { 658 /* Finish move/resize if they were started by the same seat */ 659 if (wnd->state == dsw_moving && 660 ds_window_orig_seat(wnd, pos_id)) { 659 661 ds_window_finish_move(wnd, &pos); 660 662 return EOK; 661 663 } 662 664 663 if (wnd->state == dsw_resizing) { 665 if (wnd->state == dsw_resizing && 666 ds_window_orig_seat(wnd, pos_id)) { 664 667 ds_window_finish_resize(wnd, &pos); 665 668 return EOK; … … 668 671 669 672 if (event->type == POS_UPDATE) { 670 if (wnd->state == dsw_moving) { 673 /* Update move/resize if they were started by the same seat */ 674 if (wnd->state == dsw_moving && 675 ds_window_orig_seat(wnd, pos_id)) { 671 676 ds_window_update_move(wnd, &pos); 672 677 return EOK; 673 678 } 674 679 675 if (wnd->state == dsw_resizing) { 680 if (wnd->state == dsw_resizing && 681 ds_window_orig_seat(wnd, pos_id)) { 676 682 ds_window_update_resize(wnd, &pos); 677 683 return EOK; … … 1125 1131 } 1126 1132 1133 /** Determine if input device belongs to the same seat as the original device. 1134 * 1135 * Compare the seat ownning @a idev_id with the seat owning @a wnd->orig_pos_id 1136 * (the device that started the window move or resize). 1137 * 1138 * This is used to make sure that, when two seats focus the same window, 1139 * only devices owned by the seat that started the resize or move can 1140 * affect it. Otherwise moving the other pointer(s) would disrupt the 1141 * resize or move operation. 1142 * 1143 * @param wnd Window (that is currently being resized or moved) 1144 * @param idev_id Input device ID 1145 * @return @c true iff idev_id is owned by the same seat as the input 1146 * device that started the resize or move 1147 */ 1148 bool ds_window_orig_seat(ds_window_t *wnd, sysarg_t idev_id) 1149 { 1150 ds_seat_t *orig_seat; 1151 ds_seat_t *seat; 1152 1153 /* Window must be in state such that wnd->orig_pos_id is valid */ 1154 assert(wnd->state == dsw_moving || wnd->state == dsw_resizing); 1155 1156 orig_seat = ds_display_seat_by_idev(wnd->display, wnd->orig_pos_id); 1157 seat = ds_display_seat_by_idev(wnd->display, idev_id); 1158 1159 return seat == orig_seat; 1160 } 1161 1127 1162 /** Window memory GC invalidate callback. 1128 1163 *
Note:
See TracChangeset
for help on using the changeset viewer.