From b932a5a45f86add0cdfca66be71bba585b338588 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Sun, 15 Apr 2012 03:20:39 -0400 Subject: [PATCH] Fix bug #8004 Dragging the Deskbar with CTRL+ALT+mouse not possible with Auto-raise and Auto-hide disabled. The reason this only worked with auto-raise or auto-hide enabled is because the EventMask on BarView was only set to received mouse events when those were settings were enabled. Apparently someone figured this out. So, to fix this bug I set BarView to always accept mouse events. Doesn't appear to have any obvious negative consequences. Auto-hide and auto-raise still work. I also added a comment in BarWindow::MenusBeginning(). It is setting the EventMask of BarView to 0 and then back again in TBarWindow::MenusEnded() to get around a bug in BeOS (according to the comment anyway). I took out those lines and didn't notice anything different so I assume that whatever the bug was it is fixed and now and we can take those lines out permenantly. --- src/apps/deskbar/BarApp.cpp | 4 ---- src/apps/deskbar/BarView.cpp | 8 ++++++-- src/apps/deskbar/BarWindow.cpp | 5 ++++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/apps/deskbar/BarApp.cpp b/src/apps/deskbar/BarApp.cpp index e6ffbdf7c2..e31c6f12cb 100644 --- a/src/apps/deskbar/BarApp.cpp +++ b/src/apps/deskbar/BarApp.cpp @@ -509,10 +509,6 @@ TBarApp::MessageReceived(BMessage* message) case kAutoRaise: fSettings.autoRaise = fSettings.alwaysOnTop ? false : !fSettings.autoRaise; - - fBarWindow->Lock(); - fBarView->UpdateEventMask(); - fBarWindow->Unlock(); break; case kAutoHide: diff --git a/src/apps/deskbar/BarView.cpp b/src/apps/deskbar/BarView.cpp index fa7cbb5310..2fe13a6e06 100644 --- a/src/apps/deskbar/BarView.cpp +++ b/src/apps/deskbar/BarView.cpp @@ -510,11 +510,15 @@ TBarView::SaveSettings() void TBarView::UpdateEventMask() { - if (((TBarApp*)be_app)->Settings()->autoRaise - || ((TBarApp*)be_app)->Settings()->autoHide) + SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY); + +#if 0 + desk_settings* settings = ((TBarApp*)be_app)->Settings(); + if (settings->autoRaise || settings->autoHide) SetEventMask(B_POINTER_EVENTS, B_NO_POINTER_HISTORY); else SetEventMask(0); +#endif } diff --git a/src/apps/deskbar/BarWindow.cpp b/src/apps/deskbar/BarWindow.cpp index e60a4de33e..6a3f61192f 100644 --- a/src/apps/deskbar/BarWindow.cpp +++ b/src/apps/deskbar/BarWindow.cpp @@ -142,7 +142,10 @@ TBarWindow::MenusBeginning() fBarView->SetEventMask(0); // This works around a BeOS bug - the menu is quit with every - // B_MOUSE_DOWN the window receives... + // B_MOUSE_DOWN the window receives. + // + // Is this bug still here? I commented this line out and didn't + // notice anything different BWindow::MenusBeginning(); }