(ctx context.Context, windowId string)
| 192 | } |
| 193 | |
| 194 | func FocusWindow(ctx context.Context, windowId string) error { |
| 195 | log.Printf("FocusWindow %s\n", windowId) |
| 196 | client, err := GetClientData(ctx) |
| 197 | if err != nil { |
| 198 | log.Printf("error getting client data: %v\n", err) |
| 199 | return err |
| 200 | } |
| 201 | winIdx := utilfn.SliceIdx(client.WindowIds, windowId) |
| 202 | if winIdx == -1 { |
| 203 | log.Printf("window %s not found in client data\n", windowId) |
| 204 | return nil |
| 205 | } |
| 206 | client.WindowIds = utilfn.MoveSliceIdxToFront(client.WindowIds, winIdx) |
| 207 | log.Printf("client.WindowIds: %v\n", client.WindowIds) |
| 208 | return wstore.DBUpdate(ctx, client) |
| 209 | } |
no test coverage detected