[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messag

From: Fred Kiefer
Subject: Re: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1
Date: Fri, 27 Apr 2012 22:33:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120328 Thunderbird/11.0.1

On 27.04.2012 19:44, Philippe Roussel wrote:
Hi all,

I'm currently chasing a strange behaviour. Preferences panels saving
their position with [NSWindow -setFrameAutosaveName:] and friends are
often redisplayed on the top left corner of the screen.

Looking at the application defaults I found that the x coordinate is
saved as -1. These values are saved in [NSWindow -sendEvent:] with [self
saveFrameUsingName: _autosaveName]; when reacting to the
NSAppKitDefined/GSAppKitWindowMoved message.

As I don't understand why those messages could be sent with x=-1 (and
I'm not sure y is meaninful), I used the follwing hack to cure the
problem but I hope someone will understand and fix the problem.

This is with Unity on Ubuntu 11.10.

Any ideas ?


Index: Source/x11/XGServerEvent.m
--- Source/x11/XGServerEvent.m  (révision 35115)
+++ Source/x11/XGServerEvent.m  (copie de travail)
@@ -908,7 +908,9 @@
                  if (e != nil)
                      [event_queue addObject: e];
+                   e = nil;
+               if (n.origin.x != -1 ) {
                  e = [NSEvent otherEventWithType: NSAppKitDefined
                               location: eventLocation
                               modifierFlags: eventFlags
@@ -918,6 +920,7 @@
                               subtype: GSAppKitWindowMoved
                               data1: n.origin.x
                               data2: n.origin.y];
+               }

Hi Philippe,

you code may work around the problem, but I would like to first understand what is causing it. You could add a break point on your new code to see what is causing it. In addition you could add the switches "--GNU-Debug=NSEvent --GNU-Debug=Moving --GNU-Debug=Frame" to your command line to see more debug output. That way we may be able to understand how this nonsensical value get created.

It could be that the line
n = [self _XFrameToOSFrame: x for: cWin];
converts the correct X values into wrong OS values. This would mean that we are using the wrong style offset values. Which window manager are you using? Is this properly supported by our _checkStyle: code? Here the command line switch "--GNU-Debug=Offset" should give you more information.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]