diff --git a/src/common/Version.hxx b/src/common/Version.hxx index cde90fccc..9a24d6312 100644 --- a/src/common/Version.hxx +++ b/src/common/Version.hxx @@ -22,7 +22,7 @@ #include -#define STELLA_VERSION "3.9" +#define STELLA_VERSION "3.10_pre" #define STELLA_BUILD atoi("$Rev$" + 6) #endif diff --git a/src/unix/OSystemUNIX.cxx b/src/unix/OSystemUNIX.cxx index 07b2f5f21..b11dfca42 100644 --- a/src/unix/OSystemUNIX.cxx +++ b/src/unix/OSystemUNIX.cxx @@ -53,27 +53,30 @@ OSystemUNIX::~OSystemUNIX() void OSystemUNIX::setAppWindowPos(int x, int y, int, int) { #if defined(HAVE_X11) + // TODO: This functionality is deprecated, since the x/y fields + // of XSizeHints are obsolete. SDL2 will provide native methods + // for app centering (which is all this is currently used for). + SDL_SysWMinfo sdl_info; memset(&sdl_info, 0, sizeof(sdl_info)); SDL_VERSION (&sdl_info.version); if(SDL_GetWMInfo(&sdl_info) > 0 && sdl_info.subsystem == SDL_SYSWM_X11) { - XSizeHints* hints = XAllocSizeHints(); - if(hints) - { - Display* display = sdl_info.info.x11.display; - Window window = sdl_info.info.x11.wmwindow; - hints->flags |= USPosition; - hints->x = x; - hints->y = y; - XMoveWindow(display, window, hints->x, hints->y); + Display* display = sdl_info.info.x11.display; + Window window = sdl_info.info.x11.wmwindow; + XSizeHints hints; + long supplied_return; + XGetWMNormalHints(display, window, &hints, &supplied_return); - /* Flush the resize event so we don't catch it later */ - XSync(display, True); - XSetWMNormalHints(display, window, hints); - XFree(hints); - } + // Change X/Y position + hints.x = x; + hints.y = y; + XMoveWindow(display, window, hints.x, hints.y); + + // Flush the resize event so we don't catch it later + XSync(display, True); + XSetWMNormalHints(display, window, &hints); } #endif }