mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
Fix crash with fcitx and custom titlebar
This commit is contained in:
parent
9b59e74d66
commit
834ee4eae7
1 changed files with 4 additions and 3 deletions
|
@ -248,7 +248,8 @@ void TitleWidgetQt::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
bool TitleWidgetQt::eventFilter(QObject *obj, QEvent *e) {
|
bool TitleWidgetQt::eventFilter(QObject *obj, QEvent *e) {
|
||||||
if (e->type() == QEvent::MouseMove
|
if (e->type() == QEvent::MouseMove
|
||||||
|| e->type() == QEvent::MouseButtonPress) {
|
|| e->type() == QEvent::MouseButtonPress) {
|
||||||
if (window()->isAncestorOf(static_cast<QWidget*>(obj))) {
|
if (obj->isWidgetType()
|
||||||
|
&& window()->isAncestorOf(static_cast<QWidget*>(obj))) {
|
||||||
const auto mouseEvent = static_cast<QMouseEvent*>(e);
|
const auto mouseEvent = static_cast<QMouseEvent*>(e);
|
||||||
const auto currentPoint = mouseEvent->windowPos().toPoint();
|
const auto currentPoint = mouseEvent->windowPos().toPoint();
|
||||||
const auto edges = edgesFromPos(currentPoint);
|
const auto edges = edgesFromPos(currentPoint);
|
||||||
|
@ -277,12 +278,12 @@ bool TitleWidgetQt::eventFilter(QObject *obj, QEvent *e) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (e->type() == QEvent::Leave) {
|
} else if (e->type() == QEvent::Leave) {
|
||||||
if (window() == static_cast<QWidget*>(obj)) {
|
if (obj->isWidgetType() && window() == static_cast<QWidget*>(obj)) {
|
||||||
restoreCursor();
|
restoreCursor();
|
||||||
}
|
}
|
||||||
} else if (e->type() == QEvent::Move
|
} else if (e->type() == QEvent::Move
|
||||||
|| e->type() == QEvent::Resize) {
|
|| e->type() == QEvent::Resize) {
|
||||||
if (window() == static_cast<QWidget*>(obj)) {
|
if (obj->isWidgetType() && window() == static_cast<QWidget*>(obj)) {
|
||||||
updateWindowExtents();
|
updateWindowExtents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue