Changeset - ff723e73522e
[Not reviewed]
0 1 0
Sergey Pashinin - 11 years ago 2014-08-23 09:51:55
sergey@pashinin.com
restore maximized frame
1 file changed with 8 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/workgroups-wconfig.el
Show inline comments
 
@@ -189,39 +189,43 @@ ignored.
 
                (wg-restore-wconfig wconfig)
 
                )) fl)
 
      (select-frame-set-input-focus frame))))
 

	
 
;; FIXME: throw a specific error if the restoration was unsuccessful
 
(defun wg-restore-wconfig (wconfig &optional frame)
 
  "Restore a workgroup configuration WCONFIG in a FRAME.
 
Runs each time you're switching workgroups."
 
  (unless frame (setq frame (selected-frame)))
 
  (let ((wg-record-incorrectly-restored-bufs t)
 
        (wg-incorrectly-restored-bufs nil)
 
        (params (wg-wconfig-parameters wconfig))
 
        fullscreen wtree)
 
        fullscreen)
 
    (wg-barf-on-active-minibuffer)
 
    (when wg-restore-scroll-bars
 
      (wg-wconfig-restore-scroll-bars wconfig))
 

	
 
    ;; Restore buffers
 
    (wg-restore-window-tree
 
     (wg-scale-wconfig-to-frame wconfig))
 
    (when (null (wg-current-workgroup t))
 
      (set-frame-parameter frame 'fullscreen (if (assoc 'fullscreen params)
 
                                                 (cdr (assoc 'fullscreen params))
 
                                               nil)))
 

	
 
    ;; Restore frame position
 
    (when (and wg-restore-frame-position
 
               (not (frame-parameter nil 'fullscreen))
 
               (null (wg-current-workgroup t)))
 
      (wg-wconfig-restore-frame-position wconfig frame))
 

	
 
    ;; Restore buffers
 
    (wg-restore-window-tree (wg-scale-wconfig-to-frame wconfig))
 

	
 
    (when wg-incorrectly-restored-bufs
 
      (message "Unable to restore these buffers: %S\
 
If you want, restore them manually and try again."
 
               (mapcar 'wg-buf-name wg-incorrectly-restored-bufs)))))
 

	
 

	
 
;;; saved wconfig commands
 

	
 
(defun wg-save-wconfig ()
 
  "Save the current wconfig to the current workgroup's saved wconfigs."
 
  (interactive)
 
  (let* ((workgroup (wg-current-workgroup))
0 comments (0 inline, 0 general)