@@ -24,7 +24,10 @@ export class PhoneIslandController {
2424 if ( window ) {
2525 const bounds = window . getBounds ( )
2626 if ( bounds . height !== h || bounds . width !== w ) {
27+ Log . info ( '[PI-DIAG] resize: before setBounds getBounds=' , JSON . stringify ( bounds ) , 'requestedSize=' , JSON . stringify ( { w, h } ) )
2728 window . setBounds ( { width : w , height : h } )
29+ const afterBounds = window . getBounds ( )
30+ Log . info ( '[PI-DIAG] resize: after setBounds({w,h}) getBounds=' , JSON . stringify ( afterBounds ) )
2831 PhoneIslandWindow . currentSize = { width : w , height : h }
2932 }
3033 //make sure the size is equal to [0,0] when you want to close the phone island, otherwise the size will not close and will generate slowness problems.
@@ -33,8 +36,12 @@ export class PhoneIslandController {
3336 } else {
3437 // Don't show window during warm-up
3538 if ( ! window . isVisible ( ) && ! this . isWarmingUp ) {
39+ const beforeShow = window . getBounds ( )
3640 window . show ( )
41+ const afterShow = window . getBounds ( )
3742 window . setAlwaysOnTop ( true , 'screen-saver' )
43+ const afterAlwaysOnTop = window . getBounds ( )
44+ Log . info ( '[PI-DIAG] resize show: beforeShow=' , JSON . stringify ( beforeShow ) , 'afterShow=' , JSON . stringify ( afterShow ) , 'afterAlwaysOnTop=' , JSON . stringify ( afterAlwaysOnTop ) )
3845 }
3946 }
4047 }
@@ -48,8 +55,16 @@ export class PhoneIslandController {
4855 try {
4956 const window = this . window . getWindow ( )
5057 if ( window ) {
58+ const savedPosition = AccountController . instance . getAccountPhoneIslandPosition ( )
59+ Log . info ( '[PI-DIAG] showPhoneIsland: savedPosition=' , JSON . stringify ( savedPosition ) , 'size=' , JSON . stringify ( size ) , 'getBounds_before=' , JSON . stringify ( window . getBounds ( ) ) )
60+
61+ const displays = screen . getAllDisplays ( )
62+ Log . info ( '[PI-DIAG] showPhoneIsland: displays=' , JSON . stringify ( displays . map ( d => ( { id : d . id , bounds : d . bounds , workArea : d . workArea , scaleFactor : d . scaleFactor } ) ) ) )
5163
5264 this . resize ( size )
65+ const afterResize = window . getBounds ( )
66+ Log . info ( '[PI-DIAG] showPhoneIsland: afterResize getBounds=' , JSON . stringify ( afterResize ) )
67+
5368 if ( process . platform !== 'linux' ) {
5469 const phoneIslandPosition = AccountController . instance . getAccountPhoneIslandPosition ( )
5570 if ( phoneIslandPosition ) {
@@ -63,8 +78,11 @@ export class PhoneIslandController {
6378 ( phoneIslandPosition . y + size . h ) < ( area . y + area . height ) )
6479 )
6580 } , false )
81+ Log . info ( '[PI-DIAG] showPhoneIsland: isOnDisplay=' , isPhoneIslandOnDisplay )
6682 if ( isPhoneIslandOnDisplay ) {
6783 window ?. setBounds ( { x : phoneIslandPosition . x , y : phoneIslandPosition . y } , false )
84+ const afterSetPos = window . getBounds ( )
85+ Log . info ( '[PI-DIAG] showPhoneIsland: after setBounds({x,y}) getBounds=' , JSON . stringify ( afterSetPos ) )
6886 } else {
6987 window ?. center ( )
7088 }
@@ -85,6 +103,8 @@ export class PhoneIslandController {
85103 try {
86104 const window = this . window . getWindow ( )
87105 const phoneIslandBounds = window ?. getBounds ( )
106+ const previousSaved = AccountController . instance . getAccountPhoneIslandPosition ( )
107+ Log . info ( '[PI-DIAG] hidePhoneIsland: getBounds=' , JSON . stringify ( phoneIslandBounds ) , 'previousSaved=' , JSON . stringify ( previousSaved ) )
88108 if ( phoneIslandBounds ) {
89109 AccountController . instance . setAccountPhoneIslandPosition ( {
90110 x : phoneIslandBounds . x ,
0 commit comments