summaryrefslogtreecommitdiff
path: root/src/xwidget.h
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2021-10-29 11:33:06 +0800
committerLars Ingebrigtsen <larsi@gnus.org>2021-11-07 02:59:39 +0100
commit5c387ad437872c6e95599710ba5dcdfaa470c5ea (patch)
treedb21cc292335e934f1eb93509828426fee40d0fa /src/xwidget.h
parent61d049aaff2ede48d3d4b357bc1cb06447f15229 (diff)
downloademacs-5c387ad437872c6e95599710ba5dcdfaa470c5ea.tar.gz
Enable scrolling optimization for xwidgets
* src/dispextern.h (struct glyph): Store xwidget ID instead of a reference. * src/dispnew.c (scrolling_window): Enable scrolling optimization on xwidget builds. * src/xdisp.c (fill_xwidget_glyph_string, produce_xwidget_glyph): Obtain xwidget from ID. * src/xterm.c (x_scroll_run): Scroll xwidget windows. * src/xwidget.c (id_to_xwidget_map, xwidget_counter): New xwidget variables. (Fmake_xwidget): Assign each xwidget a unique ID, and keep track of that ID. (xwidget_from_id): New function. (syms_of_xwidget): Initialize id_to_xwidget_map. (xwidget_end_redisplay): Lookup xwidgets via ID. * src/xwidget.h (struct xwidget): Add ID field. (xwidget_from_id): New function.
Diffstat (limited to 'src/xwidget.h')
-rw-r--r--src/xwidget.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/xwidget.h b/src/xwidget.h
index fc68b52cdb5..28098c0b09f 100644
--- a/src/xwidget.h
+++ b/src/xwidget.h
@@ -60,6 +60,7 @@ struct xwidget
int height;
int width;
+ uint32_t xwidget_id;
#if defined (USE_GTK)
/* For offscreen widgets, unused if not osr. */
@@ -168,6 +169,8 @@ void store_xwidget_js_callback_event (struct xwidget *xw,
Lisp_Object argument);
struct xwidget_view *xwidget_view_from_window (Window wdesc);
void xwidget_expose (struct xwidget_view *xv);
+
+extern struct xwidget *xwidget_from_id (uint32_t id);
#else
INLINE_HEADER_BEGIN
INLINE void syms_of_xwidget (void) {}