Changeset 8eeffc1 in mainline
- Timestamp:
- 2024-06-29T00:49:17Z (5 months ago)
- Children:
- 9a664b6d
- Parents:
- af3235d
- Location:
- uspace
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskbar/types/wndlist.h
raf3235d r8eeffc1 59 59 /** Window button rectangle */ 60 60 gfx_rect_t rect; 61 /** Window maximized **/ 62 bool maximized; 61 63 } wndlist_entry_t; 62 64 -
uspace/app/taskbar/wndlist.c
raf3235d r8eeffc1 232 232 233 233 entry->visible = false; 234 entry->maximized = true; 234 235 235 236 ui_pbutton_set_light(entry->button, active); … … 722 723 dev_id = entry->wndlist->ev_idev_id; 723 724 724 (void) wndmgt_activate_window(entry->wndlist->wndmgt, 725 dev_id, entry->wnd_id); 725 if (!entry->maximized) { 726 (void) wndmgt_activate_window(entry->wndlist->wndmgt, 727 dev_id, entry->wnd_id); 728 729 entry->maximized = true; 730 } else { 731 (void) wndmgt_deactivate_window(entry->wndlist->wndmgt, 732 dev_id, entry->wnd_id); 733 734 entry->maximized = false; 735 } 726 736 } 727 737 -
uspace/lib/wndmgt/include/ipc/wndmgt.h
raf3235d r8eeffc1 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
raf3235d r8eeffc1 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
raf3235d r8eeffc1 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
raf3235d r8eeffc1 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
raf3235d r8eeffc1 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
raf3235d r8eeffc1 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.