unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#51679: 29.0.50; [PATCH] Fix resize of xwidgets on GTK
       [not found] <87v913qkm2.fsf.ref@yahoo.com>
@ 2021-11-08  5:31 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-08  5:34   ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-08  5:31 UTC (permalink / raw)
  To: 51679

[-- Attachment #1: Type: text/plain, Size: 143 bytes --]


gtk_container_resize_children doesn't always work, and the canonical way
to force a re-allocation is to just call gtk_widget_queue_allocate.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-resize-of-xwidgets-on-GTK.patch --]
[-- Type: text/x-patch, Size: 1033 bytes --]

From 5e5cf7276736ddf82d7b56e507500f4267a794ee Mon Sep 17 00:00:00 2001
From: Po Lu <luangruo@yahoo.com>
Date: Mon, 8 Nov 2021 13:29:44 +0800
Subject: [PATCH] Fix resize of xwidgets on GTK

* src/xwidget.c (Fxwidget_resize): Queue widget for re-allocation
after setting its size request.
---
 src/xwidget.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/xwidget.c b/src/xwidget.c
index ecb973f485..1815a39ab6 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -1740,9 +1740,10 @@ DEFUN ("xwidget-resize", Fxwidget_resize, Sxwidget_resize, 3, 3, 0,
     {
       gtk_window_resize (GTK_WINDOW (xw->widgetwindow_osr), xw->width,
                          xw->height);
-      gtk_container_resize_children (GTK_CONTAINER (xw->widgetwindow_osr));
       gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width,
                                    xw->height);
+
+      gtk_widget_queue_allocate (GTK_WIDGET (xw->widget_osr));
     }
 #elif defined NS_IMPL_COCOA
   nsxwidget_resize (xw);
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* bug#51679: 29.0.50; [PATCH] Fix resize of xwidgets on GTK
  2021-11-08  5:31 ` bug#51679: 29.0.50; [PATCH] Fix resize of xwidgets on GTK Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-11-08  5:34   ` Lars Ingebrigtsen
  2021-11-08  5:41     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-08  5:34 UTC (permalink / raw)
  To: Po Lu; +Cc: 51679

Thanks; applied to Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51679: 29.0.50; [PATCH] Fix resize of xwidgets on GTK
  2021-11-08  5:34   ` Lars Ingebrigtsen
@ 2021-11-08  5:41     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-08  6:43       ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-08  5:41 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 51679

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Thanks; applied to Emacs 29.

This is a trivial solution to problem that also exists in Emacs 28, so
perhaps it could be applied there too?

Thanks.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51679: 29.0.50; [PATCH] Fix resize of xwidgets on GTK
  2021-11-08  5:41     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-11-08  6:43       ` Lars Ingebrigtsen
  2021-11-08  6:57         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-08 13:07         ` Eli Zaretskii
  0 siblings, 2 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-08  6:43 UTC (permalink / raw)
  To: Po Lu; +Cc: 51679

Po Lu <luangruo@yahoo.com> writes:

> This is a trivial solution to problem that also exists in Emacs 28, so
> perhaps it could be applied there too?

It's probably not a regression, though?  So it may be too late to put it
into Emacs 28.  Eli, what's your opinion?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51679: 29.0.50; [PATCH] Fix resize of xwidgets on GTK
  2021-11-08  6:43       ` Lars Ingebrigtsen
@ 2021-11-08  6:57         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-11-09  3:24           ` Lars Ingebrigtsen
  2021-11-08 13:07         ` Eli Zaretskii
  1 sibling, 1 reply; 8+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-08  6:57 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Eli Zaretskii, 51679

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> This is a trivial solution to problem that also exists in Emacs 28, so
>> perhaps it could be applied there too?

> It's probably not a regression, though?  So it may be too late to put it
> into Emacs 28.  Eli, what's your opinion?

The bug this change fixes existed way back in Emacs 25, FWIW.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51679: 29.0.50; [PATCH] Fix resize of xwidgets on GTK
  2021-11-08  6:43       ` Lars Ingebrigtsen
  2021-11-08  6:57         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-11-08 13:07         ` Eli Zaretskii
  1 sibling, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2021-11-08 13:07 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: luangruo, 51679

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: 51679@debbugs.gnu.org, Eli Zaretskii <eliz@gnu.org>
> Date: Mon, 08 Nov 2021 07:43:35 +0100
> 
> Po Lu <luangruo@yahoo.com> writes:
> 
> > This is a trivial solution to problem that also exists in Emacs 28, so
> > perhaps it could be applied there too?
> 
> It's probably not a regression, though?  So it may be too late to put it
> into Emacs 28.  Eli, what's your opinion?

I don't know.  xwidget code has a relatively high probability of
causing crashes, but if the original code already causes trouble,
maybe it's okay.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51679: 29.0.50; [PATCH] Fix resize of xwidgets on GTK
  2021-11-08  6:57         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2021-11-09  3:24           ` Lars Ingebrigtsen
  2021-11-09  3:25             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-11-09  3:24 UTC (permalink / raw)
  To: Po Lu; +Cc: 51679

Po Lu <luangruo@yahoo.com> writes:

>>> This is a trivial solution to problem that also exists in Emacs 28, so
>>> perhaps it could be applied there too?
>
>> It's probably not a regression, though?  So it may be too late to put it
>> into Emacs 28.  Eli, what's your opinion?
>
> The bug this change fixes existed way back in Emacs 25, FWIW.

OK, then I'd rather not push it to emacs-28 -- it the bug's existed that
long, it doesn't seem to be vital to fix it in Emacs 28.1 now.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#51679: 29.0.50; [PATCH] Fix resize of xwidgets on GTK
  2021-11-09  3:24           ` Lars Ingebrigtsen
@ 2021-11-09  3:25             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 8+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-11-09  3:25 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: Eli Zaretskii, 51679

Lars Ingebrigtsen <larsi@gnus.org> writes:

> OK, then I'd rather not push it to emacs-28 -- it the bug's existed that
> long, it doesn't seem to be vital to fix it in Emacs 28.1 now.

Fair enough, thanks.





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-09  3:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <87v913qkm2.fsf.ref@yahoo.com>
2021-11-08  5:31 ` bug#51679: 29.0.50; [PATCH] Fix resize of xwidgets on GTK Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-08  5:34   ` Lars Ingebrigtsen
2021-11-08  5:41     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-08  6:43       ` Lars Ingebrigtsen
2021-11-08  6:57         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-09  3:24           ` Lars Ingebrigtsen
2021-11-09  3:25             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-08 13:07         ` Eli Zaretskii

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).