Changeset 12088


Ignore:
Timestamp:
May 19, 2009, 6:18:43 AM (10 years ago)
Author:
gb
Message:

Remember initial listener size/position (under the name #@"/").

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/cocoa-ide/cocoa-listener.lisp

    r11373 r12088  
    357357    (unless (%null-ptr-p doc)
    358358      (let* ((listener-name (if (eql 1 (incf *cocoa-listener-count*))
    359                             "Listener"
    360                             (format nil
    361                                     "Listener-~d" *cocoa-listener-count*)))
     359                              "Listener"
     360                              (format nil
     361                                      "Listener-~d" *cocoa-listener-count*)))
    362362             (buffer (hemlock-buffer doc)))
    363363        (setf (hi::buffer-pathname buffer) nil
     
    402402                      'hemlock-listener-window-controller
    403403                      :with-window window))
    404          (listener-name (hi::buffer-name (hemlock-buffer self))))
     404         (listener-name (hi::buffer-name (hemlock-buffer self)))
     405         (path (when (eql 1 *cocoa-listener-count*) #@"/")))
     406
    405407    (with-slots (styles) textstorage
    406408      ;; We probably should be more disciplined about
     
    416418        (let* ((layout (#/objectAtIndex: layout-managers i)))
    417419          (#/setBackgroundLayoutEnabled: layout nil))))
    418     (#/setDelegate: (text-pane-text-view (slot-value window 'pane)) self)   
     420    (#/setDelegate: (text-pane-text-view (slot-value window 'pane)) self)
     421    (#/setShouldCascadeWindows: controller nil)
    419422    (#/addWindowController: self controller)
    420423    (#/release controller)
    421     (ns:with-ns-point (current-point
    422                        (or *next-listener-x-pos*
    423                            (x-pos-for-window window *initial-listener-x-pos*))
    424                        (or *next-listener-y-pos*
    425                            (y-pos-for-window window *initial-listener-y-pos*)))
    426       (let* ((new-point (#/cascadeTopLeftFromPoint: window current-point)))
    427         (setf *next-listener-x-pos* (ns:ns-point-x new-point)
    428               *next-listener-y-pos* (ns:ns-point-y new-point))))
     424    (when path
     425      (unless (#/setFrameAutosaveName: window path)
     426        (setq path nil)))
     427    (unless (and path
     428                 (#/setFrameUsingName: window path))
     429      (ns:with-ns-point (current-point
     430                         (or *next-listener-x-pos*
     431                             (x-pos-for-window window *initial-listener-x-pos*))
     432                         (or *next-listener-y-pos*
     433                             (y-pos-for-window window *initial-listener-y-pos*)))
     434        (let* ((new-point (#/cascadeTopLeftFromPoint: window current-point)))
     435          (setf *next-listener-x-pos* (ns:ns-point-x new-point)
     436                *next-listener-y-pos* (ns:ns-point-y new-point)))))
    429437    (setf (hemlock-document-process self)
    430438          (new-cocoa-listener-process listener-name window))
Note: See TracChangeset for help on using the changeset viewer.