Changeset ebb1489 in mainline for uspace/lib/ui/src/window.c
- Timestamp:
- 2024-10-13T08:23:40Z (8 weeks ago)
- Children:
- 0472cf17
- Parents:
- 2a0c827c (diff), b3b79981 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- boba-buba <120932204+boba-buba@…> (2024-10-13 08:23:40)
- git-committer:
- GitHub <noreply@…> (2024-10-13 08:23:40)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/ui/src/window.c
r2a0c827c rebb1489 1 1 /* 2 * Copyright (c) 202 3Jiri Svoboda2 * Copyright (c) 2024 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 318 318 { 319 319 ui_window_t *window; 320 ui_window_t *pwindow = NULL; 320 321 display_info_t info; 321 322 gfx_coord2_t scr_dims; … … 342 343 dparams.rect = params->rect; 343 344 dparams.caption = params->caption; 344 /* Only allow making the window larger */ 345 gfx_rect_dims(¶ms->rect, &dparams.min_size); 345 dparams.min_size = params->min_size; 346 346 347 347 /* … … 505 505 *rwindow = window; 506 506 507 if (ui_is_fullscreen(ui)) 508 pwindow = ui_window_get_active(ui); 509 507 510 list_append(&window->lwindows, &ui->windows); 511 512 if (ui_is_fullscreen(ui)) { 513 /* Send unfocus event to previously active window */ 514 if (pwindow != NULL) 515 ui_window_send_unfocus(pwindow, 0); 516 } 517 508 518 return EOK; 509 519 error: … … 531 541 { 532 542 ui_t *ui; 543 ui_window_t *nwindow; 533 544 534 545 if (window == NULL) … … 558 569 if (ui_is_fullscreen(ui)) { 559 570 ui_paint(ui); 571 /* Send focus event to newly active window */ 572 nwindow = ui_window_get_active(ui); 573 if (nwindow != NULL) 574 ui_window_send_focus(nwindow, 0); 560 575 } 561 576 … … 1031 1046 ui_lock(ui); 1032 1047 (void) ui_window_resize(window, rect); 1033 (void) ui_window_paint(window);1048 ui_window_send_resize(window); 1034 1049 ui_unlock(ui); 1035 1050 } … … 1279 1294 void ui_window_send_minimize(ui_window_t *window) 1280 1295 { 1281 if (window->cb != NULL && window->cb->m aximize != NULL)1296 if (window->cb != NULL && window->cb->minimize != NULL) 1282 1297 window->cb->minimize(window, window->arg); 1283 1298 else … … 1377 1392 else 1378 1393 return ui_window_def_unfocus(window, nfocus); 1394 } 1395 1396 /** Send window resize event. 1397 * 1398 * @param window Window 1399 */ 1400 void ui_window_send_resize(ui_window_t *window) 1401 { 1402 if (window->cb != NULL && window->cb->resize != NULL) 1403 window->cb->resize(window, window->arg); 1404 else 1405 return ui_window_def_resize(window); 1379 1406 } 1380 1407 … … 1557 1584 if (window->control != NULL) 1558 1585 ui_control_unfocus(window->control, nfocus); 1586 } 1587 1588 /** Default window resize routine. 1589 * 1590 * @param window Window 1591 * @return EOK on success or an error code 1592 */ 1593 void ui_window_def_resize(ui_window_t *window) 1594 { 1595 ui_window_paint(window); 1559 1596 } 1560 1597
Note:
See TracChangeset
for help on using the changeset viewer.