(ctx context.Context, windowId string)
| 169 | } |
| 170 | |
| 171 | func CheckAndFixWindow(ctx context.Context, windowId string) *waveobj.Window { |
| 172 | log.Printf("CheckAndFixWindow %s\n", windowId) |
| 173 | window, err := GetWindow(ctx, windowId) |
| 174 | if err != nil { |
| 175 | log.Printf("error getting window %q (in checkAndFixWindow): %v\n", windowId, err) |
| 176 | return nil |
| 177 | } |
| 178 | ws, err := GetWorkspace(ctx, window.WorkspaceId) |
| 179 | if err != nil { |
| 180 | log.Printf("error getting workspace %q (in checkAndFixWindow): %v\n", window.WorkspaceId, err) |
| 181 | CloseWindow(ctx, windowId, false) |
| 182 | return nil |
| 183 | } |
| 184 | if len(ws.TabIds) == 0 { |
| 185 | log.Printf("fixing workspace with no tabs %q (in checkAndFixWindow)\n", ws.OID) |
| 186 | _, err = CreateTab(ctx, ws.OID, "", true, false) |
| 187 | if err != nil { |
| 188 | log.Printf("error creating tab (in checkAndFixWindow): %v\n", err) |
| 189 | } |
| 190 | } |
| 191 | return window |
| 192 | } |
| 193 | |
| 194 | func FocusWindow(ctx context.Context, windowId string) error { |
| 195 | log.Printf("FocusWindow %s\n", windowId) |
no test coverage detected