Le 28/04/2012 00:08, Fred Kiefer a écrit :
>> Here's an log with all 4 switches, starting when I click on the close
>> button of the preferences panel :
>>
>>> 2012-04-27 23:19:01.090 SimpleAgenda[9713] WM Protocol -
>>> WM_DELETE_WINDOW
>>> 2012-04-27 23:19:01.090 SimpleAgenda[9713] Send NSEvent type: 13
>>> to<NSPanel: 0x878b294>Number: 18 Title: Preferences
>>> 2012-04-27 23:19:01.093 SimpleAgenda[9713] 4194346 PropertyNotify -
>>> '_NET_WM_USER_TIME'
>>> 2012-04-27 23:19:01.094 SimpleAgenda[9713] 4194545 FocusOut
>>> 2012-04-27 23:19:01.094 SimpleAgenda[9713] 4194346 FocusIn
>>> 2012-04-27 23:19:01.094 SimpleAgenda[9713] 0 KeymapNotify
>>> 2012-04-27 23:19:01.094 SimpleAgenda[9713] 4194545 UnmapNotify
>>> 2012-04-27 23:19:01.095 SimpleAgenda[9713] 4194545 PropertyNotify -
>>> 'WM_STATE'
>>> 2012-04-27 23:19:01.097 SimpleAgenda[9713] 4194545 ConfigureNotify
>>> x:429 y:115 w:375 h:237 b:0 T
>>> 2012-04-27 23:19:01.097 SimpleAgenda[9713] Window 4194545, left 1,
>>> right 1, top 27, bottom 1
>>> 2012-04-27 23:19:01.098 SimpleAgenda[9713] X2O 18, 3, {x = 429; y =
>>> 115; width = 375; height = 237}, {x = 428; y = 447; width = 377;
>>> height = 265}
>>> 2012-04-27 23:19:01.098 SimpleAgenda[9713] Update win 18:
>>> original:{x = 430; y = 142; width = 375; height = 237}
>>> new:{x = 429; y = 115; width = 375; height = 237}
>>> 2012-04-27 23:19:01.098 SimpleAgenda[9713] Window 4194545, left 1,
>>> right 1, top 27, bottom 1
>>> 2012-04-27 23:19:01.098 SimpleAgenda[9713] X2H 18, 3, {x = 429; y =
>>> 115; width = 375; height = 237}, {x = 428; y = 88; width = 375;
>>> height = 237}
>>> 2012-04-27 23:19:01.098 SimpleAgenda[9713] Send NSEvent type: 13
>>> to<NSPanel: 0x878b294>Number: 18 Title: Preferences
>>> 2012-04-27 23:19:01.098 SimpleAgenda[9713] Move event: 18 {x = 428; y
>>> = 447}
>>> 2012-04-27 23:19:01.101 SimpleAgenda[9713] 4194545 ReparentNotify -
>>> offset 0 0
>>> 2012-04-27 23:19:01.102 SimpleAgenda[9713] 4194545 ConfigureNotify
>>> x:0 y:0 w:375 h:237 b:0 F
>>> 2012-04-27 23:19:01.104 SimpleAgenda[9713] Window 4194545, left 1,
>>> right 1, top 27, bottom 1
>>> 2012-04-27 23:19:01.104 SimpleAgenda[9713] X2O 18, 3, {x = 0; y = 0;
>>> width = 375; height = 237}, {x = -1; y = 562; width = 377; height = 265}
>>> 2012-04-27 23:19:01.104 SimpleAgenda[9713] Update win 18:
>>> original:{x = 429; y = 115; width = 375; height = 237}
>>> new:{x = 0; y = 0; width = 375; height = 237}
>>> 2012-04-27 23:19:01.104 SimpleAgenda[9713] Window 4194545, left 1,
>>> right 1, top 27, bottom 1
>>> 2012-04-27 23:19:01.104 SimpleAgenda[9713] X2H 18, 3, {x = 0; y = 0;
>>> width = 375; height = 237}, {x = -1; y = -27; width = 375; height = 237}
>>> 2012-04-27 23:19:01.104 SimpleAgenda[9713] bug
>>
>> I've added NSLog(@"bug") in an else branch to my previous hack. At this
>> point the bogus NSEvent should be sent to the panel and its coordinates
>> saved as the window geometry, I think.
>>
>> This is not happening only with SimpleAgenda, I reproduced it with FTP
>> for example. And this is problem isn't really new, I've been seeing for
>> some time now.
>>
>>> 2012-04-27 23:19:01.104 SimpleAgenda[9713] 4194545 ConfigureNotify
>>> x:429 y:115 w:375 h:237 b:0 F
>>> 2012-04-27 23:19:01.105 SimpleAgenda[9713] Window 4194545, left 1,
>>> right 1, top 27, bottom 1
>>> 2012-04-27 23:19:01.105 SimpleAgenda[9713] X2O 18, 3, {x = 429; y =
>>> 115; width = 375; height = 237}, {x = 428; y = 447; width = 377;
>>> height = 265}
>>> 2012-04-27 23:19:01.105 SimpleAgenda[9713] Update win 18:
>>> original:{x = 0; y = 0; width = 375; height = 237}
>>> new:{x = 429; y = 115; width = 375; height = 237}
>>> 2012-04-27 23:19:01.106 SimpleAgenda[9713] Window 4194545, left 1,
>>> right 1, top 27, bottom 1
>>> 2012-04-27 23:19:01.106 SimpleAgenda[9713] X2H 18, 3, {x = 429; y =
>>> 115; width = 375; height = 237}, {x = 428; y = 88; width = 375;
>>> height = 237}
>>> 2012-04-27 23:19:01.106 SimpleAgenda[9713] Send NSEvent type: 13
>>> to<NSPanel: 0x878b294>Number: 18 Title: Preferences
>>> 2012-04-27 23:19:01.106 SimpleAgenda[9713] Move event: 18 {x = 428; y
>>> = 447}
>>> 2012-04-27 23:19:01.108 SimpleAgenda[9713] 4194545 PropertyNotify -
>>> '_COMPIZ_WINDOW_DECOR_INPUT_FRAME'
>>> 2012-04-27 23:19:01.108 SimpleAgenda[9713] 4194545 PropertyNotify -
>>> '_NET_WM_ALLOWED_ACTIONS'
>>> 2012-04-27 23:19:01.109 SimpleAgenda[9713] 4194545 ConfigureNotify
>>> x:0 y:0 w:375 h:237 b:0 F
>>> 2012-04-27 23:19:01.120 SimpleAgenda[9713] Window 4194545, left 1,
>>> right 1, top 27, bottom 1
>>> 2012-04-27 23:19:01.120 SimpleAgenda[9713] X2O 18, 3, {x = 0; y = 0;
>>> width = 375; height = 237}, {x = -1; y = 562; width = 377; height = 265}
>>> 2012-04-27 23:19:01.120 SimpleAgenda[9713] Update win 18:
>>> original:{x = 429; y = 115; width = 375; height = 237}
>>> new:{x = 0; y = 0; width = 375; height = 237}
>>> 2012-04-27 23:19:01.124 SimpleAgenda[9713] Window 4194545, left 0,
>>> right 0, top 0, bottom 0
>>> 2012-04-27 23:19:01.124 SimpleAgenda[9713] X2H 18, 3, {x = 0; y = 0;
>>> width = 375; height = 237}, {x = 0; y = 0; width = 375; height = 237}
>>> 2012-04-27 23:19:01.124 SimpleAgenda[9713] bug
>
> Thank you for running this analysis. It looks like the
> XTranslateCoordinates call produces incorrect results. I don't have the
> time to look into this until early next week. Perhaps you are able to
> find out what goes wrong in line 853 yourself until then.
As I have zero experience with X, here's some more data. The 3 attached
files contain the result of the same action (close the preferences
panel) with GNU-Debug=NSEvent under unity, windowmaker and blackbox,
with the following debug patch applied.
The bug only happens under unity, which is clearly doing a lot more work
and using rarely used code paths in gnustep back. Maybe being a
compositing manager explains all this.
One thing I don't understand is why we are reacting to ConfigureNotify
and sending NSEvents even when the window is not visible. Just adding a
test on cWin->map_state == IsViewable like below 'fixes' the bug for me.
Anyway, XTranslateCoordinates returns 0 for x and y (no idea why)
_XFrameToOSFrame: substract 1 for the window border and voila, x = -1. I
tried checking XTranslateCoordinates return value but there are no errors.
> --- Source/x11/XGServerEvent.m (révision 35119)
> +++ Source/x11/XGServerEvent.m (copie de travail)
> @@ -857,6 +857,7 @@
> &root_child);
> x.origin.x = root_x;
> x.origin.y = root_y;
> + NSLog(@" - xtranslate -> x : %f y : %f", x.origin.x,
> x.origin.y);
> }
>
> cWin->xframe = x;
> @@ -903,8 +904,11 @@
> data1: n.size.width
> data2: n.size.height];
> }
> + // if (!NSEqualPoints(r.origin, x.origin) &&
> cWin->map_state == IsViewable)
> if (!NSEqualPoints(r.origin, x.origin))
> {
> + if (n.origin.x == -1)
> + NSLog(@" ----> x = -1 BUG");
> if (e != nil)
> {
> [event_queue addObject: e];
Hope this helps,
Philippe
2012-04-28 22:41:46.087 SimpleAgenda[22528] 20971787 ClientMessage -
WM_PROTOCOLS
2012-04-28 22:41:46.088 SimpleAgenda[22528] WM Protocol - WM_DELETE_WINDOW
2012-04-28 22:41:46.088 SimpleAgenda[22528] Send NSEvent type: 13 to <NSPanel:
0x895a704>Number: 33 Title: Preferences
2012-04-28 22:41:46.095 SimpleAgenda[22528] 20971587 PropertyNotify -
'_NET_WM_USER_TIME'
2012-04-28 22:41:46.096 SimpleAgenda[22528] 20971787 FocusOut
2012-04-28 22:41:46.096 SimpleAgenda[22528] 20971587 FocusIn
2012-04-28 22:41:46.096 SimpleAgenda[22528] 0 KeymapNotify
2012-04-28 22:41:46.096 SimpleAgenda[22528] 20971787 UnmapNotify
2012-04-28 22:41:46.099 SimpleAgenda[22528] 20971787 PropertyNotify - 'WM_STATE'
2012-04-28 22:41:46.099 SimpleAgenda[22528] 20971787 PropertyNotify -
'_NET_WM_DESKTOP'
2012-04-28 22:41:46.099 SimpleAgenda[22528] 20971787 PropertyNotify -
'_NET_WM_ALLOWED_ACTIONS'
2012-04-28 22:41:46.099 SimpleAgenda[22528] 20971787 PropertyNotify -
'_NET_WM_VISIBLE_NAME'
2012-04-28 22:41:46.099 SimpleAgenda[22528] 20971787 ReparentNotify - offset
374 241
2012-04-28 22:28:29.106 SimpleAgenda[21531] 69206257 ClientMessage -
WM_PROTOCOLS
2012-04-28 22:28:29.106 SimpleAgenda[21531] WM Protocol - WM_DELETE_WINDOW
2012-04-28 22:28:29.106 SimpleAgenda[21531] Send NSEvent type: 13 to <NSPanel:
0xb3a32934>Number: 18 Title: Preferences
2012-04-28 22:28:29.111 SimpleAgenda[21531] 69206058 PropertyNotify -
'_NET_WM_USER_TIME'
2012-04-28 22:28:29.113 SimpleAgenda[21531] 69206257 FocusOut
2012-04-28 22:28:29.113 SimpleAgenda[21531] 69206058 FocusIn
2012-04-28 22:28:29.113 SimpleAgenda[21531] 0 KeymapNotify
2012-04-28 22:28:29.113 SimpleAgenda[21531] 69206257 UnmapNotify
2012-04-28 22:28:29.115 SimpleAgenda[21531] 69206257 PropertyNotify - 'WM_STATE'
2012-04-28 22:28:29.116 SimpleAgenda[21531] 69206257 ConfigureNotify x:427
y:205 w:375 h:237 b:0 T
2012-04-28 22:28:29.118 SimpleAgenda[21531] Send NSEvent type: 13 to <NSPanel:
0xb3a32934>Number: 18 Title: Preferences
2012-04-28 22:28:29.119 SimpleAgenda[21531] 69206257 ReparentNotify - offset 0 0
2012-04-28 22:28:29.120 SimpleAgenda[21531] 69206257 ConfigureNotify x:0 y:0
w:375 h:237 b:0 F
2012-04-28 22:28:29.121 SimpleAgenda[21531] - xtranslate -> x : 0.000000 y :
0.000000
2012-04-28 22:28:29.122 SimpleAgenda[21531] ----> x = -1 BUG
2012-04-28 22:28:29.122 SimpleAgenda[21531] 69206257 ConfigureNotify x:427
y:205 w:375 h:237 b:0 F
2012-04-28 22:28:29.122 SimpleAgenda[21531] - xtranslate -> x : 427.000000 y :
205.000000
2012-04-28 22:28:29.123 SimpleAgenda[21531] Send NSEvent type: 13 to <NSPanel:
0xb3a32934>Number: 18 Title: Preferences
2012-04-28 22:28:29.123 SimpleAgenda[21531] NSWindow.m:3911 Assertion failed
in NSPanel(instance), method sendEvent:. ooops
2012-04-28 22:28:29.124 SimpleAgenda[21531] Send NSEvent type: 13 to <NSPanel:
0xb3a32934>Number: 18 Title: Preferences
2012-04-28 22:28:29.129 SimpleAgenda[21531] 69206257 PropertyNotify -
'_COMPIZ_WINDOW_DECOR_INPUT_FRAME'
2012-04-28 22:28:29.129 SimpleAgenda[21531] 69206257 PropertyNotify -
'_NET_WM_ALLOWED_ACTIONS'
2012-04-28 22:28:29.130 SimpleAgenda[21531] 69206257 ConfigureNotify x:0 y:0
w:375 h:237 b:0 F
2012-04-28 22:28:29.131 SimpleAgenda[21531] - xtranslate -> x : 0.000000 y :
0.000000
2012-04-28 22:28:29.136 SimpleAgenda[21531] ----> x = -1 BUG
2012-04-28 22:28:29.136 SimpleAgenda[21531] 69206257 ConfigureNotify x:0 y:0
w:375 h:237 b:0 T
2012-04-28 22:28:29.137 SimpleAgenda[21531] 69206257 PropertyNotify -
'_NET_FRAME_EXTENTS'
2012-04-28 22:28:29.137 SimpleAgenda[21531] Send NSEvent type: 13 to <NSPanel:
0xb3a32934>Number: 18 Title: Preferences
2012-04-28 22:28:29.137 SimpleAgenda[21531] NSWindow.m:3911 Assertion failed
in NSPanel(instance), method sendEvent:. ooops
2012-04-28 22:28:29.145 SimpleAgenda[21531] 69206257 PropertyNotify -
'_COMPIZ_WINDOW_DECOR'
2012-04-28 22:32:38.348 SimpleAgenda[21923] 20971761 ClientMessage -
WM_PROTOCOLS
2012-04-28 22:32:38.351 SimpleAgenda[21923] WM Protocol - WM_DELETE_WINDOW
2012-04-28 22:32:38.352 SimpleAgenda[21923] Send NSEvent type: 13 to <NSPanel:
0xb3a33494>Number: 18 Title: Preferences
2012-04-28 22:32:38.371 SimpleAgenda[21923] 20971562 PropertyNotify -
'_NET_WM_USER_TIME'
2012-04-28 22:32:38.373 SimpleAgenda[21923] 20971761 FocusOut
2012-04-28 22:32:38.373 SimpleAgenda[21923] 20971562 FocusIn
2012-04-28 22:32:38.373 SimpleAgenda[21923] 0 KeymapNotify
2012-04-28 22:32:38.373 SimpleAgenda[21923] 20971761 UnmapNotify
2012-04-28 22:32:38.373 SimpleAgenda[21923] 20971562 ClientMessage -
WM_PROTOCOLS
2012-04-28 22:32:38.373 SimpleAgenda[21923] WM Protocol - WM_TAKE_FOCUS
2012-04-28 22:32:38.376 SimpleAgenda[21923] 20971562 PropertyNotify -
'_NET_WM_USER_TIME'
2012-04-28 22:32:38.381 SimpleAgenda[21923] 20971761 PropertyNotify - 'WM_STATE'
2012-04-28 22:32:38.392 SimpleAgenda[21923] 20971761 ReparentNotify - offset
374 241
2012-04-28 22:32:38.392 SimpleAgenda[21923] 20971761 PropertyNotify -
'_NET_WM_DESKTOP'
2012-04-28 22:32:38.392 SimpleAgenda[21923] 20971761 PropertyNotify -
'_NET_WM_STATE'
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep