mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
Only initiate window title bar drags for left mouse button clicks.
This commit is contained in:
parent
db0dbbd979
commit
52e019f9aa
1 changed files with 2 additions and 2 deletions
|
@ -167,7 +167,7 @@ void WindowManager::notifyRectChanged(Window& window, const Rect& old_rect, cons
|
||||||
|
|
||||||
void WindowManager::handleTitleBarMouseEvent(Window& window, MouseEvent& event)
|
void WindowManager::handleTitleBarMouseEvent(Window& window, MouseEvent& event)
|
||||||
{
|
{
|
||||||
if (event.type() == Event::MouseDown) {
|
if (event.type() == Event::MouseDown && event.button() == MouseButton::Left) {
|
||||||
printf("[WM] Begin dragging Window{%p}\n", &window);
|
printf("[WM] Begin dragging Window{%p}\n", &window);
|
||||||
m_dragWindow = window.makeWeakPtr();;
|
m_dragWindow = window.makeWeakPtr();;
|
||||||
m_dragOrigin = event.position();
|
m_dragOrigin = event.position();
|
||||||
|
@ -180,7 +180,7 @@ void WindowManager::handleTitleBarMouseEvent(Window& window, MouseEvent& event)
|
||||||
|
|
||||||
void WindowManager::processMouseEvent(MouseEvent& event)
|
void WindowManager::processMouseEvent(MouseEvent& event)
|
||||||
{
|
{
|
||||||
if (event.type() == Event::MouseUp) {
|
if (event.type() == Event::MouseUp && event.button() == MouseButton::Left) {
|
||||||
if (m_dragWindow) {
|
if (m_dragWindow) {
|
||||||
printf("[WM] Finish dragging Window{%p}\n", m_dragWindow.ptr());
|
printf("[WM] Finish dragging Window{%p}\n", m_dragWindow.ptr());
|
||||||
invalidate(m_dragStartRect);
|
invalidate(m_dragStartRect);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue