Skip to content
Snippets Groups Projects
Commit 688af466 authored by John Bradley's avatar John Bradley
Browse files

Remove interaction event filter in destructor

QT fakes a mouse move when destructing which is
caught by our filter
parent c1da19e8
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,8 @@ OBSBasicInteraction::OBSBasicInteraction(QWidget *parent, OBSSource source_)
ui->preview->setMouseTracking(true);
ui->preview->setFocusPolicy(Qt::StrongFocus);
ui->preview->installEventFilter(BuildEventFilter());
eventFilter = BuildEventFilter();
ui->preview->installEventFilter(eventFilter);
if (cx > 400 && cy > 400)
resize(cx, cy);
......@@ -63,6 +64,14 @@ OBSBasicInteraction::OBSBasicInteraction(QWidget *parent, OBSSource source_)
setWindowTitle(QTStr("Basic.InteractionWindow").arg(QT_UTF8(name)));
}
OBSBasicInteraction::~OBSBasicInteraction()
{
// since QT fakes a mouse movement while destructing a widget
// remove our event filter
ui->preview->removeEventFilter(eventFilter);
delete eventFilter;
}
OBSEventFilter *OBSBasicInteraction::BuildEventFilter()
{
return new OBSEventFilter(
......
......@@ -42,6 +42,7 @@ private:
OBSSource source;
OBSDisplay display;
OBSSignal removedSignal;
OBSEventFilter *eventFilter;
static void SourceRemoved(void *data, calldata_t params);
static void DrawPreview(void *data, uint32_t cx, uint32_t cy);
......@@ -61,6 +62,7 @@ private slots:
public:
OBSBasicInteraction(QWidget *parent, OBSSource source_);
~OBSBasicInteraction();
void Init();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment