mirror of https://github.com/stella-emu/stella.git
Fixed error with maximize button appearing in the app title bar
in Linux/UNIX. This bug has been present since 3.2; too bad I didn't find it 24 hours ago, as it could have been included in 3.9. Bumped version #, and starting all over again ... git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2762 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
daf2691ac7
commit
54a9a2d61d
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
|
||||||
#define STELLA_VERSION "3.9"
|
#define STELLA_VERSION "3.10_pre"
|
||||||
#define STELLA_BUILD atoi("$Rev$" + 6)
|
#define STELLA_BUILD atoi("$Rev$" + 6)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -53,27 +53,30 @@ OSystemUNIX::~OSystemUNIX()
|
||||||
void OSystemUNIX::setAppWindowPos(int x, int y, int, int)
|
void OSystemUNIX::setAppWindowPos(int x, int y, int, int)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_X11)
|
#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;
|
SDL_SysWMinfo sdl_info;
|
||||||
memset(&sdl_info, 0, sizeof(sdl_info));
|
memset(&sdl_info, 0, sizeof(sdl_info));
|
||||||
|
|
||||||
SDL_VERSION (&sdl_info.version);
|
SDL_VERSION (&sdl_info.version);
|
||||||
if(SDL_GetWMInfo(&sdl_info) > 0 && sdl_info.subsystem == SDL_SYSWM_X11)
|
if(SDL_GetWMInfo(&sdl_info) > 0 && sdl_info.subsystem == SDL_SYSWM_X11)
|
||||||
{
|
|
||||||
XSizeHints* hints = XAllocSizeHints();
|
|
||||||
if(hints)
|
|
||||||
{
|
{
|
||||||
Display* display = sdl_info.info.x11.display;
|
Display* display = sdl_info.info.x11.display;
|
||||||
Window window = sdl_info.info.x11.wmwindow;
|
Window window = sdl_info.info.x11.wmwindow;
|
||||||
hints->flags |= USPosition;
|
XSizeHints hints;
|
||||||
hints->x = x;
|
long supplied_return;
|
||||||
hints->y = y;
|
XGetWMNormalHints(display, window, &hints, &supplied_return);
|
||||||
XMoveWindow(display, window, hints->x, hints->y);
|
|
||||||
|
|
||||||
/* Flush the resize event so we don't catch it later */
|
// 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);
|
XSync(display, True);
|
||||||
XSetWMNormalHints(display, window, hints);
|
XSetWMNormalHints(display, window, &hints);
|
||||||
XFree(hints);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue