Changeset 3c54869 in mainline
- Timestamp:
- 2023-01-04T20:24:44Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5d86797
- Parents:
- cdd6fc9
- Location:
- uspace
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/test/wndlist.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 208 208 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 209 209 210 rc = wndlist_append(wndlist, 123, "Foo", true );210 rc = wndlist_append(wndlist, 123, "Foo", true, true); 211 211 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 212 212 … … 214 214 PCUT_ASSERT_INT_EQUALS(123, entry->wnd_id); 215 215 PCUT_ASSERT_NOT_NULL(entry->button); 216 PCUT_ASSERT_TRUE(ui_pbutton_get_light(entry->button)); 216 217 217 218 wndlist_destroy(wndlist); … … 248 249 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 249 250 250 rc = wndlist_append(wndlist, 1, "Foo", true );251 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 252 253 rc = wndlist_append(wndlist, 2, "Bar", true);251 rc = wndlist_append(wndlist, 1, "Foo", true, true); 252 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 253 254 rc = wndlist_append(wndlist, 2, "Bar", false, true); 254 255 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 255 256 … … 269 270 } 270 271 272 /** Test updating entry */ 273 PCUT_TEST(update) 274 { 275 errno_t rc; 276 ui_t *ui = NULL; 277 ui_wnd_params_t params; 278 ui_window_t *window = NULL; 279 ui_fixed_t *fixed = NULL; 280 wndlist_t *wndlist; 281 wndlist_entry_t *entry; 282 283 rc = ui_create_disp(NULL, &ui); 284 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 285 286 ui_wnd_params_init(¶ms); 287 params.caption = "Hello"; 288 289 rc = ui_window_create(ui, ¶ms, &window); 290 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 291 PCUT_ASSERT_NOT_NULL(window); 292 293 rc = ui_fixed_create(&fixed); 294 ui_window_add(window, ui_fixed_ctl(fixed)); 295 296 rc = wndlist_create(window, fixed, &wndlist); 297 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 298 299 rc = wndlist_append(wndlist, 1, "Foo", true, true); 300 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 301 302 entry = wndlist_first(wndlist); 303 PCUT_ASSERT_INT_EQUALS(1, entry->wnd_id); 304 PCUT_ASSERT_NOT_NULL(entry->button); 305 PCUT_ASSERT_TRUE(ui_pbutton_get_light(entry->button)); 306 307 rc = wndlist_update(wndlist, entry, "Bar", false); 308 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 309 310 PCUT_ASSERT_INT_EQUALS(1, entry->wnd_id); 311 PCUT_ASSERT_NOT_NULL(entry->button); 312 PCUT_ASSERT_FALSE(ui_pbutton_get_light(entry->button)); 313 314 wndlist_destroy(wndlist); 315 316 ui_window_destroy(window); 317 ui_destroy(ui); 318 } 319 271 320 /** Test setting entry rectangle */ 272 321 PCUT_TEST(set_entry_rect) … … 296 345 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 297 346 298 rc = wndlist_append(wndlist, 123, "Foo", true );347 rc = wndlist_append(wndlist, 123, "Foo", true, true); 299 348 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 300 349 … … 337 386 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 338 387 339 rc = wndlist_append(wndlist, 1, "Foo", true );340 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 341 342 rc = wndlist_append(wndlist, 2, "Bar", true);388 rc = wndlist_append(wndlist, 1, "Foo", true, true); 389 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 390 391 rc = wndlist_append(wndlist, 2, "Bar", false, true); 343 392 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 344 393 … … 384 433 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 385 434 386 rc = wndlist_append(wndlist, 1, "Foo", true );387 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 388 389 rc = wndlist_append(wndlist, 2, "Bar", true);435 rc = wndlist_append(wndlist, 1, "Foo", true, true); 436 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 437 438 rc = wndlist_append(wndlist, 2, "Bar", false, true); 390 439 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 391 440 … … 434 483 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 435 484 436 rc = wndlist_append(wndlist, 1, "Foo", true );437 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 438 439 rc = wndlist_append(wndlist, 2, "Bar", true);485 rc = wndlist_append(wndlist, 1, "Foo", true, true); 486 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 487 488 rc = wndlist_append(wndlist, 2, "Bar", false, true); 440 489 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 441 490 … … 480 529 PCUT_ASSERT_INT_EQUALS(0, count); 481 530 482 rc = wndlist_append(wndlist, 1, "Foo", true );531 rc = wndlist_append(wndlist, 1, "Foo", true, true); 483 532 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 484 533 … … 486 535 PCUT_ASSERT_INT_EQUALS(1, count); 487 536 488 rc = wndlist_append(wndlist, 2, "Bar", true);537 rc = wndlist_append(wndlist, 2, "Bar", false, true); 489 538 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 490 539 … … 524 573 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 525 574 526 rc = wndlist_append(wndlist, 1, "Foo", true );527 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 528 529 rc = wndlist_append(wndlist, 2, "Bar", true);575 rc = wndlist_append(wndlist, 1, "Foo", true, true); 576 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 577 578 rc = wndlist_append(wndlist, 2, "Bar", false, true); 530 579 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 531 580 -
uspace/app/taskbar/wndlist.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 157 157 if ((winfo->flags & (wndf_popup | wndf_system)) == 0) { 158 158 rc = wndlist_append(wndlist, wlist->windows[i], 159 winfo->caption, false);159 winfo->caption, winfo->nfocus != 0, false); 160 160 if (rc != EOK) { 161 161 wndmgt_free_window_info(winfo); … … 202 202 * @param wnd_id Window ID 203 203 * @param caption Entry caption 204 * @param active @c true iff window is active 204 205 * @param paint @c true to paint immediately 205 206 * @return @c EOK on success or an error code 206 207 */ 207 208 errno_t wndlist_append(wndlist_t *wndlist, sysarg_t wnd_id, 208 const char *caption, bool paint)209 const char *caption, bool active, bool paint) 209 210 { 210 211 wndlist_entry_t *entry = NULL; … … 230 231 231 232 entry->visible = false; 233 234 ui_pbutton_set_light(entry->button, active); 232 235 233 236 /* Set button callbacks */ … … 382 385 * @param wndlist Window list 383 386 * @param entry Window list entry 387 * @param active @c true iff the window is active 384 388 * @return @c EOK on success or an error code 385 389 */ 386 390 errno_t wndlist_update(wndlist_t *wndlist, wndlist_entry_t *entry, 387 const char *caption )391 const char *caption, bool active) 388 392 { 389 393 errno_t rc; … … 393 397 if (rc != EOK) 394 398 return rc; 399 400 ui_pbutton_set_light(entry->button, active); 395 401 396 402 rc = ui_pbutton_paint(entry->button); … … 507 513 508 514 if ((winfo->flags & (wndf_popup | wndf_system)) == 0) { 509 rc = wndlist_append(wndlist, wnd_id, winfo->caption, true); 515 rc = wndlist_append(wndlist, wnd_id, winfo->caption, 516 winfo->nfocus != 0, true); 510 517 if (rc != EOK) { 511 518 wndmgt_free_window_info(winfo); … … 558 565 return; 559 566 560 (void) wndlist_update(wndlist, entry, winfo->caption); 567 (void) wndlist_update(wndlist, entry, winfo->caption, 568 winfo->nfocus != 0); 561 569 wndmgt_free_window_info(winfo); 562 570 } -
uspace/app/taskbar/wndlist.h
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 50 50 extern errno_t wndlist_open_wm(wndlist_t *, const char *); 51 51 extern void wndlist_destroy(wndlist_t *); 52 extern errno_t wndlist_append(wndlist_t *, sysarg_t, const char *, bool); 52 extern errno_t wndlist_append(wndlist_t *, sysarg_t, const char *, bool, 53 bool); 53 54 extern errno_t wndlist_remove(wndlist_t *, wndlist_entry_t *, bool); 54 55 extern bool wndlist_update_pitch(wndlist_t *); 55 extern errno_t wndlist_update(wndlist_t *, wndlist_entry_t *, const char *); 56 extern errno_t wndlist_update(wndlist_t *, wndlist_entry_t *, const char *, 57 bool); 56 58 extern void wndlist_set_entry_rect(wndlist_t *, wndlist_entry_t *); 57 59 extern wndlist_entry_t *wndlist_entry_by_id(wndlist_t *, sysarg_t); -
uspace/lib/ui/include/ui/pbutton.h
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 56 56 extern void ui_pbutton_set_rect(ui_pbutton_t *, gfx_rect_t *); 57 57 extern void ui_pbutton_set_default(ui_pbutton_t *, bool); 58 extern bool ui_pbutton_get_light(ui_pbutton_t *); 59 extern void ui_pbutton_set_light(ui_pbutton_t *, bool); 58 60 extern errno_t ui_pbutton_set_caption(ui_pbutton_t *, const char *); 59 61 extern errno_t ui_pbutton_paint(ui_pbutton_t *); -
uspace/lib/ui/private/pbutton.h
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 65 65 /** Button is selected as default */ 66 66 bool isdefault; 67 /** Button light is on */ 68 bool light; 67 69 /** Button is currently held down */ 68 70 bool held; -
uspace/lib/ui/private/resource.h
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 66 66 /** Button face color */ 67 67 gfx_color_t *btn_face_color; 68 /** Lit button face color */ 69 gfx_color_t *btn_face_lit_color; 68 70 /** Button text color */ 69 71 gfx_color_t *btn_text_color; -
uspace/lib/ui/src/pbutton.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 188 188 } 189 189 190 /** Get button light status. 191 * 192 * @param pbutton Button 193 * @return @c true iff light is on 194 */ 195 bool ui_pbutton_get_light(ui_pbutton_t *pbutton) 196 { 197 return pbutton->light; 198 } 199 200 /** Turn button light on or off. 201 * 202 * @param pbutton Button 203 * @param light @c true iff button should be lit 204 */ 205 void ui_pbutton_set_light(ui_pbutton_t *pbutton, bool light) 206 { 207 pbutton->light = light; 208 } 209 190 210 /** Set push button caption. 191 211 * … … 327 347 gfx_rect_t irect; 328 348 gfx_coord_t thickness; 349 gfx_color_t *color; 329 350 bool depressed; 330 351 errno_t rc; … … 338 359 rect.p1.y = pbutton->rect.p1.y - thickness; 339 360 340 rc = gfx_set_color(pbutton->res->gc, pbutton->res->btn_face_color); 361 color = pbutton->light ? pbutton->res->btn_face_lit_color : 362 pbutton->res->btn_face_color; 363 364 rc = gfx_set_color(pbutton->res->gc, color); 341 365 if (rc != EOK) 342 366 goto error; -
uspace/lib/ui/src/resource.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 62 62 gfx_color_t *btn_frame_color = NULL; 63 63 gfx_color_t *btn_face_color = NULL; 64 gfx_color_t *btn_face_lit_color = NULL; 64 65 gfx_color_t *btn_text_color = NULL; 65 66 gfx_color_t *btn_highlight_color = NULL; … … 114 115 goto error; 115 116 117 rc = gfx_color_new_rgb_i16(0xe8e8, 0xe8e8, 0xe8e8, &btn_face_lit_color); 118 if (rc != EOK) 119 goto error; 120 116 121 rc = gfx_color_new_rgb_i16(0, 0, 0, &btn_text_color); 117 122 if (rc != EOK) … … 227 232 resource->btn_frame_color = btn_frame_color; 228 233 resource->btn_face_color = btn_face_color; 234 resource->btn_face_lit_color = btn_face_lit_color; 229 235 resource->btn_text_color = btn_text_color; 230 236 resource->btn_highlight_color = btn_highlight_color; … … 263 269 if (btn_face_color != NULL) 264 270 gfx_color_delete(btn_face_color); 271 if (btn_face_lit_color != NULL) 272 gfx_color_delete(btn_face_lit_color); 265 273 if (btn_text_color != NULL) 266 274 gfx_color_delete(btn_text_color); … … 336 344 gfx_color_t *btn_frame_color = NULL; 337 345 gfx_color_t *btn_face_color = NULL; 346 gfx_color_t *btn_face_lit_color = NULL; 338 347 gfx_color_t *btn_text_color = NULL; 339 348 gfx_color_t *btn_highlight_color = NULL; … … 383 392 goto error; 384 393 394 rc = gfx_color_new_ega(0x30, &btn_face_lit_color); 395 if (rc != EOK) 396 goto error; 397 385 398 rc = gfx_color_new_ega(0x20, &btn_text_color); 386 399 if (rc != EOK) … … 486 499 resource->btn_frame_color = btn_frame_color; 487 500 resource->btn_face_color = btn_face_color; 501 resource->btn_face_lit_color = btn_face_lit_color; 488 502 resource->btn_text_color = btn_text_color; 489 503 resource->btn_highlight_color = btn_highlight_color; … … 522 536 if (btn_face_color != NULL) 523 537 gfx_color_delete(btn_face_color); 538 if (btn_face_lit_color != NULL) 539 gfx_color_delete(btn_face_lit_color); 524 540 if (btn_text_color != NULL) 525 541 gfx_color_delete(btn_text_color); … … 607 623 gfx_color_delete(resource->btn_frame_color); 608 624 gfx_color_delete(resource->btn_face_color); 625 gfx_color_delete(resource->btn_face_lit_color); 609 626 gfx_color_delete(resource->btn_text_color); 610 627 gfx_color_delete(resource->btn_highlight_color); -
uspace/lib/ui/test/pbutton.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 190 190 } 191 191 192 /** Get light gets internal field */ 193 PCUT_TEST(get_light) 194 { 195 ui_pbutton_t *pbutton; 196 errno_t rc; 197 198 rc = ui_pbutton_create(NULL, "Hello", &pbutton); 199 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 200 201 pbutton->light = true; 202 PCUT_ASSERT_TRUE(ui_pbutton_get_light(pbutton)); 203 204 pbutton->light = false; 205 PCUT_ASSERT_FALSE(ui_pbutton_get_light(pbutton)); 206 207 ui_pbutton_destroy(pbutton); 208 } 209 210 /** Set light sets internal field */ 211 PCUT_TEST(set_light) 212 { 213 ui_pbutton_t *pbutton; 214 errno_t rc; 215 216 rc = ui_pbutton_create(NULL, "Hello", &pbutton); 217 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 218 219 ui_pbutton_set_light(pbutton, true); 220 PCUT_ASSERT_TRUE(pbutton->light); 221 222 ui_pbutton_set_light(pbutton, false); 223 PCUT_ASSERT_FALSE(pbutton->light); 224 225 ui_pbutton_destroy(pbutton); 226 } 227 192 228 /** Set caption sets internal field */ 193 229 PCUT_TEST(set_caption) -
uspace/lib/wndmgt/include/types/wndmgt.h
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 89 89 /** Window flags */ 90 90 unsigned flags; 91 /** Number of foci on this window */ 92 unsigned nfocus; 91 93 } wndmgt_window_info_t; 92 94 -
uspace/lib/wndmgt/src/wndmgt.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 271 271 info->caption = caption; 272 272 info->flags = ipc_get_arg1(&answer); 273 info->nfocus = ipc_get_arg2(&answer); 273 274 *rinfo = info; 274 275 return EOK; -
uspace/lib/wndmgt/src/wndmgt_srv.c
rcdd6fc9 r3c54869 200 200 } 201 201 202 async_answer_ 1(icall, EOK, info->flags);202 async_answer_2(icall, EOK, info->flags, info->nfocus); 203 203 wndmgt_free_window_info(info); 204 204 } -
uspace/lib/wndmgt/test/wndmgt.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 282 282 resp.get_window_info_rinfo->caption = str_dup("Hello"); 283 283 resp.get_window_info_rinfo->flags = 42; 284 resp.get_window_info_rinfo->nfocus = 123; 284 285 PCUT_ASSERT_NOT_NULL(resp.get_window_info_rinfo->caption); 285 286 wnd_id = 1; … … 292 293 PCUT_ASSERT_STR_EQUALS("Hello", info->caption); 293 294 PCUT_ASSERT_INT_EQUALS(42, info->flags); 295 PCUT_ASSERT_INT_EQUALS(123, info->nfocus); 294 296 295 297 wndmgt_free_window_info(info); -
uspace/srv/hid/display/test/window.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 623 623 } 624 624 625 /** Test ds_window_post_focus_event() */ 626 PCUT_TEST(window_post_focus_event) 627 { 628 gfx_context_t *gc; 629 ds_display_t *disp; 630 ds_client_t *client; 631 ds_seat_t *seat; 632 ds_window_t *wnd; 633 display_wnd_params_t params; 634 errno_t rc; 635 636 rc = gfx_context_new(&dummy_ops, NULL, &gc); 637 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 638 639 rc = ds_display_create(gc, df_none, &disp); 640 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 641 642 rc = ds_client_create(disp, NULL, NULL, &client); 643 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 644 645 rc = ds_seat_create(disp, &seat); 646 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 647 648 display_wnd_params_init(¶ms); 649 params.rect.p0.x = params.rect.p0.y = 0; 650 params.rect.p1.x = params.rect.p1.y = 1; 651 652 rc = ds_window_create(client, ¶ms, &wnd); 653 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 654 655 rc = ds_window_post_focus_event(wnd); 656 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 657 658 ds_window_destroy(wnd); 659 ds_seat_destroy(seat); 660 ds_client_destroy(client); 661 ds_display_destroy(disp); 662 } 663 664 /** Test ds_window_post_unfocus_event() */ 665 PCUT_TEST(window_post_unfocus_event) 666 { 667 gfx_context_t *gc; 668 ds_display_t *disp; 669 ds_client_t *client; 670 ds_seat_t *seat; 671 ds_window_t *wnd; 672 display_wnd_params_t params; 673 errno_t rc; 674 675 rc = gfx_context_new(&dummy_ops, NULL, &gc); 676 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 677 678 rc = ds_display_create(gc, df_none, &disp); 679 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 680 681 rc = ds_client_create(disp, NULL, NULL, &client); 682 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 683 684 rc = ds_seat_create(disp, &seat); 685 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 686 687 display_wnd_params_init(¶ms); 688 params.rect.p0.x = params.rect.p0.y = 0; 689 params.rect.p1.x = params.rect.p1.y = 1; 690 691 rc = ds_window_create(client, ¶ms, &wnd); 692 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 693 694 rc = ds_window_post_focus_event(wnd); 695 PCUT_ASSERT_ERRNO_VAL(EOK, rc); 696 697 ds_window_destroy(wnd); 698 ds_seat_destroy(seat); 699 ds_client_destroy(client); 700 ds_display_destroy(disp); 701 } 702 625 703 /** Test ds_window_move_req() */ 626 704 PCUT_TEST(window_move_req) -
uspace/srv/hid/display/types/display/window.h
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 107 107 /** Window caption */ 108 108 char *caption; 109 /** Number of foci */ 110 unsigned nfocus; 109 111 } ds_window_t; 110 112 -
uspace/srv/hid/display/window.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 678 678 errno_t ds_window_post_focus_event(ds_window_t *wnd) 679 679 { 680 errno_t rc; 681 ds_wmclient_t *wmclient; 682 680 683 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_post_focus_event"); 681 684 682 return ds_client_post_focus_event(wnd->client, wnd); 685 rc = ds_client_post_focus_event(wnd->client, wnd); 686 if (rc != EOK) 687 return rc; 688 689 /* Increase focus counter */ 690 ++wnd->nfocus; 691 692 /* Notify window managers about window information change */ 693 wmclient = ds_display_first_wmclient(wnd->display); 694 while (wmclient != NULL) { 695 ds_wmclient_post_wnd_changed_event(wmclient, wnd->id); 696 wmclient = ds_display_next_wmclient(wmclient); 697 } 698 699 return EOK; 683 700 } 684 701 … … 690 707 errno_t ds_window_post_unfocus_event(ds_window_t *wnd) 691 708 { 709 errno_t rc; 710 ds_wmclient_t *wmclient; 711 692 712 log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_post_unfocus_event"); 693 713 694 return ds_client_post_unfocus_event(wnd->client, wnd); 714 rc = ds_client_post_unfocus_event(wnd->client, wnd); 715 if (rc != EOK) 716 return rc; 717 718 /* Decrease focus counter */ 719 --wnd->nfocus; 720 721 /* Notify window managers about window information change */ 722 wmclient = ds_display_first_wmclient(wnd->display); 723 while (wmclient != NULL) { 724 ds_wmclient_post_wnd_changed_event(wmclient, wnd->id); 725 wmclient = ds_display_next_wmclient(wmclient); 726 } 727 728 return EOK; 695 729 } 696 730 -
uspace/srv/hid/display/wmops.c
rcdd6fc9 r3c54869 1 1 /* 2 * Copyright (c) 202 2Jiri Svoboda2 * Copyright (c) 2023 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 145 145 146 146 info->flags = wnd->flags; 147 info->nfocus = wnd->nfocus; 147 148 148 149 ds_display_unlock(wmclient->display);
Note:
See TracChangeset
for help on using the changeset viewer.