CtrlCore: GTK primary work area issue #640

git-svn-id: svn://ultimatepp.org/upp/trunk@6761 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-01-11 16:26:04 +00:00
parent 07bec4fbe7
commit 36db54e794

View file

@ -290,9 +290,11 @@ Rect Ctrl::GetVirtualScreenArea()
Rect Ctrl::GetPrimaryWorkArea()
{
GuiLock __;
int primary = gdk_screen_get_primary_monitor(gdk_screen_get_default());
Array<Rect> rc;
GetWorkArea(rc);
return rc.GetCount() ? rc[0] : GetVirtualScreenArea();
return primary < rc.GetCount() ? rc[primary] : GetVirtualScreenArea();
}
Rect Ctrl::GetPrimaryScreenArea()
@ -453,14 +455,16 @@ void Ctrl::WndUpdate()
Rect Ctrl::GetDefaultWindowRect()
{
GuiLock __;
Size sz = GetPrimaryWorkArea().GetSize();
Rect r = GetPrimaryWorkArea();
Size sz = r.GetSize();
static int pos = min(sz.cx / 10, 50);
pos += 10;
int cx = sz.cx * 2 / 3;
int cy = sz.cy * 2 / 3;
if(pos + cx + 50 > sz.cx || pos + cy + 50 > sz.cy)
pos = 0;
return RectC(pos + 20, pos + 20, cx, cy);
return RectC(r.left + pos + 20, r.top + pos + 20, cx, cy);
}
ViewDraw::ViewDraw(Ctrl *ctrl)