Skip to content

Commit 87cade6

Browse files
committed
Catching drag events outside of the window.
1 parent 65fceb1 commit 87cade6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Source/DFPSR/implementation/gui/DsrWindow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ void DsrWindow::sendMouseEvent(const MouseEvent& event) {
163163
MouseEvent scaledEvent = event / this->pixelScale;
164164
// Send the global event
165165
this->callback_windowMouseEvent(scaledEvent);
166-
if (this->mainPanel->getVisible() && this->mainPanel->pointIsInside(scaledEvent.position)) {
166+
// To pass the event to the main panel, the panel has to be visible with the cursor inside of it,
167+
// unless it is a drag move or button release in which the event should never be blocked.
168+
if ((this->mainPanel->getVisible() && this->mainPanel->pointIsInside(scaledEvent.position)) || event.mouseEventType == MouseEventType::MouseUp || this->mainPanel->holdCount > 0) {
167169
// In case of the root panel not covering the entire window, adjust input coordinates to the panel's local system.
168170
scaledEvent.position -= this->mainPanel->location.upperLeft();
169171
// Send to the main panel and its components

0 commit comments

Comments
 (0)