Changeset 17c0f5d in mainline for uspace/srv/hid/display/window.c
- Timestamp:
- 2023-01-05T19:28:22Z (2 years ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ededdc4
- Parents:
- 5d86797
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/window.c
r5d86797 r17c0f5d 67 67 * @param client Client owning the window 68 68 * @param params Window parameters 69 * @param r gc Place to store pointer to new GC.69 * @param rwnd Place to store pointer to new window. 70 70 * 71 71 * @return EOK on success or an error code 72 72 */ 73 73 errno_t ds_window_create(ds_client_t *client, display_wnd_params_t *params, 74 ds_window_t **r gc)74 ds_window_t **rwnd) 75 75 { 76 76 ds_window_t *wnd = NULL; … … 155 155 (void) ds_display_paint(wnd->display, NULL); 156 156 157 *r gc= wnd;157 *rwnd = wnd; 158 158 return EOK; 159 159 error: … … 867 867 return EOK; 868 868 869 ds_window_unfocus(wnd); 870 869 871 wnd->flags |= wndf_minimized; 870 872 (void) ds_display_paint(wnd->display, NULL); … … 1044 1046 } 1045 1047 1048 /** Find alternate window with the allowed flags. 1049 * 1050 * An alternate window is a *different* window that is preferably previous 1051 * in the display order and only has the @a allowed flags. 1052 * 1053 * @param wnd Window 1054 * @param allowed_flags Bitmask of flags that the window is allowed to have 1055 * 1056 * @return Alternate window matching the criteria or @c NULL if there is none 1057 */ 1058 ds_window_t *ds_window_find_alt(ds_window_t *wnd, 1059 display_wnd_flags_t allowed_flags) 1060 { 1061 ds_window_t *nwnd; 1062 1063 /* Try preceding windows in display order */ 1064 nwnd = ds_display_prev_window(wnd); 1065 while (nwnd != NULL && (nwnd->flags & ~allowed_flags) != 0) { 1066 nwnd = ds_display_prev_window(nwnd); 1067 } 1068 1069 /* Do we already have a matching window? */ 1070 if (nwnd != NULL && (nwnd->flags & ~allowed_flags) == 0) { 1071 return nwnd; 1072 } 1073 1074 /* Try succeeding windows in display order */ 1075 nwnd = ds_display_last_window(wnd->display); 1076 while (nwnd != NULL && nwnd != wnd && 1077 (nwnd->flags & ~allowed_flags) != 0) { 1078 nwnd = ds_display_prev_window(nwnd); 1079 } 1080 1081 if (nwnd == wnd) 1082 return NULL; 1083 1084 return nwnd; 1085 } 1086 1087 /** Remove focus from window. 1088 * 1089 * Used to switch focus to another window when closing or minimizing window. 1090 * 1091 * @param wnd Window 1092 */ 1093 void ds_window_unfocus(ds_window_t *wnd) 1094 { 1095 ds_seat_t *seat; 1096 1097 /* Make sure window is no longer focused in any seat */ 1098 seat = ds_display_first_seat(wnd->display); 1099 while (seat != NULL) { 1100 ds_seat_unfocus_wnd(seat, wnd); 1101 seat = ds_display_next_seat(seat); 1102 } 1103 } 1104 1046 1105 /** Window memory GC invalidate callback. 1047 1106 *
Note:
See TracChangeset
for help on using the changeset viewer.