mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-27 15:44:12 +08:00
.
This commit is contained in:
parent
9b5a1d872a
commit
696de614ac
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
set(VERSION_MAJOR 6)
|
set(VERSION_MAJOR 6)
|
||||||
set(VERSION_MINOR 8)
|
set(VERSION_MINOR 8)
|
||||||
set(VERSION_PATCH 2)
|
set(VERSION_PATCH 3)
|
||||||
set(VERSION_REVISION 0)
|
set(VERSION_REVISION 0)
|
||||||
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
|
set(LUNA_VERSION "{${VERSION_MAJOR},${VERSION_MINOR},${VERSION_PATCH},${VERSION_REVISION}}")
|
||||||
add_library(VERSION_DEF ${CMAKE_CURRENT_LIST_DIR}/version_def.cpp)
|
add_library(VERSION_DEF ${CMAKE_CURRENT_LIST_DIR}/version_def.cpp)
|
||||||
|
@ -139,3 +139,19 @@ DECLARE_API UINT GetMonitorDpiScaling(HWND hwnd)
|
|||||||
return dpiX;
|
return dpiX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DECLARE_API bool check_window_viewable(HWND hwnd)
|
||||||
|
{
|
||||||
|
RECT windowRect;
|
||||||
|
if (!GetWindowRect(hwnd, &windowRect))
|
||||||
|
return false;
|
||||||
|
HMONITOR hMonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
|
||||||
|
if (!hMonitor)
|
||||||
|
return false;
|
||||||
|
MONITORINFO monitorInfo;
|
||||||
|
monitorInfo.cbSize = sizeof(MONITORINFO);
|
||||||
|
if (!GetMonitorInfo(hMonitor, &monitorInfo))
|
||||||
|
return false;
|
||||||
|
RECT _;
|
||||||
|
return IntersectRect(&_, &windowRect, &monitorInfo.rcWork);
|
||||||
|
}
|
@ -297,6 +297,9 @@ class TranslatorWindow(resizableframeless):
|
|||||||
if not rect:
|
if not rect:
|
||||||
lastpos = None
|
lastpos = None
|
||||||
continue
|
continue
|
||||||
|
if not winsharedutils.check_window_viewable(hwnd):
|
||||||
|
lastpos = None
|
||||||
|
continue
|
||||||
rate = self.devicePixelRatioF()
|
rate = self.devicePixelRatioF()
|
||||||
rect = QRect(
|
rect = QRect(
|
||||||
int(rect[0] / rate),
|
int(rect[0] / rate),
|
||||||
|
@ -356,3 +356,7 @@ StartCaptureAsync.argtypes = (StartCaptureAsync_cb,)
|
|||||||
StartCaptureAsync.restype = HANDLE
|
StartCaptureAsync.restype = HANDLE
|
||||||
StopCaptureAsync = utilsdll.StopCaptureAsync
|
StopCaptureAsync = utilsdll.StopCaptureAsync
|
||||||
StopCaptureAsync.argtypes = (HANDLE,)
|
StopCaptureAsync.argtypes = (HANDLE,)
|
||||||
|
|
||||||
|
check_window_viewable = utilsdll.check_window_viewable
|
||||||
|
check_window_viewable.argtypes = (HWND,)
|
||||||
|
check_window_viewable.restype = c_bool
|
||||||
|
Loading…
x
Reference in New Issue
Block a user