File tree Expand file tree Collapse file tree 3 files changed +13
-1
lines changed
packages/electron-chrome-extensions Expand file tree Collapse file tree 3 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -448,7 +448,7 @@ See [Electron's Notification tutorial](https://www.electronjs.org/docs/tutorial/
448448- [x] chrome.windows.onCreated
449449- [x] chrome.windows.onRemoved
450450- [x] chrome.windows.onFocusChanged
451- - [ ] chrome.windows.onBoundsChanged
451+ - [x ] chrome.windows.onBoundsChanged
452452</details >
453453
454454## Limitations
Original file line number Diff line number Diff line change @@ -36,6 +36,10 @@ export class WindowsAPI {
3636 this . onFocusChanged ( windowId )
3737 } )
3838
39+ window . on ( 'resized' , ( ) => {
40+ this . onBoundsChanged ( windowId )
41+ } )
42+
3943 window . once ( 'closed' , ( ) => {
4044 this . ctx . store . windowDetailsCache . delete ( windowId )
4145 this . ctx . store . removeWindow ( window )
@@ -164,4 +168,11 @@ export class WindowsAPI {
164168 this . ctx . store . lastFocusedWindowId = windowId
165169 this . ctx . router . broadcastEvent ( 'windows.onFocusChanged' , windowId )
166170 }
171+
172+ onBoundsChanged ( windowId : number ) {
173+ const window = this . ctx . store . getWindowById ( windowId )
174+ if ( ! window ) return
175+ const windowDetails = this . createWindowDetails ( window )
176+ this . ctx . router . broadcastEvent ( 'windows.onBoundsChanged' , windowDetails )
177+ }
167178}
Original file line number Diff line number Diff line change @@ -636,6 +636,7 @@ export const injectExtensionAPIs = () => {
636636 onCreated : new ExtensionEvent ( 'windows.onCreated' ) ,
637637 onRemoved : new ExtensionEvent ( 'windows.onRemoved' ) ,
638638 onFocusChanged : new ExtensionEvent ( 'windows.onFocusChanged' ) ,
639+ onBoundsChanged : new ExtensionEvent ( 'windows.onBoundsChanged' ) ,
639640 }
640641 } ,
641642 } ,
You can’t perform that action at this time.
0 commit comments