Skip to content
Snippets Groups Projects
Commit e2f5762b authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Don't allow ALT-Direction to work when maximized

With maximized windows, unexpected behaviour occured when the program
resized itself, then the window manager minimized/restored the window
Should address SF bugs #18 and #13
parent f4d43d13
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1525 passed
...@@ -824,6 +824,9 @@ void sdl_video_event_thread(void *data) ...@@ -824,6 +824,9 @@ void sdl_video_event_thread(void *data)
ev.key.keysym.sym == SDLK_UP || ev.key.keysym.sym == SDLK_UP ||
ev.key.keysym.sym == SDLK_DOWN)) { ev.key.keysym.sym == SDLK_DOWN)) {
int w, h; int w, h;
// Don't allow ALT-DIR to change size when maximized...
if ((sdl.GetWindowFlags(win) & SDL_WINDOW_MAXIMIZED) == 0) {
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
w = cvstat.winwidth; w = cvstat.winwidth;
h = cvstat.winheight; h = cvstat.winheight;
...@@ -871,6 +874,7 @@ void sdl_video_event_thread(void *data) ...@@ -871,6 +874,7 @@ void sdl_video_event_thread(void *data)
cvstat.winheight = h; cvstat.winheight = h;
} }
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
}
break; break;
} }
} }
......
...@@ -198,6 +198,10 @@ int load_sdl_funcs(struct sdlfuncs *sdlf) ...@@ -198,6 +198,10 @@ int load_sdl_funcs(struct sdlfuncs *sdlf)
xp_dlclose(sdl_dll); xp_dlclose(sdl_dll);
return(-1); return(-1);
} }
if((sdlf->GetWindowFlags=xp_dlsym(sdl_dll, SDL_GetWindowFlags))==NULL) {
xp_dlclose(sdl_dll);
return(-1);
}
#ifndef STATIC_SDL #ifndef STATIC_SDL
{ {
int (HACK_HACK_HACK *ra)(char *name, Uint32 style, void *hInst); int (HACK_HACK_HACK *ra)(char *name, Uint32 style, void *hInst);
......
...@@ -55,6 +55,7 @@ struct sdlfuncs { ...@@ -55,6 +55,7 @@ struct sdlfuncs {
void (HACK_HACK_HACK *SetCursor) (SDL_Cursor *curs); void (HACK_HACK_HACK *SetCursor) (SDL_Cursor *curs);
void (HACK_HACK_HACK *FreeCursor) (SDL_Cursor *curs); void (HACK_HACK_HACK *FreeCursor) (SDL_Cursor *curs);
void(HACK_HACK_HACK *free) (void *); void(HACK_HACK_HACK *free) (void *);
Uint32(HACK_HACK_HACK *GetWindowFlags) (SDL_Window * window);
int gotfuncs; int gotfuncs;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment