enable the NCCLIENT after closed a popup tool menu by timer

This commit is contained in:
dreamsourcelabTAI 2024-04-27 18:55:41 +08:00
parent 695d84961c
commit c063974900

View File

@ -22,10 +22,11 @@
#include "xtoolbutton.h"
#include <QMenu>
#include <QApplication>
#include <QTimer>
#include "../log.h"
#ifdef _WIN32
#include "winnativewidget.h"
#include "../winnativewidget.h"
#endif
namespace
@ -99,9 +100,7 @@ void XToolButton::onHidePopupMenu()
setCheckable(true);
setChecked(false);
setCheckable(false);
pv::WinNativeWidget::EnalbeNoClientArea(true);
QWidget *widgetUnderMouse = qApp->widgetAt(QCursor::pos());
if (widgetUnderMouse != this){
_is_mouse_down = false;
@ -115,5 +114,9 @@ void XToolButton::onHidePopupMenu()
disconnect(_menu, SIGNAL(aboutToHide()), this, SLOT(onHidePopupMenu()));
}
QTimer::singleShot(300, this, [this](){
pv::WinNativeWidget::EnalbeNoClientArea(true);
});
#endif
}