@@ -53,14 +53,14 @@ func setupWindow(title string) *gtk.Window {
53
53
win .SetTitle (title )
54
54
win .SetDecorated (false )
55
55
win .SetDefaultSize (windowWidth , windowHeight )
56
+ win .SetPosition (gtk .WIN_POS_CENTER )
56
57
win .Connect ("destroy" , func () {
57
58
gtk .MainQuit ()
58
59
})
59
60
win .Connect ("focus-out-event" , func (widget * gtk.Window , event * gdk.Event ) bool {
60
61
gtk .MainQuit ()
61
62
return false // Continue with the default behavior
62
63
})
63
- moveWinToCenter (win , windowWidth , windowHeight )
64
64
65
65
// vertical button box
66
66
mainBox , err := gtk .BoxNew (gtk .ORIENTATION_VERTICAL , 2 )
@@ -124,18 +124,6 @@ func setupWindow(title string) *gtk.Window {
124
124
return win
125
125
}
126
126
127
- func moveWinToCenter (win * gtk.Window , width int , height int ) {
128
- screen , _ := gdk .ScreenGetDefault ()
129
- display , _ := screen .GetDisplay ()
130
- monitor , _ := display .GetPrimaryMonitor ()
131
- screenWidth := monitor .GetGeometry ().GetWidth ()
132
- screenHeight := monitor .GetGeometry ().GetHeight ()
133
-
134
- posX := (screenWidth - width ) / 2
135
- posY := (screenHeight - height ) / 2
136
- win .Move (posX , posY )
137
- }
138
-
139
127
func getProfiles (profilesIniPath string ) []string {
140
128
profilesCfg , err := ini .Load (profilesIniPath )
141
129
if err != nil {
0 commit comments