discuss-gnustep
[Top][All Lists]
Advanced

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

NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages w


From: Philippe Roussel
Subject: NSWindow receives NSAppKitDefined/GSAppKitWindowMoved strange messages with x = -1
Date: Fri, 27 Apr 2012 19:44:43 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

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 ?

Thanks,
Philippe

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];
+               }
               }
           }    
         break;



reply via email to

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