mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-02-06 10:21:57 +08:00
adjust to a reasonable position for a main window with style WS_EX_AUTOPOSITION
This commit is contained in:
@@ -4641,9 +4641,9 @@ MG_EXPORT SRVEVTHOOK GUIAPI SetServerEventHook (SRVEVTHOOK SrvEvtHook);
|
||||
* \brief The position of the main window will be determined by system.
|
||||
*
|
||||
* If a main window has this extend style when creating it, MiniGUI will
|
||||
* determine the position of the main window. If the width or the height of
|
||||
* the window specified in MAINWINCREATE structure is zero, MiniGUI will
|
||||
* also determine a default size for the main window.
|
||||
* determine the position in the screen for the main window. If the width
|
||||
* or the height of the window specified in MAINWINCREATE structure is zero,
|
||||
* MiniGUI will also determine a default size for the main window.
|
||||
*
|
||||
* Under the compositing schema, the compositor is responsible to calculate
|
||||
* the position and the size for a main window.
|
||||
|
||||
@@ -601,6 +601,15 @@ static void calc_mainwin_pos (CompositorCtxt* ctxt, MG_Layer* layer,
|
||||
info->rc = znode_hdr->rc;
|
||||
OffsetRect (&info->rc,
|
||||
DEF_OVERLAPPED_OFFSET_X, DEF_OVERLAPPED_OFFSET_Y);
|
||||
|
||||
/* adjust to a reasonable postion */
|
||||
if (info->rc.top > (g_rcScr.bottom * 3 / 4)) {
|
||||
OffsetRect (&info->rc, 0, -info->rc.top);
|
||||
}
|
||||
|
||||
if (info->rc.left > (g_rcScr.right * 3 / 4)) {
|
||||
OffsetRect (&info->rc, -info->rc.left, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4413,6 +4413,15 @@ static int dskCalculateDefaultPosition (int cli, CALCPOSINFO* info)
|
||||
info->rc = nodes[first].rc;
|
||||
OffsetRect (&info->rc,
|
||||
DEF_OVERLAPPED_OFFSET_X, DEF_OVERLAPPED_OFFSET_Y);
|
||||
|
||||
/* adjust to a reasonable postion */
|
||||
if (info->rc.top > (g_rcScr.bottom * 3 / 4)) {
|
||||
OffsetRect (&info->rc, 0, -info->rc.top);
|
||||
}
|
||||
|
||||
if (info->rc.left > (g_rcScr.right * 3 / 4)) {
|
||||
OffsetRect (&info->rc, -info->rc.left, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* defined _MGSCHEMA_COMPOSITING */
|
||||
|
||||
Reference in New Issue
Block a user