Changeset dace86a in mainline
- Timestamp:
- 2014-01-16T17:02:31Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ba02baa
- Parents:
- 8bb0f5d6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/compositor/compositor.c
r8bb0f5d6 rdace86a 293 293 sysarg_t *x_out, sysarg_t *y_out, sysarg_t *w_out, sysarg_t *h_out) 294 294 { 295 if ( w_in > 0 && h_in > 0) {295 if ((w_in > 0) && (h_in > 0)) { 296 296 sysarg_t x[4]; 297 297 sysarg_t y[4]; 298 298 299 comp_coord_from_client(x_in, y_in, win_trans, &x[0], &y[0]); 299 300 comp_coord_from_client(x_in + w_in - 1, y_in, win_trans, &x[1], &y[1]); 300 301 comp_coord_from_client(x_in + w_in - 1, y_in + h_in - 1, win_trans, &x[2], &y[2]); 301 302 comp_coord_from_client(x_in, y_in + h_in - 1, win_trans, &x[3], &y[3]); 303 302 304 (*x_out) = x[0]; 303 305 (*y_out) = y[0]; 304 306 (*w_out) = x[0]; 305 307 (*h_out) = y[0]; 306 for (int i = 1; i < 4; ++i) { 308 309 for (unsigned int i = 1; i < 4; ++i) { 307 310 (*x_out) = (x[i] < (*x_out)) ? x[i] : (*x_out); 308 311 (*y_out) = (y[i] < (*y_out)) ? y[i] : (*y_out); … … 310 313 (*h_out) = (y[i] > (*h_out)) ? y[i] : (*h_out); 311 314 } 315 312 316 (*w_out) = (*w_out) - (*x_out) + 1; 313 317 (*h_out) = (*h_out) - (*y_out) + 1; … … 643 647 static void comp_window_resize(window_t *win, ipc_callid_t iid, ipc_call_t *icall) 644 648 { 645 int rc;646 647 649 ipc_callid_t callid; 648 650 size_t size; 649 651 unsigned int flags; 650 652 651 653 /* Start sharing resized window with client. */ 652 654 if (!async_share_out_receive(&callid, &size, &flags)) { … … 654 656 return; 655 657 } 658 656 659 void *new_cell_storage; 657 rc = async_share_out_finalize(callid, &new_cell_storage);660 int rc = async_share_out_finalize(callid, &new_cell_storage); 658 661 if ((rc != EOK) || (new_cell_storage == AS_MAP_FAILED)) { 659 662 async_answer_0(iid, ENOMEM); 660 663 return; 661 664 } 662 665 663 666 /* Create new surface for the resized window. */ 664 surface_t *new_surface = surface_create( 665 IPC_GET_ARG1(*icall), IPC_GET_ARG2(*icall), 666 new_cell_storage, SURFACE_FLAG_SHARED); 667 surface_t *new_surface = surface_create(IPC_GET_ARG1(*icall), 668 IPC_GET_ARG2(*icall), new_cell_storage, SURFACE_FLAG_SHARED); 667 669 if (!new_surface) { 668 670 as_area_destroy(new_cell_storage); … … 670 672 return; 671 673 } 672 674 673 675 /* Switch new surface with old surface and calculate damage. */ 674 676 fibril_mutex_lock(&window_list_mtx); 675 677 676 678 sysarg_t old_width = 0; 677 679 sysarg_t old_height = 0; 680 678 681 if (win->surface) { 679 682 surface_get_resolution(win->surface, &old_width, &old_height); 680 683 surface_destroy(win->surface); 681 684 } 682 685 683 686 win->surface = new_surface; 684 687 685 688 sysarg_t new_width = 0; 686 689 sysarg_t new_height = 0; 687 690 surface_get_resolution(win->surface, &new_width, &new_height); 688 689 sysarg_t x, y; 691 692 sysarg_t x; 693 sysarg_t y; 690 694 sysarg_t width = old_width > new_width ? old_width : new_width; 691 695 sysarg_t height = old_height > new_height ? old_height : new_height; 692 comp_coord_bounding_rect(0, 0, width, height, win->transform, &x, &y, &width, &height); 693 696 comp_coord_bounding_rect(0, 0, width, height, win->transform, &x, &y, 697 &width, &height); 698 694 699 fibril_mutex_unlock(&window_list_mtx); 695 700 696 701 comp_damage(x, y, width, height); 697 702 698 703 async_answer_0(iid, EOK); 699 704 } … … 1225 1230 double cx = 0; 1226 1231 double cy = 0; 1227 if (pointer->grab_flags & GF_MOVE_X) { 1232 1233 if (pointer->grab_flags & GF_MOVE_X) 1228 1234 cx = 1; 1229 }1230 if (pointer->grab_flags & GF_MOVE_Y) {1235 1236 if (pointer->grab_flags & GF_MOVE_Y) 1231 1237 cy = 1; 1232 } 1233 1234 if ((scale || resize) && (win->angle != 0)) { 1238 1239 if (((scale) || (resize)) && (win->angle != 0)) { 1235 1240 transform_t rotate; 1236 1241 transform_identity(&rotate); 1242 1237 1243 transform_rotate(&rotate, win->angle); 1238 1244 transform_apply_linear(&rotate, &cx, &cy); 1239 1245 } 1240 1246 1241 cx = (cx < 0) ? (-1 * cx) : cx; 1247 cx = (cx < 0) ? (-1 * cx) : cx; 1242 1248 cy = (cy < 0) ? (-1 * cy) : cy; 1243 1249 1244 1250 win->dx += (cx * dx); 1245 1251 win->dy += (cy * dy);
Note:
See TracChangeset
for help on using the changeset viewer.