Changes in / [ad85592:12dd36c] in mainline
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/wndlist.c
rad85592 r12dd36c 717 717 { 718 718 wndlist_entry_t *entry = (wndlist_entry_t *)arg; 719 wndmgt_window_info_t *winfo = NULL;720 719 sysarg_t dev_id; 721 errno_t rc;722 bool minimized = false;723 720 724 721 /* ID of device that clicked the button */ 725 722 dev_id = entry->wndlist->ev_idev_id; 726 723 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 } 724 (void) wndmgt_activate_window(entry->wndlist->wndmgt, 725 dev_id, entry->wnd_id); 740 726 } 741 727 -
uspace/lib/wndmgt/include/ipc/wndmgt.h
rad85592 r12dd36c 43 43 WNDMGT_GET_WINDOW_INFO, 44 44 WNDMGT_ACTIVATE_WINDOW, 45 WNDMGT_DEACTIVATE_WINDOW,46 45 WNDMGT_CLOSE_WINDOW, 47 46 WNDMGT_GET_EVENT, -
uspace/lib/wndmgt/include/wndmgt.h
rad85592 r12dd36c 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);51 50 extern errno_t wndmgt_close_window(wndmgt_t *, sysarg_t); 52 51 -
uspace/lib/wndmgt/include/wndmgt_srv.h
rad85592 r12dd36c 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);56 55 errno_t (*close_window)(void *, sysarg_t); 57 56 errno_t (*get_event)(void *, wndmgt_ev_t *); -
uspace/lib/wndmgt/src/wndmgt.c
rad85592 r12dd36c 308 308 } 309 309 310 /** Deactivate (minimize) window.311 *312 * @param wndmgt Window management session313 * @param dev_id ID of input device belonging to seat whose314 * focus is to be switched315 * @param wnd_id Window ID316 * @return EOK on success or an error code317 */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 332 310 /** Close window. 333 311 * -
uspace/lib/wndmgt/src/wndmgt_srv.c
rad85592 r12dd36c 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 242 224 static void wndmgt_close_window_srv(wndmgt_srv_t *srv, ipc_call_t *icall) 243 225 { … … 326 308 case WNDMGT_ACTIVATE_WINDOW: 327 309 wndmgt_activate_window_srv(srv, &call); 328 break;329 case WNDMGT_DEACTIVATE_WINDOW:330 wndmgt_deactivate_window_srv(srv, &call);331 310 break; 332 311 case WNDMGT_CLOSE_WINDOW: -
uspace/srv/hid/display/wmops.c
rad85592 r12dd36c 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);50 49 static errno_t dispwm_close_window(void *, sysarg_t); 51 50 static errno_t dispwm_get_event(void *, wndmgt_ev_t *); … … 55 54 .get_window_info = dispwm_get_window_info, 56 55 .activate_window = dispwm_activate_window, 57 .deactivate_window = dispwm_deactivate_window,58 56 .close_window = dispwm_close_window, 59 57 .get_event = dispwm_get_event, … … 191 189 } 192 190 193 /** Deactivate (minimize) window.194 *195 * @param arg Argument (WM client)196 * @param dev_id Input device ID197 * @param wnd_id Window ID198 * @return EOK on success or an error code199 */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 221 191 /** Close window. 222 192 *
Note:
See TracChangeset
for help on using the changeset viewer.