Compare commits

...

6 commits

View file

@ -114,6 +114,37 @@ LRESULT NonClientIslandWindow::_InputSinkMessageHandler(UINT const message, WPAR
case WM_RBUTTONUP:
nonClientMessage = WM_NCRBUTTONUP;
break;
case WM_NCHITTEST:
{
const til::rectangle rect{ _GetDragAreaRect() };
const POINT screenPt{ GET_X_LPARAM(lparam), GET_Y_LPARAM(lparam) };
POINT clientPt{ screenPt };
ScreenToClient(_dragBarWindow.get(), &clientPt);
const til::point p{ clientPt };
auto contains = rect.contains(p);
// if (!rect.contains(p))
// {
// return HTTRANSPARENT;
// }
// else
// {
// return HTCLIENT;
// }
p;
rect;
contains;
auto mainDefResult = DefWindowProc(_window.get(), message, wparam, lparam);
auto dragDefResult = DefWindowProc(_dragBarWindow.get(), message, wparam, lparam);
LRESULT dragDwmResult = 0;
LRESULT mainDwmResult = 0;
DwmDefWindowProc(_window.get(), message, wparam, lparam, &mainDwmResult);
DwmDefWindowProc(_dragBarWindow.get(), message, wparam, lparam, &dragDwmResult);
dragDefResult;
mainDefResult;
// // break;
return HTTRANSPARENT;
}
}
if (nonClientMessage.has_value())
@ -135,6 +166,7 @@ LRESULT NonClientIslandWindow::_InputSinkMessageHandler(UINT const message, WPAR
}
return DefWindowProc(_dragBarWindow.get(), message, wparam, lparam);
// return DefWindowProc(_window.get(), message, wparam, lparam);
}
// Method Description:
@ -143,13 +175,15 @@ LRESULT NonClientIslandWindow::_InputSinkMessageHandler(UINT const message, WPAR
void NonClientIslandWindow::_ResizeDragBarWindow() noexcept
{
const til::rectangle rect{ _GetDragAreaRect() };
const til::rectangle windowRect{ GetWindowRect() };
int remainderOfWindow = windowRect.width<int>() - rect.left<int>();
if (_IsTitlebarVisible() && rect.size().area() > 0)
{
SetWindowPos(_dragBarWindow.get(),
HWND_TOP,
rect.left<int>(),
rect.left<int>(), // 0,
rect.top<int>() + _GetTopBorderHeight(),
rect.width<int>(),
remainderOfWindow, // rect.width<int>(), // windowRect.width<int>(),
rect.height<int>(),
SWP_NOACTIVATE | SWP_SHOWWINDOW);
SetLayeredWindowAttributes(_dragBarWindow.get(), 0, 255, LWA_ALPHA);
@ -588,6 +622,7 @@ int NonClientIslandWindow::_GetResizeHandleHeight() const noexcept
}
return HTCAPTION;
// return HTTRANSPARENT;
}
// Method Description: