#if TARGET_HOST_POSIX_X11
#include <limits.h> /* LONG_MAX */
+#include <unistd.h> /* usleep */
#endif
#if defined(_WIN32_WCE)
#endif
+#if TARGET_HOST_POSIX_X11
+static Bool fghWindowIsVisible( Display *display, XEvent *event, XPointer arg)
+{
+ Window window = arg;
+ return (event->type == MapNotify) && (event->xmap.window == window);
+}
+#endif
+
/*
* Opens a window. Requires a SFG_Window object created and attached
XTextProperty textProperty;
XSizeHints sizeHints;
XWMHints wmHints;
+ XEvent eventReturnBuffer; /* return buffer required for a call */
unsigned long mask;
int num_FBConfigs, i;
unsigned int current_DisplayMode = fgState.DisplayMode ;
window->Window.Context
);
+ /* register extension events _before_ window is mapped */
+ #ifdef HAVE_X11_EXTENSIONS_XINPUT2_H
+ fgRegisterDevices( fgDisplay.Display, &(window->Window.Handle) );
+ #endif
+
XMapWindow( fgDisplay.Display, window->Window.Handle );
XFree(visualInfo);
+ if( !isSubWindow)
+ XPeekIfEvent( fgDisplay.Display, &eventReturnBuffer, &fghWindowIsVisible, window->Window.Handle );
+
#elif TARGET_HOST_MS_WINDOWS
WNDCLASS wc;
/* SetWindowPos(window->Window.Handle, NULL, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); */
+ /* Enable multitouch: additional flag TWF_FINETOUCH, TWF_WANTPALM */
+ #ifdef WM_TOUCH
+ RegisterTouchWindow( window->Window.Handle, TWF_FINETOUCH | TWF_WANTPALM );
+ #endif
#if defined(_WIN32_WCE)
ShowWindow( window->Window.Handle, SW_SHOW );
*/
void fgCloseWindow( SFG_Window* window )
{
+ /* if we're in gamemode, call glutLeaveGameMode first to make sure the
+ * gamemode is properly closed before closing the window
+ */
+ if (fgStructure.GameModeWindow != NULL)
+ glutLeaveGameMode();
+
#if TARGET_HOST_POSIX_X11
if( window->Window.Context )