forked from github_mirror/framelesshelper
Remove unnecessary cast to QWidget.
TO BE VARIFIED! Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
5fe936f631
commit
1822333268
|
@ -1139,16 +1139,6 @@ void updateQtFrame_internal(const HWND handle, const bool resetToDefault = false
|
||||||
? 0
|
? 0
|
||||||
: WinNativeEventFilter::getSystemMetric(
|
: WinNativeEventFilter::getSystemMetric(
|
||||||
handle, WinNativeEventFilter::SystemMetric::TitleBarHeight, true);
|
handle, WinNativeEventFilter::SystemMetric::TitleBarHeight, true);
|
||||||
#ifdef QT_WIDGETS_LIB
|
|
||||||
const QWidget *widget = QWidget::find(reinterpret_cast<WId>(handle));
|
|
||||||
if (widget && widget->isTopLevel()) {
|
|
||||||
QWindow *window = widget->windowHandle();
|
|
||||||
if (window) {
|
|
||||||
WinNativeEventFilter::updateQtFrame(window, tbh);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
QWindow *window = findQWindowFromRawHandle(handle);
|
QWindow *window = findQWindowFromRawHandle(handle);
|
||||||
if (window) {
|
if (window) {
|
||||||
WinNativeEventFilter::updateQtFrame(window, tbh);
|
WinNativeEventFilter::updateQtFrame(window, tbh);
|
||||||
|
@ -1181,25 +1171,10 @@ QString getCurrentScreenIdentifier(const HWND handle)
|
||||||
Q_ASSERT(handle);
|
Q_ASSERT(handle);
|
||||||
if (WNEF_EXECUTE_WINAPI_RETURN(IsWindow, FALSE, handle)) {
|
if (WNEF_EXECUTE_WINAPI_RETURN(IsWindow, FALSE, handle)) {
|
||||||
QScreen *currentScreen = nullptr;
|
QScreen *currentScreen = nullptr;
|
||||||
#ifdef QT_WIDGETS_LIB
|
|
||||||
const QWidget *widget = QWidget::find(reinterpret_cast<WId>(handle));
|
|
||||||
if (widget && widget->isTopLevel()) {
|
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
|
||||||
currentScreen = widget->screen();
|
|
||||||
#else
|
|
||||||
QWindow *window = widget->windowHandle();
|
|
||||||
if (window) {
|
|
||||||
currentScreen = window->screen();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (!currentScreen) {
|
|
||||||
const QWindow *window = findQWindowFromRawHandle(handle);
|
const QWindow *window = findQWindowFromRawHandle(handle);
|
||||||
if (window) {
|
if (window) {
|
||||||
currentScreen = window->screen();
|
currentScreen = window->screen();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (currentScreen) {
|
if (currentScreen) {
|
||||||
const QString sn = currentScreen->serialNumber().toUpper();
|
const QString sn = currentScreen->serialNumber().toUpper();
|
||||||
return sn.isEmpty() ? currentScreen->name().toUpper() : sn;
|
return sn.isEmpty() ? currentScreen->name().toUpper() : sn;
|
||||||
|
|
Loading…
Reference in New Issue