Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Crazor opened this issue Jul 25, 2016 · 10 comments
Closed

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

Crazor opened this issue Jul 25, 2016 · 10 comments
Labels
Bug Something is not working as intended Easy This is easy to fix GUI Issues affecting the interactive GUI macOS Issues specific for macOS

Comments

@Crazor
Copy link

Crazor commented Jul 25, 2016

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 politas added Enhancement New features or functionality Easy This is easy to fix GUI Issues affecting the interactive GUI ★★☆ ★☆☆ and removed ★★☆ labels Jul 25, 2016
@politas
Copy link
Member

politas commented Jul 25, 2016

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

@Crazor
Copy link
Author

Crazor commented Jul 25, 2016

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
Copy link
Member

politas commented Jul 25, 2016

Yes, that would be an even simpler change.

@ayan4m1 ayan4m1 added macOS Issues specific for macOS and removed Easy This is easy to fix labels Aug 30, 2016
@HebaruSan
Copy link
Member

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.

@pjf pjf removed the ★☆☆ label Nov 10, 2017
@mactijn
Copy link

mactijn commented Jan 31, 2019

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
Copy link
Member

Yeah, I misunderstood this issue. Oops.

@HebaruSan HebaruSan reopened this Jan 31, 2019
@HebaruSan
Copy link
Member

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

private Point windowLocation = new Point(0,0);
//Workaround for bug which mis-sets the window location.
// Here instead of in Main_FormClosing due to the mistaken
// value possibly being written out to config file. After some time
// it should be save to move. RLake 2015/05
public Point WindowLoc
{
get
{
if (windowLocation.X < 0 && windowLocation.Y < 0)
{
windowLocation = new Point(60, 30);
}
return windowLocation;
}
set { windowLocation = value; }
}

@HebaruSan HebaruSan added Bug Something is not working as intended Easy This is easy to fix and removed Enhancement New features or functionality labels Jan 31, 2019
@Crazor
Copy link
Author

Crazor commented Jan 31, 2019

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
Copy link
Member

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
Copy link

mactijn commented Jan 31, 2019

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

Yep, that seems to do the trick. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Easy This is easy to fix GUI Issues affecting the interactive GUI macOS Issues specific for macOS
Projects
None yet
Development

No branches or pull requests

6 participants