diff --git a/ChangeLog b/ChangeLog index dcff204..d72fbdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-08-14 Fred Kiefer + + * Source/x11/XGServerWindow.m (-_ewmh_isMinimized:): Correct + indentation. + * Source/x11/XGServerEvent.m (-receivedEvent:type:extra:forMode:): + For PropertyNotify cache the window first. + 2008-07-19 Fred Kiefer * Source/x11/XGServerWindow.m (-window::::): For EWMH window diff --git a/Source/x11/XGServerEvent.m b/Source/x11/XGServerEvent.m index 4331019..5a4f198 100644 --- a/Source/x11/XGServerEvent.m +++ b/Source/x11/XGServerEvent.m @@ -1307,24 +1307,32 @@ static int check_modifier (XEvent *xEvent, KeySym key_sym) if (xEvent.xproperty.atom == generic.netstates.net_wm_state_atom && xEvent.xproperty.state == PropertyNewValue) { - /* - * FIXME: we really should detect when the state changes from - * unminimized to minimized, or vice versa - */ - if ([self _ewmh_isMinimized: xEvent.xproperty.window]) + if (cWin == 0 || xEvent.xproperty.window != cWin->ident) { - // Same event as when we get ClientMessage with the atom - // equal to generic.miniaturize_atom - eventLocation = NSMakePoint(0,0); - e = [NSEvent otherEventWithType: NSAppKitDefined - location: eventLocation - modifierFlags: 0 - timestamp: xEvent.xproperty.time / 1000 - windowNumber: cWin->number - context: gcontext - subtype: GSAppKitWindowMiniaturize - data1: 0 - data2: 0]; + generic.cachedWindow + = [XGServer _windowForXWindow: xEvent.xproperty.window]; + } + if (cWin != 0) + { + /* + * FIXME: we really should detect when the state changes from + * unminimized to minimized, or vice versa + */ + if ([self _ewmh_isMinimized: xEvent.xproperty.window]) + { + // Same event as when we get ClientMessage with the atom + // equal to generic.miniaturize_atom + eventLocation = NSMakePoint(0,0); + e = [NSEvent otherEventWithType: NSAppKitDefined + location: eventLocation + modifierFlags: 0 + timestamp: xEvent.xproperty.time / 1000 + windowNumber: cWin->number + context: gcontext + subtype: GSAppKitWindowMiniaturize + data1: 0 + data2: 0]; + } } } } diff --git a/Source/x11/XGServerWindow.m b/Source/x11/XGServerWindow.m index 8beee61..4e9fff2 100644 --- a/Source/x11/XGServerWindow.m +++ b/Source/x11/XGServerWindow.m @@ -4581,7 +4581,7 @@ _computeDepth(int class, int bpp) * property. We map the EWMH _NET_WM_STATE_HIDDEN state to GNUstep's * miniaturized state. */ -- (BOOL) _ewmh_isMinimized: (Window) win +- (BOOL) _ewmh_isMinimized: (Window)win { Atom *data; int count; @@ -4596,13 +4596,13 @@ _computeDepth(int class, int bpp) return NO; for (i = 0; i < count; i++) - { - if (data[i] == generic.netstates.net_wm_state_hidden_atom) { - XFree(data); - return YES; + if (data[i] == generic.netstates.net_wm_state_hidden_atom) + { + XFree(data); + return YES; + } } - } XFree(data); return NO;