Improve checking for the landing point when docking windows in wxAUI.

This is especially important for multiple monitor setups in which the old code
could result in false positives and suggest docking a window on a wrong
display.

Closes #10612.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67740 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-05-14 14:18:02 +00:00
parent 2347971e99
commit fdc5bc9f67

View File

@@ -2889,7 +2889,9 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
if (pt.x < layer_insert_offset && if (pt.x < layer_insert_offset &&
pt.x > layer_insert_offset-auiLayerInsertPixels) pt.x > layer_insert_offset-auiLayerInsertPixels &&
pt.y > 0 &&
pt.y < cli_size.y)
{ {
int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_LEFT), int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_LEFT),
GetMaxLayer(docks, wxAUI_DOCK_BOTTOM)), GetMaxLayer(docks, wxAUI_DOCK_BOTTOM)),
@@ -2905,7 +2907,9 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
return ProcessDockResult(target, drop); return ProcessDockResult(target, drop);
} }
else if (pt.y < layer_insert_offset && else if (pt.y < layer_insert_offset &&
pt.y > layer_insert_offset-auiLayerInsertPixels) pt.y > layer_insert_offset-auiLayerInsertPixels &&
pt.x > 0 &&
pt.x < cli_size.x)
{ {
int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_TOP), int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_TOP),
GetMaxLayer(docks, wxAUI_DOCK_LEFT)), GetMaxLayer(docks, wxAUI_DOCK_LEFT)),
@@ -2921,7 +2925,9 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
return ProcessDockResult(target, drop); return ProcessDockResult(target, drop);
} }
else if (pt.x >= cli_size.x - layer_insert_offset && else if (pt.x >= cli_size.x - layer_insert_offset &&
pt.x < cli_size.x - layer_insert_offset + auiLayerInsertPixels) pt.x < cli_size.x - layer_insert_offset + auiLayerInsertPixels &&
pt.y > 0 &&
pt.y < cli_size.y)
{ {
int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_RIGHT), int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_RIGHT),
GetMaxLayer(docks, wxAUI_DOCK_TOP)), GetMaxLayer(docks, wxAUI_DOCK_TOP)),
@@ -2937,7 +2943,9 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
return ProcessDockResult(target, drop); return ProcessDockResult(target, drop);
} }
else if (pt.y >= cli_size.y - layer_insert_offset && else if (pt.y >= cli_size.y - layer_insert_offset &&
pt.y < cli_size.y - layer_insert_offset + auiLayerInsertPixels) pt.y < cli_size.y - layer_insert_offset + auiLayerInsertPixels &&
pt.x > 0 &&
pt.x < cli_size.x)
{ {
int new_layer = wxMax( wxMax( GetMaxLayer(docks, wxAUI_DOCK_BOTTOM), int new_layer = wxMax( wxMax( GetMaxLayer(docks, wxAUI_DOCK_BOTTOM),
GetMaxLayer(docks, wxAUI_DOCK_LEFT)), GetMaxLayer(docks, wxAUI_DOCK_LEFT)),