Changeset 7a05d924 in mainline for uspace/srv/hid/display/wmops.c
- Timestamp:
- 2022-10-20T08:05:06Z (14 months ago)
- Branches:
- master, ticket/834-toolchain-update, topic/msim-upgrade
- Children:
- 7cc30e9
- Parents:
- 1766326
- git-author:
- Jiri Svoboda <jiri@…> (2022-10-19 18:04:42)
- git-committer:
- Jiri Svoboda <jiri@…> (2022-10-20 08:05:06)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/display/wmops.c
r1766326 r7a05d924 35 35 36 36 #include <errno.h> 37 //#include <io/log.h>37 #include <io/log.h> 38 38 #include <stdlib.h> 39 39 #include <str.h> 40 40 #include <wndmgt_srv.h> 41 //#include "client.h" 42 //#include "display.h" 43 //#include "dsops.h" 44 //#include "seat.h" 45 //#include "window.h" 41 #include "display.h" 46 42 47 43 static errno_t dispwm_get_window_list(void *, wndmgt_window_list_t **); … … 62 58 { 63 59 wndmgt_window_list_t *list; 60 ds_display_t *disp = (ds_display_t *)arg; 61 ds_window_t *wnd; 62 unsigned i; 63 64 log_msg(LOG_DEFAULT, LVL_DEBUG, "dispwm_get_window_list()"); 64 65 65 66 list = calloc(1, sizeof(wndmgt_window_list_t)); … … 67 68 return ENOMEM; 68 69 69 list->nwindows = 2; 70 list->windows = calloc(2, sizeof(sysarg_t)); 70 /* Count the number of windows */ 71 list->nwindows = 0; 72 wnd = ds_display_first_window(disp); 73 while (wnd != NULL) { 74 ++list->nwindows; 75 wnd = ds_display_next_window(wnd); 76 } 77 78 /* Allocate array for window IDs */ 79 list->windows = calloc(list->nwindows, sizeof(sysarg_t)); 71 80 if (list->windows == NULL) { 72 81 free(list); … … 74 83 } 75 84 76 list->windows[0] = 1; 77 list->windows[1] = 2; 85 /* Fill in window IDs */ 86 i = 0; 87 wnd = ds_display_first_window(disp); 88 while (wnd != NULL) { 89 list->windows[i++] = wnd->id; 90 wnd = ds_display_next_window(wnd); 91 } 78 92 79 93 *rlist = list; … … 84 98 wndmgt_window_info_t **rinfo) 85 99 { 100 86 101 /* ds_client_t *client = (ds_client_t *) arg; 87 102 ds_window_t *wnd; … … 101 116 wndmgt_window_info_t *info; 102 117 118 log_msg(LOG_DEFAULT, LVL_DEBUG, "dispwm_get_window_info()"); 119 103 120 info = calloc(1, sizeof(wndmgt_window_info_t)); 104 121 if (info == NULL) … … 117 134 static errno_t dispwm_activate_window(void *arg, sysarg_t wnd_id) 118 135 { 136 log_msg(LOG_DEFAULT, LVL_DEBUG, "dispwm_activate_window()"); 119 137 (void)arg; 120 138 (void)wnd_id; … … 124 142 static errno_t dispwm_close_window(void *arg, sysarg_t wnd_id) 125 143 { 144 log_msg(LOG_DEFAULT, LVL_DEBUG, "dispwm_close_window()"); 126 145 (void)arg; 127 146 (void)wnd_id;
Note:
See TracChangeset
for help on using the changeset viewer.