mirror of
https://github.com/kunkundi/crossdesk.git
synced 2026-04-05 01:05:18 +08:00
Compare commits
2 Commits
e4d530d044
...
ee08b231db
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee08b231db | ||
|
|
619e54dc0e |
@@ -7,18 +7,18 @@
|
|||||||
#ifndef _WINDOW_UTIL_MAC_H_
|
#ifndef _WINDOW_UTIL_MAC_H_
|
||||||
#define _WINDOW_UTIL_MAC_H_
|
#define _WINDOW_UTIL_MAC_H_
|
||||||
|
|
||||||
namespace crossdesk {
|
|
||||||
|
|
||||||
struct SDL_Window;
|
struct SDL_Window;
|
||||||
|
|
||||||
|
namespace crossdesk {
|
||||||
|
|
||||||
// Best-effort: keep an SDL window above normal windows on macOS.
|
// Best-effort: keep an SDL window above normal windows on macOS.
|
||||||
// No-op on non-macOS builds.
|
// No-op on non-macOS builds.
|
||||||
void MacSetWindowAlwaysOnTop(SDL_Window* window, bool always_on_top);
|
void MacSetWindowAlwaysOnTop(::SDL_Window* window, bool always_on_top);
|
||||||
|
|
||||||
// Best-effort: exclude an SDL window from the Window menu and window cycling.
|
// Best-effort: exclude an SDL window from the Window menu and window cycling.
|
||||||
// Note: Cmd-Tab switches apps (not individual windows), so this primarily
|
// Note: Cmd-Tab switches apps (not individual windows), so this primarily
|
||||||
// affects the Window menu and Cmd-` window cycling.
|
// affects the Window menu and Cmd-` window cycling.
|
||||||
void MacSetWindowExcludedFromWindowMenu(SDL_Window* window, bool excluded);
|
void MacSetWindowExcludedFromWindowMenu(::SDL_Window* window, bool excluded);
|
||||||
|
|
||||||
} // namespace crossdesk
|
} // namespace crossdesk
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
namespace crossdesk {
|
namespace crossdesk {
|
||||||
|
|
||||||
static NSWindow* GetNSWindowFromSDL(SDL_Window* window) {
|
static NSWindow* GetNSWindowFromSDL(::SDL_Window* window) {
|
||||||
if (!window) {
|
if (!window) {
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@ static NSWindow* GetNSWindowFromSDL(SDL_Window* window) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacSetWindowAlwaysOnTop(SDL_Window* window, bool always_on_top) {
|
void MacSetWindowAlwaysOnTop(::SDL_Window* window, bool always_on_top) {
|
||||||
NSWindow* ns_window = GetNSWindowFromSDL(window);
|
NSWindow* ns_window = GetNSWindowFromSDL(window);
|
||||||
if (!ns_window) {
|
if (!ns_window) {
|
||||||
(void)always_on_top;
|
(void)always_on_top;
|
||||||
@@ -44,7 +44,7 @@ void MacSetWindowAlwaysOnTop(SDL_Window* window, bool always_on_top) {
|
|||||||
[ns_window setCollectionBehavior:behavior];
|
[ns_window setCollectionBehavior:behavior];
|
||||||
}
|
}
|
||||||
|
|
||||||
void MacSetWindowExcludedFromWindowMenu(SDL_Window* window, bool excluded) {
|
void MacSetWindowExcludedFromWindowMenu(::SDL_Window* window, bool excluded) {
|
||||||
NSWindow* ns_window = GetNSWindowFromSDL(window);
|
NSWindow* ns_window = GetNSWindowFromSDL(window);
|
||||||
if (!ns_window) {
|
if (!ns_window) {
|
||||||
(void)excluded;
|
(void)excluded;
|
||||||
|
|||||||
@@ -948,6 +948,12 @@ int Render::CreateMainWindow() {
|
|||||||
main_window_height_ = (int)(main_window_height_default_ * dpi_scale_);
|
main_window_height_ = (int)(main_window_height_default_ * dpi_scale_);
|
||||||
stream_window_width_ = (int)(stream_window_width_default_ * dpi_scale_);
|
stream_window_width_ = (int)(stream_window_width_default_ * dpi_scale_);
|
||||||
stream_window_height_ = (int)(stream_window_height_default_ * dpi_scale_);
|
stream_window_height_ = (int)(stream_window_height_default_ * dpi_scale_);
|
||||||
|
server_window_width_ = (int)(server_window_width_default_ * dpi_scale_);
|
||||||
|
server_window_height_ = (int)(server_window_height_default_ * dpi_scale_);
|
||||||
|
server_window_normal_width_ =
|
||||||
|
(int)(server_window_width_default_ * dpi_scale_);
|
||||||
|
server_window_normal_height_ =
|
||||||
|
(int)(server_window_height_default_ * dpi_scale_);
|
||||||
|
|
||||||
SDL_SetWindowSize(main_window_, (int)main_window_width_,
|
SDL_SetWindowSize(main_window_, (int)main_window_width_,
|
||||||
(int)main_window_height_);
|
(int)main_window_height_);
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ int Render::ServerWindow() {
|
|||||||
ImGuiWindowFlags_NoScrollbar |
|
ImGuiWindowFlags_NoScrollbar |
|
||||||
ImGuiWindowFlags_NoScrollWithMouse);
|
ImGuiWindowFlags_NoScrollWithMouse);
|
||||||
|
|
||||||
|
server_window_title_bar_height_ = title_bar_height_;
|
||||||
|
|
||||||
ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
|
ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(1.0f, 1.0f, 1.0f, 1.0f));
|
||||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||||
ImGui::SetNextWindowPos(ImVec2(0, 0), ImGuiCond_Always);
|
ImGui::SetNextWindowPos(ImVec2(0, 0), ImGuiCond_Always);
|
||||||
|
|||||||
Reference in New Issue
Block a user