diff options
| author | Anders Lindgren | 2015-11-15 19:17:53 +0100 |
|---|---|---|
| committer | Anders Lindgren | 2015-11-15 19:17:53 +0100 |
| commit | b36ba568a98e5bc64895d6f0b1008ca47ab43345 (patch) | |
| tree | 5171637d0ce33563ebef84d9e6691d4844404b25 /src | |
| parent | 63e6f4c820bb677bc915445c99041a51aef6bdab (diff) | |
| download | emacs-b36ba568a98e5bc64895d6f0b1008ca47ab43345.tar.gz emacs-b36ba568a98e5bc64895d6f0b1008ca47ab43345.zip | |
Fixed a toolbar related issue on OS X.
Earlier, when toggling the tool-bar in a maximized frame, the
frame size didn't match the number of text lines, leaving an
unused area at the bottom of the frame.
* nsfns.m (x_set_tool_bar_lines): Exit maximized and full height
fullscreen modes when tool bar is disabled.
Diffstat (limited to 'src')
| -rw-r--r-- | src/nsfns.m | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/nsfns.m b/src/nsfns.m index c24344436ad..94294de1bac 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -648,6 +648,11 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | |||
| 648 | void | 648 | void |
| 649 | x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | 649 | x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) |
| 650 | { | 650 | { |
| 651 | /* Currently, when the tool bar change state, the frame is resized. | ||
| 652 | |||
| 653 | TODO: It would be better if this didn't occur when 1) the frame | ||
| 654 | is full height or maximized or 2) when specified by | ||
| 655 | `frame-inhibit-implied-resize'. */ | ||
| 651 | int nlines; | 656 | int nlines; |
| 652 | 657 | ||
| 653 | if (FRAME_MINIBUF_ONLY_P (f)) | 658 | if (FRAME_MINIBUF_ONLY_P (f)) |
| @@ -669,7 +674,21 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | |||
| 669 | { | 674 | { |
| 670 | free_frame_tool_bar (f); | 675 | free_frame_tool_bar (f); |
| 671 | FRAME_EXTERNAL_TOOL_BAR (f) = 0; | 676 | FRAME_EXTERNAL_TOOL_BAR (f) = 0; |
| 672 | } | 677 | |
| 678 | { | ||
| 679 | EmacsView *view = FRAME_NS_VIEW (f); | ||
| 680 | int fs_state = [view fullscreenState]; | ||
| 681 | |||
| 682 | if (fs_state == FULLSCREEN_MAXIMIZED) | ||
| 683 | { | ||
| 684 | [view setFSValue:FULLSCREEN_WIDTH]; | ||
| 685 | } | ||
| 686 | else if (fs_state == FULLSCREEN_HEIGHT) | ||
| 687 | { | ||
| 688 | [view setFSValue:FULLSCREEN_NONE]; | ||
| 689 | } | ||
| 690 | } | ||
| 691 | } | ||
| 673 | } | 692 | } |
| 674 | 693 | ||
| 675 | { | 694 | { |
| @@ -680,8 +699,6 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | |||
| 680 | || (CONSP (frame_inhibit_implied_resize) | 699 | || (CONSP (frame_inhibit_implied_resize) |
| 681 | && !NILP (Fmemq (Qtool_bar_lines, | 700 | && !NILP (Fmemq (Qtool_bar_lines, |
| 682 | frame_inhibit_implied_resize)))) | 701 | frame_inhibit_implied_resize)))) |
| 683 | /* This will probably fail to DTRT in the | ||
| 684 | fullheight/-width cases. */ | ||
| 685 | && NILP (get_frame_param (f, Qfullscreen))) | 702 | && NILP (get_frame_param (f, Qfullscreen))) |
| 686 | ? 0 | 703 | ? 0 |
| 687 | : 2); | 704 | : 2); |