mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
Remove interaction event filter in destructor
QT fakes a mouse move when destructing which is caught by our filter
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user