KSP-CKAN / CKAN

The Comprehensive Kerbal Archive Network
https://forum.kerbalspaceprogram.com/index.php?/topic/197082-*
Other
1.99k stars 348 forks source link

Main window spawns with controls behind menu bar on OS X #1838

Closed Crazor closed 5 years ago

Crazor commented 8 years ago

When launching CKAN for the first time on OS X, the window spawns at (0,0). This puts the window's title bar and controls behind the menu bar, making it impossible to move. Fortunately, I was able to move it with JiTouch, and on further launches, the main window remembers it's last position.

I suggest to add a check if there is a user-set previous window location, and if not, center the window on the screen

CKAN Version: v1.18.1-0-g0d2c4f0 (beta)

Operating System: OS X El Capitan 10.11.6

politas commented 8 years ago

Finding the current screen resolution would be the only tricky part of this.

Crazor commented 8 years ago

Okay, since I know nothing about Mono, I won't ask why. Instead, I suggest adding at least 22px to the y-coordinate, which clears the menu bar on OS X.

politas commented 8 years ago

Yes, that would be an even simpler change.

HebaruSan commented 7 years ago

I believe this was fixed by #2165; the AskForAutoUpdates popup appears when launching for the first time, and that PR moved it to the center of the screen.

mactijn commented 5 years ago

Hi! I keep running into this problem, even with current versions of CKAN. #2165 is only about the AskForAutoUpdates popup, not about the Main window placement.

HebaruSan commented 5 years ago

Yeah, I misunderstood this issue. Oops.

HebaruSan commented 5 years ago

Well that's interesting. Default location is 0,0.

https://github.com/KSP-CKAN/CKAN/blob/aba8b02098f5491caa59a3fd7613e8cdc68f2a6e/GUI/Configuration.cs#L43-L59

Crazor commented 5 years ago

And (0, 0) is exactly where the window opens on first run. On macOS, this neatly tucks the window's title bar (which is 22px in height) behind the menu bar (which is also 22px high). So on macOS, any y-value of ≥23px is a sane default.

HebaruSan commented 5 years ago

Possible workaround not requiring third party tools:

Edit Kerbal Space Program/CKAN/GUIConfig.xml and change this:

  <WindowLoc>
    <X>0</X>
    <Y>0</Y>
  </WindowLoc>

to something like this:

  <WindowLoc>
    <X>0</X>
    <Y>50</Y>
  </WindowLoc>
mactijn commented 5 years ago

Edit Kerbal Space Program/CKAN/GUIConfig.xml [...]

Yep, that seems to do the trick. Thanks!