mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-06-11 01:44:50 +08:00
[fix] fix rendering issues in stream and server windows when the main window is minimized
This commit is contained in:
+1
-12
@@ -1103,29 +1103,18 @@ int Render::CreateServerWindow() {
|
||||
}
|
||||
|
||||
#if _WIN32
|
||||
// Hide server window from the taskbar by making it an owned tool window.
|
||||
// Hide server window from the taskbar by making it a tool window.
|
||||
{
|
||||
SDL_PropertiesID server_props = SDL_GetWindowProperties(server_window_);
|
||||
HWND server_hwnd = (HWND)SDL_GetPointerProperty(
|
||||
server_props, SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
|
||||
|
||||
HWND owner_hwnd = nullptr;
|
||||
if (main_window_) {
|
||||
SDL_PropertiesID main_props = SDL_GetWindowProperties(main_window_);
|
||||
owner_hwnd = (HWND)SDL_GetPointerProperty(
|
||||
main_props, SDL_PROP_WINDOW_WIN32_HWND_POINTER, NULL);
|
||||
}
|
||||
|
||||
if (server_hwnd) {
|
||||
LONG_PTR ex_style = GetWindowLongPtr(server_hwnd, GWL_EXSTYLE);
|
||||
ex_style |= WS_EX_TOOLWINDOW;
|
||||
ex_style &= ~WS_EX_APPWINDOW;
|
||||
SetWindowLongPtr(server_hwnd, GWL_EXSTYLE, ex_style);
|
||||
|
||||
if (owner_hwnd) {
|
||||
SetWindowLongPtr(server_hwnd, GWLP_HWNDPARENT, (LONG_PTR)owner_hwnd);
|
||||
}
|
||||
|
||||
// Keep the server window above normal windows.
|
||||
SetWindowPos(server_hwnd, HWND_TOPMOST, 0, 0, 0, 0,
|
||||
SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE);
|
||||
|
||||
Reference in New Issue
Block a user