| 218 | } |
| 219 | |
| 220 | onEdge(): HideDirection { |
| 221 | const window = this.mainWindow; |
| 222 | if (!this.controller.get("autoHide")) { |
| 223 | return "None"; |
| 224 | } |
| 225 | let bound = window.getBounds(); |
| 226 | let { x, y, width } = bound; |
| 227 | const { x: xBound, width: screenWidth } = screen.getDisplayMatching( |
| 228 | bound |
| 229 | ).bounds; |
| 230 | x -= xBound; |
| 231 | let xEnd = x + width; |
| 232 | |
| 233 | if (x <= 0) return "Left"; |
| 234 | if (xEnd >= screenWidth) { |
| 235 | return "Right"; |
| 236 | } |
| 237 | if (y <= 0) return "Up"; |
| 238 | return "None"; |
| 239 | } |
| 240 | |
| 241 | showWindow() { |
| 242 | const window = this.mainWindow; |