Fix Linux/X11 again

This commit is contained in:
Jonathan Campbell
2020-12-24 23:14:10 -08:00
parent aefc65ade1
commit 6594ce7bc1
2 changed files with 20 additions and 14 deletions

View File

@@ -1,8 +1,8 @@
0.83.9
- Linux/X11 SDL1 support, on XWindow resize, now
sets window manager hints BEFORE moving and
positioning the window. This fixes window resizing
problems with XFCE 4.14 and it's window manager.
- Linux/X11 SDL1 builds: Combine window move/resize
into one call if possible, and not during window
manager hints, to avoid resize problems with
XFCE 4.14
- Added menu option "Create blank disk images..."
(under "DOS" menu) to create blank floppy or hard
disk images of a common disk size, including 360KB,

View File

@@ -1043,19 +1043,21 @@ static int X11_CreateWindow(_THIS, SDL_Surface *screen,
/* resize the (possibly new) window manager window */
if( !SDL_windowid ) {
int x,y;
int x = -999,y = -999;
X11_SetSizeHints(this, w, h, flags);
window_w = w;
window_h = h;
/* Center it, if desired */
if ( X11_WindowPosition(this, &x, &y, w, h) ) {
XMoveWindow(SDL_Display, WMWindow, x, y);
}
if (!X11_WindowPosition(this, &x, &y, w, h))
x = y = -999;
XResizeWindow(SDL_Display, WMwindow, w, h);
}
if (x > -999 && y > -999)
XMoveResizeWindow(SDL_Display, WMwindow, x, y, w, h);
else
XResizeWindow(SDL_Display, WMwindow, w, h);
}
/* Create (or use) the X11 display window */
if ( !SDL_windowid ) {
@@ -1157,7 +1159,7 @@ static int X11_CreateWindow(_THIS, SDL_Surface *screen,
static int X11_ResizeWindow(_THIS,
SDL_Surface *screen, int w, int h, Uint32 flags)
{
int x,y;
int x = -999,y = -999;
if ( ! SDL_windowid ) {
/* Resize the window manager window */
@@ -1166,9 +1168,13 @@ static int X11_ResizeWindow(_THIS,
window_h = h;
/* Center it, if desired */
if ( X11_WindowPosition(this, &x, &y, w, h) ) {
XMoveWindow(SDL_Display, WMWindow, x, y);
}
if (!X11_WindowPosition(this, &x, &y, w, h))
x = y = -999;
if (x > -999 && y > -999)
XMoveResizeWindow(SDL_Display, WMwindow, x, y, w, h);
else
XResizeWindow(SDL_Display, WMwindow, w, h);
if ((flags & SDL_HAX_NORESIZEWINDOW) && (flags & SDL_FULLSCREEN) == 0 && (screen->flags & SDL_FULLSCREEN) == 0) {
/* do nothing */