File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed
Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " node-window-manager" ,
3- "version" : " 0.3.0 " ,
3+ "version" : " 0.3.1 " ,
44 "description" : " Manage windows in macOS, Windows and Linux" ,
55 "main" : " dist/index.js" ,
66 "types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -133,12 +133,16 @@ export class Window {
133133 this . redraw ( ) ;
134134 }
135135
136- setParent ( window : Window ) {
137- user32 . SetWindowLongPtrA (
138- this . handle ,
139- windows . GWLP_HWNDPARENT ,
140- window . handle
141- ) ;
136+ setParent ( window : Window | null | number ) {
137+ let handle = window ;
138+
139+ if ( window instanceof Window ) {
140+ handle = window . handle ;
141+ } else if ( ! window ) {
142+ handle = 0 ;
143+ }
144+
145+ user32 . SetWindowLongPtrA ( this . handle , windows . GWLP_HWNDPARENT , handle ) ;
142146 }
143147
144148 redraw ( ) {
You can’t perform that action at this time.
0 commit comments