]> git.eshelyaron.com Git - emacs.git/commit
Use an X window to display xwidgets on X11
authorPo Lu <luangruo@yahoo.com>
Thu, 28 Oct 2021 13:46:01 +0000 (21:46 +0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 7 Nov 2021 01:59:39 +0000 (02:59 +0100)
commit61d049aaff2ede48d3d4b357bc1cb06447f15229
tree3fd188d55dcd396e135469b67fa85cf1966fd9f1
parentd69b5a9caaf7697eb70b9eb5e63fae8b94ccd798
Use an X window to display xwidgets on X11

Since Emacs draws using X11 primitives, Emacs drawing operations can
erase the GtkDrawingArea used to draw the offscreen widget, which
leads to unpleasant flickering effects, all of which can be prevented
by creating a native X window and drawing to that instead.

* src/xterm.c (x_window_to_frame): Return xwidget window if
appropriate.
(handle_one_xevent): Handle xwidget expose events.

* src/xwidget.c (x_window_to_xvw_map): New variable.
(xwidget_view_from_window): New function.

(xwidget_show_view, xwidget_hide_view)
(offscreen_damage_event): Move to drawing xwidgets with X windows.

(xv_do_draw)
(xwidget_expose): New function.

(xwidget_osr_draw_cb, xwidget_osr_event_forward)
(xwidget_osr_event_set_embedder): Removed.

(xwidget_init_view): Replace use of GtkDrawingArea with that of an X
window.

(x_draw_xwidget_glyph_string): Prevent xwidget views from constantly
generating expose events, and use an X window instead of a
GtkDrawingArea.

(syms_of_xwidget): Initialize x_window_to_xwv_map.

src/xwidget.h (struct xwidget_view): Replace GTK widgets with
X-related fields.

(xwidget_view_from_window, xwidget_expose): New functions.
src/xterm.c
src/xwidget.c
src/xwidget.h