From 1eea231d3ebcc2801fe1a8459e60fdb687631ba9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Jadi?= Date: Thu, 18 Jul 2013 14:12:03 +0200 Subject: [PATCH] * src/xwidget.c (Fset_frame_visible): Hack to force a frame to be considered as visible to trigger the display engine. * lisp/xwidget.el (xwidget-display): Force the display engine to create a xwidget_view of the given xwidget. --- lisp/xwidget.el | 8 +++++++- src/xwidget.c | 12 ++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 81589e3d57d..b38f7948c6c 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el @@ -58,7 +58,13 @@ see `make-xwidget' for types suitable for TYPE." ;; ;; (start-process "xembed2" "*xembed2*" "uzbl-core" "-s" (number-to-string xembed-id) "http://www.fsf.org" ) ) ;; ))))) - +(defun xwidget-display (xwidget) + "Force xwidget to be displayed to create a xwidget_view." + (let* ((buffer (xwidget-buffer xwidget)) + (window (display-buffer buffer)) + (frame (window-frame window))) + (set-frame-visible frame t) + (redisplay t))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/src/xwidget.c b/src/xwidget.c index 28bb056954e..660c4ef9961 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -1554,6 +1554,17 @@ WINDOW if specified, otherwise it uses the selected window. */) return Qnil; } +DEFUN ("set-frame-visible", Fset_frame_visible, Sset_frame_visible, + 2, 2, 0, + doc: /* HACKY */) + (Lisp_Object frame, Lisp_Object flag) +{ + CHECK_FRAME (frame); + struct frame *f = XFRAME (frame); + SET_FRAME_VISIBLE (f, !NILP (flag)); + return flag; +} + DEFUN ("xwidget-plist", Fxwidget_plist, Sxwidget_plist, 1, 1, 0, doc: /* Return the plist of XWIDGET. */) @@ -1627,6 +1638,7 @@ syms_of_xwidget (void) defsubr (&Sxwidget_view_lookup); defsubr (&Sxwidget_query_on_exit_flag); defsubr (&Sset_xwidget_query_on_exit_flag); + defsubr (&Sset_frame_visible); #ifdef HAVE_WEBKIT_OSR defsubr (&Sxwidget_webkit_goto_uri); -- 2.39.2