Le 30/04/2012 18:16, Philippe Roussel a écrit :
> Le 30/04/2012 17:03, Fred Kiefer a écrit :
>> Not handling move and reparenting events when the window is not visible
>> sounds like a great idea to me. The only problem is that we would need
>> to test this with each and every window manager that we support :-(
>>
>> A saver solution might be to just not save the window frame in the event
>> handling code of NSWindow, when the window isn't visible. Could you
>> please test this and report back the results?
>> It definitely isn't a complete solutions, as the stored frame will be
>> wrong as long as the window isn't visible, but we could get away with a
>> lot less testing.
> 
> I will test this tonight and report back.

The following minimal patch/hack works for me without any visible bad
consequences.

I'm still having problems when closing and reopening the preferences
panel without exiting the application (sometimes the panel wrongly
appears in the top left corner and with a bad size) but it doesn't seem
related. I'll try to dig further.

Thanks,
Philippe

--- Source/NSWindow.m   (révision 35124)
+++ Source/NSWindow.m   (copie de travail)
@@ -4559,10 +4559,12 @@
   NSString *key;
   id obj;

-  defs = [NSUserDefaults standardUserDefaults];
-  obj = [self stringWithSavedFrame];
-  key = [NSString stringWithFormat: @"NSWindow Frame %@", name];
-  [defs setObject: obj forKey: key];
+  if (_f.visible == YES) {
+    defs = [NSUserDefaults standardUserDefaults];
+    obj = [self stringWithSavedFrame];
+    key = [NSString stringWithFormat: @"NSWindow Frame %@", name];
+    [defs setObject: obj forKey: key];
+  }
 }

 - (BOOL) setFrameAutosaveName: (NSString*)name

_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to