Skip to content

Commit

Permalink
aquamacs-handle-app-activated2: do not make frame if selected frame i…
Browse files Browse the repository at this point in the history
…s full-screen
  • Loading branch information
davidswelt committed Apr 25, 2012
1 parent aa4b18e commit 7993d19
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
8 changes: 6 additions & 2 deletions aquamacs/doc/latex/changelog.tex
Expand Up @@ -18,12 +18,16 @@ \subsection{Changes--- dev}
\item Full-screen now supports the standard Mac OS X 10.7 ``Lion'' full-screen mode: The frame takes up the full (main) display and uses its own screen. Users may switch between screens as usual (mouse swipe or C-left/right, for instance). The old-style fullscreen mode is still available, however. To maximize a frame on the current space, allowing other frames on this space, type C-u A-S-Return, or prepend any of the commands that enter fullscreen mode with C-u.
Thanks for research: Sandy Patterson and Daisuke Murase.
\item Aquamacs now provides session persistency: you can load and save sessions, and under Mac OS X 10.7 or later, sessions are reguarily saved and restored in case of unexpected program termination or reboot. Use the new {\em Load Session, Save Session As} menu entries in the {\em File} menu to use these new functions, and the new customization variable `revive-desktop-after-launching' to turn the behavior off, or enable automatic session persistency even on pre-Lion operating systems. Note: Unlike the formerly available functions from the `desktop' package, all frames, windows, tabs, buffers and some customizations are saved. Buffers not linked to a file, such as those showing processes, will not be restored, and frames may not end up on the same space at this time. Aquamacs now includes an adapted version of the {\tt revive.el} package by Hirose Yuuji. We recommend that you do not load a different version of this package yourself.
\item Aquamacs now provides experimental session persistency: you can load and save sessions. Use the new {\em Load Session, Save Session As} menu entries in the {\em File} menu to use these new functions. Note: Unlike the formerly available functions from the `desktop' package, all frames, windows, tabs, buffers and some customizations are saved. Buffers not linked to a file, such as those showing processes, will not be restored, and frames may not end up on the same space at this time. Aquamacs now includes an adapted version of the {\tt revive.el} package by Hirose Yuuji. We recommend that you do not load a different version of this package yourself.
% , and under Mac OS X 10.7 or later, sessions are reguarily saved and restored in case of unexpected program termination or reboot
% and the new customization variable `revive-desktop-after-launching' to turn the behavior off, or enable automatic session persistency even on pre-Lion operating systems
\item Colors are now displayed in the ``color space'' that is set by the user for the specific display. A slight change in color shades may be noticed.
Suggested by Juan Jose Garcia Ripoll.
\item Text search (isearch) now works better when using one of the Emulate-Mac-Keyboard-Modes.
Reported by Thomas Strathmann.
\item Frames are now reliably moved inside the current display again when entering the minibuffer (and at other times).
\item Switching applications while Aquamacs is in full-screen mode no longer creates unwanted empty frames.
Reported by Christian H\"o{}ltje, Rory Kirchner and Milan Mitrovi\'c{}.
\end{itemize}
\subsection{Changes--- 2.4}
Expand All @@ -41,7 +45,7 @@ \subsection{Changes--- 2.4}
\item When deleting several words in a row (killing them to append them to the kill ring), they are no longer added as run-in words in smart spacing mode. Spaces are addes where appropriate.
\item Drag\&drop into windows showing eshell, shell and other comint-based buffers now inserts the full file name.
Suggested by Jan Marius Hofert.
\item When expanding the load path (e.g., for library files) in directories such as Library/Application~Support/Aquamacs~Emacs, a file called {.nosearch} now prevents Aquamacs from adding the present and subordinate directories. (The previous {\tt .ignore} file only worked at the topmost level.}
\item When expanding the load path (e.g., for library files) in directories such as Library/Application~Support/Aquamacs~Emacs, a file called {.nosearch} now prevents Aquamacs from adding the present and subordinate directories. (The previous {\tt .ignore} file only worked at the topmost level.)
Reported by Nathaniel Cunningham.
\item Fixed issue that could lead to a crash when using Aquamacs as an editor (ODB standard) from certain other applications.
Reported by Kevin Kirkup.
Expand Down
14 changes: 10 additions & 4 deletions aquamacs/src/site-lisp/one-buffer-one-frame.el
Expand Up @@ -657,13 +657,14 @@ even if it's the only visible frame."
(setq aquamacs-last-frame-empty-frame nil)))))
(let ((all-parms
(append
'((visibility . nil))
'((fullscreen . nil) (visibility . nil))
parms)))
(print parms)
(if (and aquamacs-last-frame-empty-frame
(frame-live-p aquamacs-last-frame-empty-frame)
(not (frame-iconified-p aquamacs-last-frame-empty-frame)))
(modify-frame-parameters aquamacs-last-frame-empty-frame
parms)
(cons '(fullscreen . nil) parms))
(setq aquamacs-last-frame-empty-frame (make-frame all-parms))))
(select-frame aquamacs-last-frame-empty-frame)
(raise-frame aquamacs-last-frame-empty-frame)
Expand Down Expand Up @@ -1000,10 +1001,15 @@ Ensure that there is a (hidden) frame in the current space."
(run-with-idle-timer 0.5 nil 'aquamacs-handle-app-activated2))

(defun aquamacs-handle-app-activated2 ()
(unless (ns-frame-is-on-active-space-p (selected-frame))
(unless (or (ns-frame-is-on-active-space-p (selected-frame))
;; we're assuming that the selected frame, if full-frame,
;; will be on the active space. we're probably switching
;; to a space with a visible frame anyway, in this case.
;; https://github.com/davidswelt/aquamacs-emacs/issues/60
(eq (frame-parameter nil 'fullscreen) 'fullboth))
;; find a frame on active space
;; (unless (ns-visible-frame-list)
(let* ((display-buffer-reuse-frames 'select)
(let* ((display-buffer-reuse-frames 'select)
(one-buffer-one-frame nil)
(hf (aquamacs-make-empty-frame aquamacs-deleted-frame-position)))
(select-window (frame-first-window hf))
Expand Down

0 comments on commit 7993d19

Please sign in to comment.