return (!data || (event->window == (X11Window) data)) && event->type == ConfigureNotify;
}
+static X11Bool FocusInChecker(void *display, XFocusChangeEvent *event, char * data)
+{
+ X11Bool result = False;
+ if(event->type == FocusIn)
+ {
+ Window window = null;
+ XFindContext(xGlobalDisplay, event->window, windowContext, (XPointer *) &window);
+ if(window)
+ result = True;
+ }
+ return result;
+}
+
static enum FrameExtentSupport { unknown, working, broken };
static FrameExtentSupport frameExtentSupported;
bool Initialize()
{
setlocale(LC_ALL, "en_US.UTF-8");
- XInitThreads();
+ // XInitThreads();
XSupportsLocale();
XSetLocaleModifiers("");
XSetErrorHandler(MyXErrorHandler);
//printf("Processing a FocusOut Event for %s (%x)\n", window._class.name, window);
#endif
+ /*
if(XCheckTypedWindowEvent(xGlobalDisplay, thisEvent->window, FocusIn, (XEvent *)thisEvent))
{
break;
}
+ */
+
+ if(XCheckIfEvent(xGlobalDisplay, (XEvent *)thisEvent, (void *)FocusInChecker, null))
+ {
+ if(!fullScreenMode)
+ XPutBackEvent(xGlobalDisplay, (XEvent *)thisEvent);
+ break;
+ }
+
if(fullScreenMode || (X11Window)window.windowHandle == activeWindow)
guiApp.SetAppFocus(false);
if(fullScreenMode || !window.nativeDecorations || !RequestFrameExtents(windowHandle))
((XWindowData)window.windowData).gotFrameExtents = true;
- window.windowHandle = windowHandle;
+ window.windowHandle = (void *)windowHandle;
if(window.state != maximized)
WaitForFrameExtents(window, true);