Subject: Re: bug#51674: 29.0.50; [PATCH] Fix hang when displaying xwidget script dialog

From: Po Lu <[email-masked]>
Date: Mon, 08 Nov 2021 14:29:51 +0800

Lars Ingebrigtsen <[email-masked]> writes:

> (progn
>   (require 'xwidget)
>   (setq widget (make-xwidget 'webkit
> 			     "Video"
> 			     700
> 			     500
> 			     nil
> 			     (current-buffer)
> 			     (xwidget-webkit-current-session)))
>   (insert
>    (propertize
>     "[video]"
>     'display (list 'xwidget :xwidget widget)))
>   (xwidget-put widget 'callback #'always))

> (xwidget-webkit-goto-uri widget "file:///tmp/vid.html")

> will play the .mp4 video...  but only on Macos.  On this Debian laptop,
> it just shows the controls, and doesn't play the mp4.  Is this due to
> platform specific limitations?  (It won't play Youtube, either, with the
> normal `xwidget-webkit-browse-url'.)

That's weird, because video works here.  Does it work in another
WebKitGTK based browser, like Epiphany, on your Debian system?  Thanks.

> But on Macos there's a different twist: It doesn't heed the width/height
> specs, and always maximises itself to fill the frame.  Which seems like
> a bug.

Unfortunately I don't know enough about macOS to solve the problem here.

But try removing this snippet of x_draw_xwidget_glyph_string:

  /* On X11, this keeps generating expose events.  */
#ifndef USE_GTK
  /* Resize xwidget webkit if its container window size is changed in
     some ways, for example, a buffer became hidden in small split
     window, then it can appear front in merged whole window.  */
  if (EQ (xww->type, Qwebkit)
      && (xww->width != text_area_width || xww->height != text_area_height))
    {
      Lisp_Object xwl;
      XSETXWIDGET (xwl, xww);
      Fxwidget_resize (xwl,
                       make_int (text_area_width),
                       make_int (text_area_height));
    }
#endif