Changes in / [12dd36c:ad85592] in mainline
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/wndlist.c
r12dd36c rad85592 717 717 { 718 718 wndlist_entry_t *entry = (wndlist_entry_t *)arg; 719 wndmgt_window_info_t *winfo = NULL; 719 720 sysarg_t dev_id; 721 errno_t rc; 722 bool minimized = false; 720 723 721 724 /* ID of device that clicked the button */ 722 725 dev_id = entry->wndlist->ev_idev_id; 723 726 724 (void) wndmgt_activate_window(entry->wndlist->wndmgt, 725 dev_id, entry->wnd_id); 727 rc = wndmgt_get_window_info(entry->wndlist->wndmgt, 728 entry->wnd_id, &winfo); 729 if (rc == EOK) { 730 minimized = (winfo->flags & wndf_minimized) == 0; 731 } 732 733 if (!minimized) { 734 (void) wndmgt_activate_window(entry->wndlist->wndmgt, 735 dev_id, entry->wnd_id); 736 } else { 737 (void) wndmgt_deactivate_window(entry->wndlist->wndmgt, 738 dev_id, entry->wnd_id); 739 } 726 740 } 727 741 -
uspace/lib/wndmgt/include/ipc/wndmgt.h
r12dd36c rad85592 43 43 WNDMGT_GET_WINDOW_INFO, 44 44 WNDMGT_ACTIVATE_WINDOW, 45 WNDMGT_DEACTIVATE_WINDOW, 45 46 WNDMGT_CLOSE_WINDOW, 46 47 WNDMGT_GET_EVENT, -
uspace/lib/wndmgt/include/wndmgt.h
r12dd36c rad85592 48 48 extern void wndmgt_free_window_info(wndmgt_window_info_t *); 49 49 extern errno_t wndmgt_activate_window(wndmgt_t *, sysarg_t, sysarg_t); 50 extern errno_t wndmgt_deactivate_window(wndmgt_t *, sysarg_t, sysarg_t); 50 51 extern errno_t wndmgt_close_window(wndmgt_t *, sysarg_t); 51 52 -
uspace/lib/wndmgt/include/wndmgt_srv.h
r12dd36c rad85592 53 53 errno_t (*get_window_info)(void *, sysarg_t, wndmgt_window_info_t **); 54 54 errno_t (*activate_window)(void *, sysarg_t, sysarg_t); 55 errno_t (*deactivate_window)(void *, sysarg_t, sysarg_t); 55 56 errno_t (*close_window)(void *, sysarg_t); 56 57 errno_t (*get_event)(void *, wndmgt_ev_t *); -
uspace/lib/wndmgt/src/wndmgt.c
r12dd36c rad85592 308 308 } 309 309 310 /** Deactivate (minimize) window. 311 * 312 * @param wndmgt Window management session 313 * @param dev_id ID of input device belonging to seat whose 314 * focus is to be switched 315 * @param wnd_id Window ID 316 * @return EOK on success or an error code 317 */ 318 errno_t wndmgt_deactivate_window(wndmgt_t *wndmgt, sysarg_t dev_id, 319 sysarg_t wnd_id) 320 { 321 async_exch_t *exch; 322 errno_t rc; 323 324 exch = async_exchange_begin(wndmgt->sess); 325 rc = async_req_2_0(exch, WNDMGT_DEACTIVATE_WINDOW, dev_id, 326 wnd_id); 327 328 async_exchange_end(exch); 329 return rc; 330 } 331 310 332 /** Close window. 311 333 * -
uspace/lib/wndmgt/src/wndmgt_srv.c
r12dd36c rad85592 222 222 } 223 223 224 static void wndmgt_deactivate_window_srv(wndmgt_srv_t *srv, ipc_call_t *icall) 225 { 226 sysarg_t dev_id; 227 sysarg_t wnd_id; 228 errno_t rc; 229 230 dev_id = ipc_get_arg1(icall); 231 wnd_id = ipc_get_arg2(icall); 232 233 if (srv->ops->deactivate_window == NULL) { 234 async_answer_0(icall, ENOTSUP); 235 return; 236 } 237 238 rc = srv->ops->deactivate_window(srv->arg, dev_id, wnd_id); 239 async_answer_0(icall, rc); 240 } 241 224 242 static void wndmgt_close_window_srv(wndmgt_srv_t *srv, ipc_call_t *icall) 225 243 { … … 308 326 case WNDMGT_ACTIVATE_WINDOW: 309 327 wndmgt_activate_window_srv(srv, &call); 328 break; 329 case WNDMGT_DEACTIVATE_WINDOW: 330 wndmgt_deactivate_window_srv(srv, &call); 310 331 break; 311 332 case WNDMGT_CLOSE_WINDOW: -
uspace/srv/hid/display/wmops.c
r12dd36c rad85592 47 47 static errno_t dispwm_get_window_info(void *, sysarg_t, wndmgt_window_info_t **); 48 48 static errno_t dispwm_activate_window(void *, sysarg_t, sysarg_t); 49 static errno_t dispwm_deactivate_window(void *, sysarg_t, sysarg_t); 49 50 static errno_t dispwm_close_window(void *, sysarg_t); 50 51 static errno_t dispwm_get_event(void *, wndmgt_ev_t *); … … 54 55 .get_window_info = dispwm_get_window_info, 55 56 .activate_window = dispwm_activate_window, 57 .deactivate_window = dispwm_deactivate_window, 56 58 .close_window = dispwm_close_window, 57 59 .get_event = dispwm_get_event, … … 189 191 } 190 192 193 /** Deactivate (minimize) window. 194 * 195 * @param arg Argument (WM client) 196 * @param dev_id Input device ID 197 * @param wnd_id Window ID 198 * @return EOK on success or an error code 199 */ 200 static errno_t dispwm_deactivate_window(void *arg, sysarg_t dev_id, 201 sysarg_t wnd_id) 202 { 203 ds_wmclient_t *wmclient = (ds_wmclient_t *)arg; 204 ds_window_t *wnd; 205 206 log_msg(LOG_DEFAULT, LVL_DEBUG, "dispwm_deactivate_window()"); 207 208 ds_display_lock(wmclient->display); 209 wnd = ds_display_find_window(wmclient->display, wnd_id); 210 if (wnd == NULL) { 211 ds_display_unlock(wmclient->display); 212 return ENOENT; 213 } 214 215 ds_window_minimize(wnd); 216 217 ds_display_unlock(wmclient->display); 218 return EOK; 219 } 220 191 221 /** Close window. 192 222 *
Note:
See TracChangeset
for help on using the changeset viewer.