* Re: emacs-27 c49d379: Fix some problems with moving and resizing child frames
[not found] ` <20200406072406.9C05720A26@vcs0.savannah.gnu.org>
@ 2020-04-08 3:33 ` Dmitry Gutov
2020-04-08 9:21 ` martin rudalics
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Gutov @ 2020-04-08 3:33 UTC (permalink / raw)
To: emacs-devel, Martin Rudalics
[-- Attachment #1: Type: text/plain, Size: 559 bytes --]
Hi Martin,
On 06.04.2020 10:24, Martin Rudalics wrote:
> +
> + if (totalwidth != gwidth || totalheight != gheight)
> + {
Speaking of this optimization, can we make it apply to 'resize-mode'
child frames too?
I've been doing some testing, and in certain situations, the value
'hide' actually seems more performant when the size doesn't need to be
changed. This largely makes a difference when, at random times, the
child frame takes ~100ms to resize (which corresponds to the value of
x-wait-for-event-timeout).
The attached patch seems to help.
[-- Attachment #2: speedup_childframe_resizing.diff --]
[-- Type: text/x-patch, Size: 1787 bytes --]
diff --git a/src/gtkutil.c b/src/gtkutil.c
index e374bdbe03..9fcaeed097 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -954,6 +954,7 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
= pixelheight + FRAME_TOOLBAR_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f);
int totalwidth = pixelwidth + FRAME_TOOLBAR_WIDTH (f);
bool was_visible = false;
+ bool hide_child_frame = false;
if (FRAME_PIXEL_HEIGHT (f) == 0)
return;
@@ -996,26 +997,33 @@ xg_frame_set_char_size (struct frame *f, int width, int height)
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
totalwidth, gheight);
}
- else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f)
- && EQ (x_gtk_resize_child_frames, Qhide))
+ else if (FRAME_PARENT_FRAME (f) && FRAME_VISIBLE_P (f))
{
was_visible = true;
+ hide_child_frame = EQ (x_gtk_resize_child_frames, Qhide);
if (totalwidth != gwidth || totalheight != gheight)
{
frame_size_history_add
(f, Qxg_frame_set_char_size_4, width, height,
list2i (totalwidth, totalheight));
- block_input ();
- gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f));
- unblock_input ();
+
+ if (hide_child_frame)
+ {
+ block_input ();
+ gtk_widget_hide (FRAME_GTK_OUTER_WIDGET (f));
+ unblock_input ();
+ }
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
totalwidth, totalheight);
- block_input ();
- gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
- unblock_input ();
+ if (hide_child_frame)
+ {
+ block_input ();
+ gtk_widget_show_all (FRAME_GTK_OUTER_WIDGET (f));
+ unblock_input ();
+ }
fullscreen = Qnil;
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: emacs-27 c49d379: Fix some problems with moving and resizing child frames
2020-04-08 3:33 ` emacs-27 c49d379: Fix some problems with moving and resizing child frames Dmitry Gutov
@ 2020-04-08 9:21 ` martin rudalics
2020-04-08 9:48 ` Eli Zaretskii
0 siblings, 1 reply; 4+ messages in thread
From: martin rudalics @ 2020-04-08 9:21 UTC (permalink / raw)
To: Dmitry Gutov, emacs-devel
> The attached patch seems to help.
OK with me and since the change affects child frames only I suppose Eli
won't object either.
martin
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: emacs-27 c49d379: Fix some problems with moving and resizing child frames
2020-04-08 9:21 ` martin rudalics
@ 2020-04-08 9:48 ` Eli Zaretskii
2020-04-08 11:08 ` Dmitry Gutov
0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2020-04-08 9:48 UTC (permalink / raw)
To: martin rudalics; +Cc: emacs-devel, dgutov
> From: martin rudalics <rudalics@gmx.at>
> Date: Wed, 8 Apr 2020 11:21:23 +0200
>
> > The attached patch seems to help.
>
> OK with me and since the change affects child frames only I suppose Eli
> won't object either.
I don't object, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: emacs-27 c49d379: Fix some problems with moving and resizing child frames
2020-04-08 9:48 ` Eli Zaretskii
@ 2020-04-08 11:08 ` Dmitry Gutov
0 siblings, 0 replies; 4+ messages in thread
From: Dmitry Gutov @ 2020-04-08 11:08 UTC (permalink / raw)
To: Eli Zaretskii, martin rudalics; +Cc: emacs-devel
On 08.04.2020 12:48, Eli Zaretskii wrote:
>> From: martin rudalics<rudalics@gmx.at>
>> Date: Wed, 8 Apr 2020 11:21:23 +0200
>>
>> > The attached patch seems to help.
>>
>> OK with me and since the change affects child frames only I suppose Eli
>> won't object either.
> I don't object, thanks.
Thanks, pushed.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-04-08 11:08 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200406072405.19842.29678@vcs0.savannah.gnu.org>
[not found] ` <20200406072406.9C05720A26@vcs0.savannah.gnu.org>
2020-04-08 3:33 ` emacs-27 c49d379: Fix some problems with moving and resizing child frames Dmitry Gutov
2020-04-08 9:21 ` martin rudalics
2020-04-08 9:48 ` Eli Zaretskii
2020-04-08 11:08 ` Dmitry Gutov
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).