mirror of
https://github.com/glfw/glfw.git
synced 2026-08-29 03:04:14 +02:00
@@ -412,6 +412,7 @@ struct _GLFWwndconfig
|
||||
} x11;
|
||||
struct {
|
||||
GLFWbool keymenu;
|
||||
GLFWbool showDefault;
|
||||
} win32;
|
||||
struct {
|
||||
char appId[256];
|
||||
|
||||
@@ -424,6 +424,7 @@ typedef struct _GLFWwindowWin32
|
||||
GLFWbool transparent;
|
||||
GLFWbool scaleToMonitor;
|
||||
GLFWbool keymenu;
|
||||
GLFWbool showDefault;
|
||||
|
||||
// Cached size used to filter out duplicate events
|
||||
int width, height;
|
||||
|
||||
@@ -1390,6 +1390,7 @@ static int createNativeWindow(_GLFWwindow* window,
|
||||
|
||||
window->win32.scaleToMonitor = wndconfig->scaleToMonitor;
|
||||
window->win32.keymenu = wndconfig->win32.keymenu;
|
||||
window->win32.showDefault = wndconfig->win32.showDefault;
|
||||
|
||||
if (!window->monitor)
|
||||
{
|
||||
@@ -1772,7 +1773,23 @@ void _glfwMaximizeWindowWin32(_GLFWwindow* window)
|
||||
|
||||
void _glfwShowWindowWin32(_GLFWwindow* window)
|
||||
{
|
||||
ShowWindow(window->win32.handle, SW_SHOWNA);
|
||||
int showCommand = SW_SHOWNA;
|
||||
|
||||
if (window->win32.showDefault)
|
||||
{
|
||||
// NOTE: GLFW windows currently do not seem to match the Windows 10 definition of
|
||||
// a main window, so even SW_SHOWDEFAULT does nothing
|
||||
// This definition is undocumented and can change (source: Raymond Chen)
|
||||
// HACK: Apply the STARTUPINFO show command manually if available
|
||||
STARTUPINFOW si = { sizeof(si) };
|
||||
GetStartupInfoW(&si);
|
||||
if (si.dwFlags & STARTF_USESHOWWINDOW)
|
||||
showCommand = si.wShowWindow;
|
||||
|
||||
window->win32.showDefault = GLFW_FALSE;
|
||||
}
|
||||
|
||||
ShowWindow(window->win32.handle, showCommand);
|
||||
}
|
||||
|
||||
void _glfwHideWindowWin32(_GLFWwindow* window)
|
||||
|
||||
@@ -380,6 +380,9 @@ GLFWAPI void glfwWindowHint(int hint, int value)
|
||||
case GLFW_WIN32_KEYBOARD_MENU:
|
||||
_glfw.hints.window.win32.keymenu = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
return;
|
||||
case GLFW_WIN32_SHOWDEFAULT:
|
||||
_glfw.hints.window.win32.showDefault = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
return;
|
||||
case GLFW_COCOA_GRAPHICS_SWITCHING:
|
||||
_glfw.hints.context.nsgl.offline = value ? GLFW_TRUE : GLFW_FALSE;
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user