Skip to content
Permalink
Browse files

Fix saved window positions with values less than 1

The window now correctly saves position on monitors to the left of, or
above, the primary monitor.
This also fixes a bug where the window position gets reset after being
saved in a docked state.

The default position values have also been changed to 0.
  • Loading branch information...
Davnit committed Apr 13, 2016
1 parent 4af51cd commit b9d610d508a7b8239320bf5c9c343f1774a34ce0
Showing with 5 additions and 9 deletions.
  1. +2 −2 trunk/clsConfig.cls
  2. +3 −7 trunk/frmChat.frm
@@ -1883,8 +1883,8 @@ Private Sub LoadDefaults()
m_RealmHideMotd = False

'[UI-Position]
m_PositionLeft = -1
m_PositionTop = -1
m_PositionLeft = 0
m_PositionTop = 0
m_PositionHeight = 600
m_PositionWidth = 800
m_IsMaximized = False
@@ -1782,13 +1782,9 @@ Private Sub Form_Load()
Me.Width = (IIf(CLng(Config.PositionWidth) < 300, 300, CLng(Config.PositionWidth)) * Screen.TwipsPerPixelX)
End If

If Config.PositionLeft > 0 Then
Me.Left = CLng(Config.PositionLeft) * Screen.TwipsPerPixelX
End If

If Config.PositionTop > 0 Then
Me.Top = CLng(Config.PositionTop) * Screen.TwipsPerPixelY
End If
'Set window position
Me.Left = CLng(Config.PositionLeft) * Screen.TwipsPerPixelX
Me.Top = CLng(Config.PositionTop) * Screen.TwipsPerPixelY

'Make sure the window is on the screen
If Config.EnforceScreenBounds Then

0 comments on commit b9d610d

Please sign in to comment.
You can’t perform that action at this time.