Changeset 3a6d44b7 in mainline
- Timestamp:
- 2022-11-07T17:42:51Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 60ebe63
- Parents:
- f1f433d
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/wndlist.c
rf1f433d r3a6d44b7 50 50 static void wndlist_wm_window_changed(void *, sysarg_t); 51 51 52 /** Window list WM callbacks */ 52 53 static wndmgt_cb_t wndlist_wndmgt_cb = { 53 54 .window_added = wndlist_wm_window_added, 54 55 .window_removed = wndlist_wm_window_removed, 55 56 .window_changed = wndlist_wm_window_changed 57 }; 58 59 static void wndlist_button_clicked(ui_pbutton_t *, void *); 60 61 /** Window list button callbacks */ 62 static ui_pbutton_cb_t wndlist_button_cb = { 63 .clicked = wndlist_button_clicked 56 64 }; 57 65 … … 186 194 /* Set the button rectangle */ 187 195 wndlist_set_entry_rect(wndlist, entry); 196 197 /* Set button callbacks */ 198 ui_pbutton_set_cb(entry->button, &wndlist_button_cb, (void *)entry); 188 199 189 200 rc = ui_fixed_add(wndlist->fixed, ui_pbutton_ctl(entry->button)); … … 340 351 wndlist_entry_t *entry; 341 352 342 printf("wm_window_removed: wndlist=%p wnd_id=%zu\n",343 (void *)wndlist, wnd_id);344 345 353 entry = wndlist_entry_by_id(wndlist, wnd_id); 346 354 if (entry == NULL) … … 361 369 wndlist_entry_t *entry; 362 370 errno_t rc; 363 364 printf("wm_window_changed: wndlist=%p wnd_id=%zu\n",365 (void *)wndlist, wnd_id);366 371 367 372 entry = wndlist_entry_by_id(wndlist, wnd_id); … … 440 445 } 441 446 447 /** Window button was clicked. 448 * 449 * @param pbutton Push button 450 * @param arg Argument (wdnlist_entry_t *) 451 */ 452 static void wndlist_button_clicked(ui_pbutton_t *pbutton, void *arg) 453 { 454 wndlist_entry_t *entry = (wndlist_entry_t *)arg; 455 sysarg_t seat_id; 456 457 seat_id = 0; // TODO Multi-seat 458 459 (void) wndmgt_activate_window(entry->wndlist->wndmgt, 460 seat_id, entry->wnd_id); 461 } 462 442 463 /** @} 443 464 */ -
uspace/lib/wndmgt/include/wndmgt.h
rf1f433d r3a6d44b7 47 47 wndmgt_window_info_t **); 48 48 extern void wndmgt_free_window_info(wndmgt_window_info_t *); 49 extern errno_t wndmgt_activate_window(wndmgt_t *, sysarg_t );49 extern errno_t wndmgt_activate_window(wndmgt_t *, sysarg_t, sysarg_t); 50 50 extern errno_t wndmgt_close_window(wndmgt_t *, sysarg_t); 51 51 -
uspace/lib/wndmgt/include/wndmgt_srv.h
rf1f433d r3a6d44b7 52 52 errno_t (*get_window_list)(void *, wndmgt_window_list_t **); 53 53 errno_t (*get_window_info)(void *, sysarg_t, wndmgt_window_info_t **); 54 errno_t (*activate_window)(void *, sysarg_t );54 errno_t (*activate_window)(void *, sysarg_t, sysarg_t); 55 55 errno_t (*close_window)(void *, sysarg_t); 56 56 errno_t (*get_event)(void *, wndmgt_ev_t *); -
uspace/lib/wndmgt/src/wndmgt.c
rf1f433d r3a6d44b7 287 287 * 288 288 * @param wndmgt Window management session 289 * @param seat_id Seat ID 289 290 * @param wnd_id Window ID 290 291 * @return EOK on success or an error code 291 292 */ 292 errno_t wndmgt_activate_window(wndmgt_t *wndmgt, sysarg_t wnd_id) 293 errno_t wndmgt_activate_window(wndmgt_t *wndmgt, sysarg_t seat_id, 294 sysarg_t wnd_id) 293 295 { 294 296 async_exch_t *exch; … … 296 298 297 299 exch = async_exchange_begin(wndmgt->sess); 298 rc = async_req_1_0(exch, WNDMGT_ACTIVATE_WINDOW, wnd_id); 300 rc = async_req_2_0(exch, WNDMGT_ACTIVATE_WINDOW, seat_id, 301 wnd_id); 299 302 300 303 async_exchange_end(exch); -
uspace/lib/wndmgt/src/wndmgt_srv.c
rf1f433d r3a6d44b7 204 204 static void wndmgt_activate_window_srv(wndmgt_srv_t *srv, ipc_call_t *icall) 205 205 { 206 sysarg_t seat_id; 206 207 sysarg_t wnd_id; 207 208 errno_t rc; 208 209 209 wnd_id = ipc_get_arg1(icall); 210 seat_id = ipc_get_arg1(icall); 211 wnd_id = ipc_get_arg2(icall); 210 212 211 213 if (srv->ops->activate_window == NULL) { … … 214 216 } 215 217 216 rc = srv->ops->activate_window(srv->arg, wnd_id);218 rc = srv->ops->activate_window(srv->arg, seat_id, wnd_id); 217 219 async_answer_0(icall, rc); 218 220 } -
uspace/lib/wndmgt/test/wndmgt.c
rf1f433d r3a6d44b7 48 48 static errno_t test_get_window_list(void *, wndmgt_window_list_t **); 49 49 static errno_t test_get_window_info(void *, sysarg_t, wndmgt_window_info_t **); 50 static errno_t test_activate_window(void *, sysarg_t );50 static errno_t test_activate_window(void *, sysarg_t, sysarg_t); 51 51 static errno_t test_close_window(void *, sysarg_t); 52 52 static errno_t test_get_event(void *, wndmgt_ev_t *); … … 88 88 89 89 bool activate_window_called; 90 sysarg_t activate_window_seat_id; 90 91 sysarg_t activate_window_wnd_id; 91 92 … … 302 303 service_id_t sid; 303 304 wndmgt_t *wndmgt = NULL; 305 sysarg_t seat_id; 304 306 sysarg_t wnd_id; 305 307 test_response_t resp; … … 318 320 PCUT_ASSERT_NOT_NULL(wndmgt); 319 321 322 seat_id = 13; 320 323 wnd_id = 42; 321 324 resp.rc = ENOMEM; 322 325 resp.activate_window_called = false; 323 326 324 rc = wndmgt_activate_window(wndmgt, wnd_id);327 rc = wndmgt_activate_window(wndmgt, seat_id, wnd_id); 325 328 PCUT_ASSERT_TRUE(resp.activate_window_called); 329 PCUT_ASSERT_INT_EQUALS(seat_id, resp.activate_window_seat_id); 326 330 PCUT_ASSERT_INT_EQUALS(wnd_id, resp.activate_window_wnd_id); 327 331 PCUT_ASSERT_ERRNO_VAL(resp.rc, rc); … … 338 342 service_id_t sid; 339 343 wndmgt_t *wndmgt = NULL; 344 sysarg_t seat_id; 340 345 sysarg_t wnd_id; 341 346 test_response_t resp; … … 354 359 PCUT_ASSERT_NOT_NULL(wndmgt); 355 360 361 seat_id = 13; 356 362 wnd_id = 42; 357 363 resp.rc = EOK; 358 364 resp.activate_window_called = false; 359 365 360 rc = wndmgt_activate_window(wndmgt, wnd_id);366 rc = wndmgt_activate_window(wndmgt, seat_id, wnd_id); 361 367 PCUT_ASSERT_TRUE(resp.activate_window_called); 368 PCUT_ASSERT_INT_EQUALS(seat_id, resp.activate_window_seat_id); 362 369 PCUT_ASSERT_INT_EQUALS(wnd_id, resp.activate_window_wnd_id); 363 370 PCUT_ASSERT_ERRNO_VAL(resp.rc, rc); … … 666 673 } 667 674 668 static errno_t test_activate_window(void *arg, sysarg_t wnd_id) 675 static errno_t test_activate_window(void *arg, sysarg_t seat_id, 676 sysarg_t wnd_id) 669 677 { 670 678 test_response_t *resp = (test_response_t *) arg; 671 679 672 680 resp->activate_window_called = true; 681 resp->activate_window_seat_id = seat_id; 673 682 resp->activate_window_wnd_id = wnd_id; 674 683 return resp->rc; -
uspace/srv/hid/display/wmops.c
rf1f433d r3a6d44b7 40 40 #include <wndmgt_srv.h> 41 41 #include "display.h" 42 #include "seat.h" 42 43 #include "wmclient.h" 43 44 44 45 static errno_t dispwm_get_window_list(void *, wndmgt_window_list_t **); 45 46 static errno_t dispwm_get_window_info(void *, sysarg_t, wndmgt_window_info_t **); 46 static errno_t dispwm_activate_window(void *, sysarg_t );47 static errno_t dispwm_activate_window(void *, sysarg_t, sysarg_t); 47 48 static errno_t dispwm_close_window(void *, sysarg_t); 48 49 static errno_t dispwm_get_event(void *, wndmgt_ev_t *); … … 150 151 * 151 152 * @param arg Argument (WM client) 153 * @param seat_id Seat ID 152 154 * @param wnd_id Window ID 153 155 * @return EOK on success or an error code 154 156 */ 155 static errno_t dispwm_activate_window(void *arg, sysarg_t wnd_id) 156 { 157 static errno_t dispwm_activate_window(void *arg, sysarg_t seat_id, 158 sysarg_t wnd_id) 159 { 160 ds_wmclient_t *wmclient = (ds_wmclient_t *)arg; 161 ds_window_t *wnd; 162 ds_seat_t *seat; 163 157 164 log_msg(LOG_DEFAULT, LVL_DEBUG, "dispwm_activate_window()"); 158 (void)arg; 159 (void)wnd_id; 165 166 ds_display_lock(wmclient->display); 167 wnd = ds_display_find_window(wmclient->display, wnd_id); 168 if (wnd == NULL) { 169 ds_display_unlock(wmclient->display); 170 return ENOENT; 171 } 172 173 // TODO Multi-seat 174 (void) seat_id; 175 seat = ds_display_first_seat(wnd->display); 176 177 /* Switch focus */ 178 ds_seat_set_focus(seat, wnd); 179 180 ds_display_unlock(wmclient->display); 160 181 return EOK; 161 182 }
Note:
See TracChangeset
for help on using the changeset viewer.