Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add testcase showing wShowWindow behavior in Windows #11129

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

learn-more
Copy link

This is a testcase for #9434.
It shows that a process does not control all aspects of the initial window it creates.
(As-is there is no workaround provided yet, so the testcase fails)

Description

The initial window created in a process is influenced by the wShowWindow flag passed in to CreateProcess.:

STARTUPINFOA si = { sizeof(si) };
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_MAXIMIZE;

This is used in the shell to provide the 'Minimized', 'Maximized' etc dropdown on shortcuts.

@learn-more learn-more marked this pull request as ready for review October 8, 2024 20:17
/* The child process exits with code '1' when the window is minimized / maximized */
DWORD exit_code = 0;
GetExitCodeProcess(pi.hProcess, &exit_code);
SDLTest_AssertCheck(exit_code == 0, "Child process failed with code %d!", exit_code);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SDLTest_AssertCheck(exit_code == 0, "Child process failed with code %d!", exit_code);
SDLTest_AssertCheck(exit_code == 0, "Child process failed with code %lu", exit_code);

including commercial applications, and to alter it and redistribute it
freely.
*/
/* Sample program: Test SDL's ability to defuse the window state (minimized/maximized) that is applied on the initial window created. */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please note what bug this is a test case for.

}

if (consumed <= 0) {
static const char *options[] = { NULL };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it shows in --help.

Suggested change
static const char *options[] = { NULL };
static const char *options[] = { "--child-spawn-dialog", NULL };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants