Browse Source

UI: Refuse drop operations from our own widgets

The UI feedback when dropping scene / source items on other parts of the
program indicated that something would happen instead of showing the
"no drop" icon.
Richard Stanway 5 years ago
parent
commit
a43c10b173
1 changed files with 6 additions and 0 deletions
  1. 6 0
      UI/window-basic-main-dropfiles.cpp

+ 6 - 0
UI/window-basic-main-dropfiles.cpp

@@ -169,6 +169,12 @@ void OBSBasic::AddDropSource(const char *data, DropType image)
 
 void OBSBasic::dragEnterEvent(QDragEnterEvent *event)
 {
+	// refuse drops of our own widgets
+	if (event->source() != nullptr) {
+		event->setDropAction(Qt::IgnoreAction);
+		return;
+	}
+
 	event->acceptProposedAction();
 }