diff options
| author | Yuuki Harano | 2021-05-03 21:33:53 +0900 |
|---|---|---|
| committer | Yuuki Harano | 2021-05-03 21:33:53 +0900 |
| commit | 704b765eaaee82176e26ab084c26d65311fd46d3 (patch) | |
| tree | 15d9280e45e31f2bff755cd176f498c89a7b3875 /src | |
| parent | 66a36f1e5a323aed3d39db1044a1b71373123832 (diff) | |
| parent | 1dafab893652c42be807e9a44005413cb7915f81 (diff) | |
| download | emacs-704b765eaaee82176e26ab084c26d65311fd46d3.tar.gz emacs-704b765eaaee82176e26ab084c26d65311fd46d3.zip | |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'src')
| -rw-r--r-- | src/buffer.c | 11 | ||||
| -rw-r--r-- | src/comp.c | 6 | ||||
| -rw-r--r-- | src/dispextern.h | 2 | ||||
| -rw-r--r-- | src/dispnew.c | 15 | ||||
| -rw-r--r-- | src/doc.c | 2 | ||||
| -rw-r--r-- | src/frame.c | 54 | ||||
| -rw-r--r-- | src/frame.h | 5 | ||||
| -rw-r--r-- | src/gtkutil.c | 28 | ||||
| -rw-r--r-- | src/nsfns.m | 7 | ||||
| -rw-r--r-- | src/nsterm.m | 34 | ||||
| -rw-r--r-- | src/xterm.c | 5 |
11 files changed, 92 insertions, 77 deletions
diff --git a/src/buffer.c b/src/buffer.c index 8e33162989b..9e417bf555c 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -5390,17 +5390,24 @@ init_buffer (void) | |||
| 5390 | recorded by temacs, that cannot be used by the dumped Emacs. | 5390 | recorded by temacs, that cannot be used by the dumped Emacs. |
| 5391 | We map new memory for their text here. | 5391 | We map new memory for their text here. |
| 5392 | 5392 | ||
| 5393 | Implementation note: the buffers we carry from temacs are: | 5393 | Implementation notes: the buffers we carry from temacs are: |
| 5394 | " prin1", "*scratch*", " *Minibuf-0*", "*Messages*", and | 5394 | " prin1", "*scratch*", " *Minibuf-0*", "*Messages*", and |
| 5395 | " *code-conversion-work*". They are created by | 5395 | " *code-conversion-work*". They are created by |
| 5396 | init_buffer_once and init_window_once (which are not called | 5396 | init_buffer_once and init_window_once (which are not called |
| 5397 | in the dumped Emacs), and by the first call to coding.c routines. */ | 5397 | in the dumped Emacs), and by the first call to coding.c |
| 5398 | routines. Since FOR_EACH_LIVE_BUFFER only walks the buffers | ||
| 5399 | in Vbuffer_alist, any buffer we carry from temacs that is | ||
| 5400 | not in the alist (a.k.a. "magic invisible buffers") should | ||
| 5401 | be handled here explicitly. */ | ||
| 5398 | FOR_EACH_LIVE_BUFFER (tail, buffer) | 5402 | FOR_EACH_LIVE_BUFFER (tail, buffer) |
| 5399 | { | 5403 | { |
| 5400 | struct buffer *b = XBUFFER (buffer); | 5404 | struct buffer *b = XBUFFER (buffer); |
| 5401 | b->text->beg = NULL; | 5405 | b->text->beg = NULL; |
| 5402 | enlarge_buffer_text (b, 0); | 5406 | enlarge_buffer_text (b, 0); |
| 5403 | } | 5407 | } |
| 5408 | /* The " prin1" buffer is not in Vbuffer_alist. */ | ||
| 5409 | XBUFFER (Vprin1_to_string_buffer)->text->beg = NULL; | ||
| 5410 | enlarge_buffer_text (XBUFFER (Vprin1_to_string_buffer), 0); | ||
| 5404 | } | 5411 | } |
| 5405 | #endif /* USE_MMAP_FOR_BUFFERS */ | 5412 | #endif /* USE_MMAP_FOR_BUFFERS */ |
| 5406 | 5413 | ||
diff --git a/src/comp.c b/src/comp.c index 5309be46dec..a4dba435b4a 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* Compile elisp into native code. | 1 | /* Compile Emacs Lisp into native code. |
| 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. | 2 | Copyright (C) 2019-2021 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | Author: Andrea Corallo <akrl@sdf.org> | 4 | Author: Andrea Corallo <akrl@sdf.org> |
| @@ -4716,7 +4716,7 @@ maybe_defer_native_compilation (Lisp_Object function_name, | |||
| 4716 | return; | 4716 | return; |
| 4717 | } | 4717 | } |
| 4718 | 4718 | ||
| 4719 | /* This is to have deferred compilaiton able to compile comp | 4719 | /* This is so deferred compilation is able to compile comp |
| 4720 | dependencies breaking circularity. */ | 4720 | dependencies breaking circularity. */ |
| 4721 | if (!NILP (Ffeaturep (Qcomp, Qnil))) | 4721 | if (!NILP (Ffeaturep (Qcomp, Qnil))) |
| 4722 | { | 4722 | { |
| @@ -4949,7 +4949,7 @@ load_comp_unit (struct Lisp_Native_Comp_Unit *comp_u, bool loading_dump, | |||
| 4949 | /* In case another load of the same CU is active on the stack | 4949 | /* In case another load of the same CU is active on the stack |
| 4950 | all ephemeral data is hold by that frame. Re-writing | 4950 | all ephemeral data is hold by that frame. Re-writing |
| 4951 | 'data_ephemeral_vec' would be not only a waste of cycles but | 4951 | 'data_ephemeral_vec' would be not only a waste of cycles but |
| 4952 | more importanly would lead to crashed if the contained data | 4952 | more importantly would lead to crashes if the contained data |
| 4953 | is not cons hashed. */ | 4953 | is not cons hashed. */ |
| 4954 | if (!recursive_load) | 4954 | if (!recursive_load) |
| 4955 | { | 4955 | { |
diff --git a/src/dispextern.h b/src/dispextern.h index baf92127b3d..c8cefec37f4 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -1270,8 +1270,6 @@ extern struct glyph space_glyph; | |||
| 1270 | /* True means last display completed. False means it was preempted. */ | 1270 | /* True means last display completed. False means it was preempted. */ |
| 1271 | 1271 | ||
| 1272 | extern bool display_completed; | 1272 | extern bool display_completed; |
| 1273 | extern bool delayed_size_change; | ||
| 1274 | |||
| 1275 | 1273 | ||
| 1276 | /************************************************************************ | 1274 | /************************************************************************ |
| 1277 | Glyph Strings | 1275 | Glyph Strings |
diff --git a/src/dispnew.c b/src/dispnew.c index 27603664638..ab420bc9460 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -102,7 +102,7 @@ bool display_completed; | |||
| 102 | 102 | ||
| 103 | /* True means SIGWINCH happened when not safe. */ | 103 | /* True means SIGWINCH happened when not safe. */ |
| 104 | 104 | ||
| 105 | bool delayed_size_change; | 105 | static bool delayed_size_change; |
| 106 | 106 | ||
| 107 | /* A glyph for a space. */ | 107 | /* A glyph for a space. */ |
| 108 | 108 | ||
| @@ -5815,7 +5815,6 @@ deliver_window_change_signal (int sig) | |||
| 5815 | void | 5815 | void |
| 5816 | do_pending_window_change (bool safe) | 5816 | do_pending_window_change (bool safe) |
| 5817 | { | 5817 | { |
| 5818 | /* If window change signal handler should have run before, run it now. */ | ||
| 5819 | if (redisplaying_p && !safe) | 5818 | if (redisplaying_p && !safe) |
| 5820 | return; | 5819 | return; |
| 5821 | 5820 | ||
| @@ -5830,8 +5829,11 @@ do_pending_window_change (bool safe) | |||
| 5830 | struct frame *f = XFRAME (frame); | 5829 | struct frame *f = XFRAME (frame); |
| 5831 | 5830 | ||
| 5832 | /* Negative new_width or new_height values mean no change is | 5831 | /* Negative new_width or new_height values mean no change is |
| 5833 | required (a native size can never drop below zero). */ | 5832 | required (a native size can never drop below zero). If |
| 5834 | if (f->new_height >= 0 || f->new_width >= 0) | 5833 | new_size_p is not set, this means the size change was |
| 5834 | requested by adjust_frame_size but has not been honored by | ||
| 5835 | the window manager yet. */ | ||
| 5836 | if (f->new_size_p && (f->new_height >= 0 || f->new_width >= 0)) | ||
| 5835 | change_frame_size (f, f->new_width, f->new_height, | 5837 | change_frame_size (f, f->new_width, f->new_height, |
| 5836 | false, false, safe); | 5838 | false, false, safe); |
| 5837 | } | 5839 | } |
| @@ -5858,14 +5860,17 @@ change_frame_size_1 (struct frame *f, int new_width, int new_height, | |||
| 5858 | /* We can't deal with the change now, queue it for later. */ | 5860 | /* We can't deal with the change now, queue it for later. */ |
| 5859 | f->new_width = new_width; | 5861 | f->new_width = new_width; |
| 5860 | f->new_height = new_height; | 5862 | f->new_height = new_height; |
| 5863 | f->new_size_p = true; | ||
| 5861 | delayed_size_change = true; | 5864 | delayed_size_change = true; |
| 5862 | } | 5865 | } |
| 5863 | else | 5866 | else |
| 5864 | { | 5867 | { |
| 5865 | /* Storing -1 in the new_width/new_height slots means that no size | 5868 | /* Storing -1 in the new_width/new_height slots means that no size |
| 5866 | change is pending. Native sizes are always non-negative. */ | 5869 | change is pending. Native sizes are always non-negative. |
| 5870 | Reset the new_size_p slot as well. */ | ||
| 5867 | f->new_height = -1; | 5871 | f->new_height = -1; |
| 5868 | f->new_width = -1; | 5872 | f->new_width = -1; |
| 5873 | f->new_size_p = false; | ||
| 5869 | /* adjust_frame_size wants its arguments in terms of text_width | 5874 | /* adjust_frame_size wants its arguments in terms of text_width |
| 5870 | and text_height, so convert them here. For pathologically | 5875 | and text_height, so convert them here. For pathologically |
| 5871 | small frames, the resulting values may be negative though. */ | 5876 | small frames, the resulting values may be negative though. */ |
| @@ -550,7 +550,7 @@ the same file name is found in the `doc-directory'. */) | |||
| 550 | Lisp_Object delayed_init = | 550 | Lisp_Object delayed_init = |
| 551 | find_symbol_value (intern ("custom-delayed-init-variables")); | 551 | find_symbol_value (intern ("custom-delayed-init-variables")); |
| 552 | 552 | ||
| 553 | if (EQ (delayed_init, Qunbound)) delayed_init = Qnil; | 553 | if (!CONSP (delayed_init)) delayed_init = Qnil; |
| 554 | 554 | ||
| 555 | CHECK_STRING (filename); | 555 | CHECK_STRING (filename); |
| 556 | 556 | ||
diff --git a/src/frame.c b/src/frame.c index baa0e47f437..177022f6ebc 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -621,12 +621,8 @@ frame_size_history_extra (struct frame *f, Lisp_Object parameter, | |||
| 621 | * must be preserved. The code for setting up window dividers and | 621 | * must be preserved. The code for setting up window dividers and |
| 622 | * that responsible for wrapping the (internal) tool bar use this. | 622 | * that responsible for wrapping the (internal) tool bar use this. |
| 623 | * | 623 | * |
| 624 | * 5 means to never call set_window_size_hook. change_frame_size uses | 624 | * 5 means to never call set_window_size_hook. Usually this means to |
| 625 | * this. | 625 | * call resize_frame_windows. change_frame_size uses this. |
| 626 | * | ||
| 627 | * Note that even when set_window_size_hook is not called, individual | ||
| 628 | * windows may have to be resized (via `window--sanitize-window-sizes') | ||
| 629 | * in order to support minimum size constraints. | ||
| 630 | * | 626 | * |
| 631 | * PRETEND is as for change_frame_size. PARAMETER, if non-nil, is the | 627 | * PRETEND is as for change_frame_size. PARAMETER, if non-nil, is the |
| 632 | * symbol of the parameter changed (like `menu-bar-lines', `font', ...). | 628 | * symbol of the parameter changed (like `menu-bar-lines', `font', ...). |
| @@ -718,6 +714,9 @@ adjust_frame_size (struct frame *f, int new_text_width, int new_text_height, | |||
| 718 | 714 | ||
| 719 | if (FRAME_WINDOW_P (f) | 715 | if (FRAME_WINDOW_P (f) |
| 720 | && f->can_set_window_size | 716 | && f->can_set_window_size |
| 717 | /* For inhibit == 1 call the window_size_hook only if a native | ||
| 718 | size changes. For inhibit == 0 or inhibit == 2 always call | ||
| 719 | it. */ | ||
| 721 | && ((!inhibit_horizontal | 720 | && ((!inhibit_horizontal |
| 722 | && (new_native_width != old_native_width | 721 | && (new_native_width != old_native_width |
| 723 | || inhibit == 0 || inhibit == 2)) | 722 | || inhibit == 0 || inhibit == 2)) |
| @@ -725,29 +724,25 @@ adjust_frame_size (struct frame *f, int new_text_width, int new_text_height, | |||
| 725 | && (new_native_height != old_native_height | 724 | && (new_native_height != old_native_height |
| 726 | || inhibit == 0 || inhibit == 2)))) | 725 | || inhibit == 0 || inhibit == 2)))) |
| 727 | { | 726 | { |
| 728 | /* Make sure we respect fullheight and fullwidth. */ | 727 | if (inhibit == 2 |
| 729 | if (inhibit_horizontal) | 728 | #ifdef USE_MOTIF |
| 730 | new_native_width = old_native_width; | 729 | && !EQ (parameter, Qmenu_bar_lines) |
| 731 | else if (inhibit_vertical) | 730 | #endif |
| 732 | new_native_height = old_native_height; | 731 | && (f->new_width >= 0 || f->new_height >= 0)) |
| 733 | |||
| 734 | if (inhibit == 2 && f->new_width > 0 && f->new_height > 0) | ||
| 735 | /* For implied resizes with inhibit 2 (external menu and tool | 732 | /* For implied resizes with inhibit 2 (external menu and tool |
| 736 | bar) pick up any new sizes the display engine has not | 733 | bar) pick up any new sizes the display engine has not |
| 737 | processed yet. Otherwsie, we would request the old sizes | 734 | processed yet. Otherwsie, we would request the old sizes |
| 738 | which will make this request appear as a request to set new | 735 | which will make this request appear as a request to set new |
| 739 | sizes and have the WM react accordingly which is not TRT. */ | 736 | sizes and have the WM react accordingly which is not TRT. |
| 737 | |||
| 738 | We don't that for the external menu bar on Motif. | ||
| 739 | Otherwise, switching off the menu bar will shrink the frame | ||
| 740 | and switching it on will not enlarge it. */ | ||
| 740 | { | 741 | { |
| 741 | /* But don't that for the external menu bar on Motif. | 742 | if (f->new_width >= 0) |
| 742 | Otherwise, switching off the menu bar will shrink the frame | 743 | new_native_width = f->new_width; |
| 743 | and switching it on will not enlarge it. */ | 744 | if (f->new_height >= 0) |
| 744 | #ifdef USE_MOTIF | 745 | new_native_height = f->new_height; |
| 745 | if (!EQ (parameter, Qmenu_bar_lines)) | ||
| 746 | #endif | ||
| 747 | { | ||
| 748 | new_native_width = f->new_width; | ||
| 749 | new_native_height = f->new_height; | ||
| 750 | } | ||
| 751 | } | 746 | } |
| 752 | 747 | ||
| 753 | if (CONSP (frame_size_history)) | 748 | if (CONSP (frame_size_history)) |
| @@ -763,6 +758,17 @@ adjust_frame_size (struct frame *f, int new_text_width, int new_text_height, | |||
| 763 | min_inner_width, min_inner_height, | 758 | min_inner_width, min_inner_height, |
| 764 | inhibit_horizontal, inhibit_vertical); | 759 | inhibit_horizontal, inhibit_vertical); |
| 765 | 760 | ||
| 761 | if (inhibit == 0 || inhibit == 1) | ||
| 762 | { | ||
| 763 | f->new_width = new_native_width; | ||
| 764 | f->new_height = new_native_height; | ||
| 765 | /* Resetting f->new_size_p is controversial: It might cause | ||
| 766 | do_pending_window_change drop a previous request and we are | ||
| 767 | in troubles when the window manager does not honor the | ||
| 768 | request we issue here. */ | ||
| 769 | f->new_size_p = false; | ||
| 770 | } | ||
| 771 | |||
| 766 | if (FRAME_TERMINAL (f)->set_window_size_hook) | 772 | if (FRAME_TERMINAL (f)->set_window_size_hook) |
| 767 | FRAME_TERMINAL (f)->set_window_size_hook | 773 | FRAME_TERMINAL (f)->set_window_size_hook |
| 768 | (f, 0, new_native_width, new_native_height); | 774 | (f, 0, new_native_width, new_native_height); |
diff --git a/src/frame.h b/src/frame.h index f89151c40ed..399948fa7ed 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -453,6 +453,11 @@ struct frame | |||
| 453 | frame is in the process of being redisplayed. */ | 453 | frame is in the process of being redisplayed. */ |
| 454 | bool_bf inhibit_clear_image_cache : 1; | 454 | bool_bf inhibit_clear_image_cache : 1; |
| 455 | 455 | ||
| 456 | /* True when new_width or new_height were set by change_frame_size, | ||
| 457 | false when they were set by adjust_frame_size internally or not | ||
| 458 | set. */ | ||
| 459 | bool_bf new_size_p; | ||
| 460 | |||
| 456 | /* Bitfield area ends here. */ | 461 | /* Bitfield area ends here. */ |
| 457 | 462 | ||
| 458 | /* This frame's change stamp, set the last time window change | 463 | /* This frame's change stamp, set the last time window change |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 897eade8503..81033b2b12b 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -1004,16 +1004,18 @@ void | |||
| 1004 | xg_frame_resized (struct frame *f, int width, int height) | 1004 | xg_frame_resized (struct frame *f, int width, int height) |
| 1005 | { | 1005 | { |
| 1006 | /* Ignore case where size of native rectangle didn't change. */ | 1006 | /* Ignore case where size of native rectangle didn't change. */ |
| 1007 | if (width != FRAME_PIXEL_WIDTH (f) || height != FRAME_PIXEL_HEIGHT (f) | 1007 | if (width != FRAME_PIXEL_WIDTH (f) |
| 1008 | || (delayed_size_change | 1008 | || height != FRAME_PIXEL_HEIGHT (f) |
| 1009 | && (width != f->new_width || height != f->new_height))) | 1009 | || (f->new_size_p |
| 1010 | && ((f->new_width >= 0 && width != f->new_width) | ||
| 1011 | || (f->new_height >= 0 && height != f->new_height)))) | ||
| 1010 | { | 1012 | { |
| 1011 | if (CONSP (frame_size_history)) | 1013 | if (CONSP (frame_size_history)) |
| 1012 | frame_size_history_extra | 1014 | frame_size_history_extra |
| 1013 | (f, build_string ("xg_frame_resized, changed"), | 1015 | (f, build_string ("xg_frame_resized, changed"), |
| 1014 | FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f), width, height, | 1016 | FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f), width, height, |
| 1015 | delayed_size_change ? f->new_width : -1, | 1017 | f->new_size_p ? f->new_width : -1, |
| 1016 | delayed_size_change ? f->new_height : -1); | 1018 | f->new_size_p ? f->new_height : -1); |
| 1017 | 1019 | ||
| 1018 | FRAME_RIF (f)->clear_under_internal_border (f); | 1020 | FRAME_RIF (f)->clear_under_internal_border (f); |
| 1019 | change_frame_size (f, width, height, false, true, false); | 1021 | change_frame_size (f, width, height, false, true, false); |
| @@ -1024,8 +1026,8 @@ xg_frame_resized (struct frame *f, int width, int height) | |||
| 1024 | frame_size_history_extra | 1026 | frame_size_history_extra |
| 1025 | (f, build_string ("xg_frame_resized, unchanged"), | 1027 | (f, build_string ("xg_frame_resized, unchanged"), |
| 1026 | FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f), width, height, | 1028 | FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f), width, height, |
| 1027 | delayed_size_change ? f->new_width : -1, | 1029 | f->new_size_p ? f->new_width : -1, |
| 1028 | delayed_size_change ? f->new_height : -1); | 1030 | f->new_size_p ? f->new_height : -1); |
| 1029 | 1031 | ||
| 1030 | } | 1032 | } |
| 1031 | 1033 | ||
| @@ -1180,6 +1182,12 @@ xg_frame_set_char_size (struct frame *f, int width, int height) | |||
| 1180 | the frame is mapped again we will (hopefully) get the correct size. */ | 1182 | the frame is mapped again we will (hopefully) get the correct size. */ |
| 1181 | if (FRAME_VISIBLE_P (f) && !was_visible) | 1183 | if (FRAME_VISIBLE_P (f) && !was_visible) |
| 1182 | { | 1184 | { |
| 1185 | if (CONSP (frame_size_history)) | ||
| 1186 | frame_size_history_extra | ||
| 1187 | (f, build_string ("xg_frame_set_char_size, visible"), | ||
| 1188 | FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f), width, height, | ||
| 1189 | f->new_width, f->new_height); | ||
| 1190 | |||
| 1183 | /* Must call this to flush out events */ | 1191 | /* Must call this to flush out events */ |
| 1184 | (void)gtk_events_pending (); | 1192 | (void)gtk_events_pending (); |
| 1185 | gdk_flush (); | 1193 | gdk_flush (); |
| @@ -1187,12 +1195,6 @@ xg_frame_set_char_size (struct frame *f, int width, int height) | |||
| 1187 | x_wait_for_event (f, ConfigureNotify); | 1195 | x_wait_for_event (f, ConfigureNotify); |
| 1188 | #endif | 1196 | #endif |
| 1189 | 1197 | ||
| 1190 | if (CONSP (frame_size_history)) | ||
| 1191 | frame_size_history_extra | ||
| 1192 | (f, build_string ("xg_frame_set_char_size, visible"), | ||
| 1193 | FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f), width, height, | ||
| 1194 | f->new_width, f->new_height); | ||
| 1195 | |||
| 1196 | if (!NILP (fullscreen)) | 1198 | if (!NILP (fullscreen)) |
| 1197 | /* Try to restore fullscreen state. */ | 1199 | /* Try to restore fullscreen state. */ |
| 1198 | { | 1200 | { |
diff --git a/src/nsfns.m b/src/nsfns.m index 054777aa66f..1f281f75fd4 100644 --- a/src/nsfns.m +++ b/src/nsfns.m | |||
| @@ -668,11 +668,7 @@ ns_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) | |||
| 668 | } | 668 | } |
| 669 | } | 669 | } |
| 670 | 670 | ||
| 671 | { | 671 | adjust_frame_size (f, -1, -1, 2, false, Qtool_bar_lines); |
| 672 | NSTRACE_MSG ("inhibit:%d", inhibit); | ||
| 673 | |||
| 674 | adjust_frame_size (f, -1, -1, 2, false, Qtool_bar_lines); | ||
| 675 | } | ||
| 676 | } | 672 | } |
| 677 | 673 | ||
| 678 | static void | 674 | static void |
| @@ -1070,7 +1066,6 @@ DEFUN ("x-create-frame", Fx_create_frame, Sx_create_frame, | |||
| 1070 | Lisp_Object parent, parent_frame; | 1066 | Lisp_Object parent, parent_frame; |
| 1071 | struct kboard *kb; | 1067 | struct kboard *kb; |
| 1072 | static int desc_ctr = 1; | 1068 | static int desc_ctr = 1; |
| 1073 | int x_width = 0, x_height = 0; | ||
| 1074 | 1069 | ||
| 1075 | /* gui_display_get_arg modifies parms. */ | 1070 | /* gui_display_get_arg modifies parms. */ |
| 1076 | parms = Fcopy_alist (parms); | 1071 | parms = Fcopy_alist (parms); |
diff --git a/src/nsterm.m b/src/nsterm.m index b135e359f5d..6e7ab1266ba 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -7296,7 +7296,7 @@ not_in_argv (NSString *arg) | |||
| 7296 | - (void)viewDidResize:(NSNotification *)notification | 7296 | - (void)viewDidResize:(NSNotification *)notification |
| 7297 | { | 7297 | { |
| 7298 | NSRect frame = [self frame]; | 7298 | NSRect frame = [self frame]; |
| 7299 | int neww, newh; | 7299 | int neww, newh, oldw, oldh; |
| 7300 | 7300 | ||
| 7301 | if (! FRAME_LIVE_P (emacsframe)) | 7301 | if (! FRAME_LIVE_P (emacsframe)) |
| 7302 | return; | 7302 | return; |
| @@ -7305,25 +7305,25 @@ not_in_argv (NSString *arg) | |||
| 7305 | 7305 | ||
| 7306 | neww = (int)NSWidth (frame); | 7306 | neww = (int)NSWidth (frame); |
| 7307 | newh = (int)NSHeight (frame); | 7307 | newh = (int)NSHeight (frame); |
| 7308 | oldw = FRAME_PIXEL_WIDTH (emacsframe); | ||
| 7309 | oldh = FRAME_PIXEL_HEIGHT (emacsframe); | ||
| 7310 | |||
| 7311 | /* Don't want to do anything when the view size hasn't changed. */ | ||
| 7312 | if ((oldh == newh && oldw == neww) | ||
| 7313 | || (emacsframe->new_size_p | ||
| 7314 | && newh == emacsframe->new_height | ||
| 7315 | && neww == emacsframe->new_width)) | ||
| 7316 | { | ||
| 7317 | NSTRACE_MSG ("No change"); | ||
| 7318 | return; | ||
| 7319 | } | ||
| 7320 | |||
| 7308 | NSTRACE_SIZE ("New size", NSMakeSize (neww, newh)); | 7321 | NSTRACE_SIZE ("New size", NSMakeSize (neww, newh)); |
| 7322 | NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh)); | ||
| 7309 | 7323 | ||
| 7310 | #ifdef NS_DRAW_TO_BUFFER | 7324 | #ifdef NS_DRAW_TO_BUFFER |
| 7311 | if ([self wantsUpdateLayer]) | 7325 | if ([self wantsUpdateLayer]) |
| 7312 | { | 7326 | { |
| 7313 | CGFloat scale = [[self window] backingScaleFactor]; | ||
| 7314 | NSSize size = [surface getSize]; | ||
| 7315 | int oldw = size.width / scale; | ||
| 7316 | int oldh = size.height / scale; | ||
| 7317 | |||
| 7318 | NSTRACE_SIZE ("Original size", NSMakeSize (oldw, oldh)); | ||
| 7319 | |||
| 7320 | /* Don't want to do anything when the view size hasn't changed. */ | ||
| 7321 | if ((oldh == newh && oldw == neww)) | ||
| 7322 | { | ||
| 7323 | NSTRACE_MSG ("No change"); | ||
| 7324 | return; | ||
| 7325 | } | ||
| 7326 | |||
| 7327 | [surface release]; | 7327 | [surface release]; |
| 7328 | surface = nil; | 7328 | surface = nil; |
| 7329 | 7329 | ||
| @@ -7331,10 +7331,6 @@ not_in_argv (NSString *arg) | |||
| 7331 | } | 7331 | } |
| 7332 | #endif | 7332 | #endif |
| 7333 | 7333 | ||
| 7334 | /* I'm not sure if it's safe to call this every time the view | ||
| 7335 | changes size, as Emacs may already know about the change. | ||
| 7336 | Unfortunately there doesn't seem to be a bullet-proof method of | ||
| 7337 | determining whether we need to call it or not. */ | ||
| 7338 | change_frame_size (emacsframe, neww, newh, false, YES, false); | 7334 | change_frame_size (emacsframe, neww, newh, false, YES, false); |
| 7339 | 7335 | ||
| 7340 | SET_FRAME_GARBAGED (emacsframe); | 7336 | SET_FRAME_GARBAGED (emacsframe); |
diff --git a/src/xterm.c b/src/xterm.c index 5049f72ca63..189e3a47eea 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -9071,8 +9071,9 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 9071 | to check the pixel dimensions as well. */ | 9071 | to check the pixel dimensions as well. */ |
| 9072 | if (width != FRAME_PIXEL_WIDTH (f) | 9072 | if (width != FRAME_PIXEL_WIDTH (f) |
| 9073 | || height != FRAME_PIXEL_HEIGHT (f) | 9073 | || height != FRAME_PIXEL_HEIGHT (f) |
| 9074 | || (delayed_size_change | 9074 | || (f->new_size_p |
| 9075 | && (width != f->new_width || height != f->new_height))) | 9075 | && ((f->new_width >= 0 && width != f->new_width) |
| 9076 | || (f->new_height >= 0 && height != f->new_height)))) | ||
| 9076 | { | 9077 | { |
| 9077 | change_frame_size (f, width, height, false, true, false); | 9078 | change_frame_size (f, width, height, false, true, false); |
| 9078 | x_clear_under_internal_border (f); | 9079 | x_clear_under_internal_border (f); |