Merge commit '3a7f96fd99528968c39b5be81db067ca018d432b' into dev
This commit is contained in:
27
external/SDL/test/testmodal.c
vendored
27
external/SDL/test/testmodal.c
vendored
@@ -31,9 +31,6 @@ int main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Enable standard application logging */
|
||||
SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
|
||||
|
||||
/* Parse commandline */
|
||||
for (i = 1; i < argc;) {
|
||||
int consumed;
|
||||
@@ -66,8 +63,10 @@ int main(int argc, char *argv[])
|
||||
goto sdl_quit;
|
||||
}
|
||||
|
||||
if (!SDL_SetWindowModalFor(w2, w1)) {
|
||||
SDL_SetWindowTitle(w2, "Modal Window");
|
||||
if (SDL_SetWindowParent(w2, w1)) {
|
||||
if (SDL_SetWindowModal(w2, true)) {
|
||||
SDL_SetWindowTitle(w2, "Modal Window");
|
||||
}
|
||||
}
|
||||
|
||||
while (1) {
|
||||
@@ -98,8 +97,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (e.key.key == SDLK_M) {
|
||||
if (!SDL_SetWindowModalFor(w2, w1)) {
|
||||
SDL_SetWindowTitle(w2, "Modal Window");
|
||||
if (SDL_SetWindowParent(w2, w2)) {
|
||||
if (SDL_SetWindowModal(w2, true)) {
|
||||
SDL_SetWindowTitle(w2, "Modal Window");
|
||||
}
|
||||
}
|
||||
}
|
||||
SDL_ShowWindow(w2);
|
||||
@@ -123,13 +124,17 @@ int main(int argc, char *argv[])
|
||||
} else if (e.key.key == SDLK_P && w2) {
|
||||
if (SDL_GetWindowFlags(w2) & SDL_WINDOW_MODAL) {
|
||||
/* Unparent the window */
|
||||
if (!SDL_SetWindowModalFor(w2, NULL)) {
|
||||
SDL_SetWindowTitle(w2, "Non-Modal Window");
|
||||
if (SDL_SetWindowModal(w2, false)) {
|
||||
if (SDL_SetWindowParent(w2, NULL)) {
|
||||
SDL_SetWindowTitle(w2, "Non-Modal Window");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Reparent the window */
|
||||
if (!SDL_SetWindowModalFor(w2, w1)) {
|
||||
SDL_SetWindowTitle(w2, "Modal Window");
|
||||
if (SDL_SetWindowParent(w2, w1)) {
|
||||
if (SDL_SetWindowModal(w2, true)) {
|
||||
SDL_SetWindowTitle(w2, "Modal Window");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user