[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messag
From: |
Philippe Roussel |
Subject: |
Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1 |
Date: |
Sat, 28 Apr 2012 23:26:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 |
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
blackbox.txt
Description: Text document
unity.txt
Description: Text document
wmaker.txt
Description: Text document
- NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1, Philippe Roussel, 2012/04/27
- Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1, Fred Kiefer, 2012/04/27
- Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1, Philippe Roussel, 2012/04/27
- Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1, Philippe Roussel, 2012/04/27
- Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1, Philippe Roussel, 2012/04/27
- Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1, Fred Kiefer, 2012/04/27
- Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1,
Philippe Roussel <=
- Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1, Fred Kiefer, 2012/04/30
- Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1, Philippe Roussel, 2012/04/30
- Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1, Philippe Roussel, 2012/04/30