From: Po Lu Date: Tue, 16 Nov 2021 09:51:07 +0000 (+0800) Subject: Lower xwidget views owned by parent when lowering frame X-Git-Tag: emacs-29.0.90~2852^2~254 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8d0c19fb0c368692f4b17728c0eaf3e16e0c70f7;p=emacs.git Lower xwidget views owned by parent when lowering frame * src/xterm.c (x_lower_frame): Lower parent frame's xwidget views as well. * src/xwidget.h (lower_frame_xwidget_views): * src/xwidget.c (lower_frame_xwidget_views): New function. --- diff --git a/src/xterm.c b/src/xterm.c index 5988d3a15fb..816b6dc5a8b 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -11723,6 +11723,13 @@ x_lower_frame (struct frame *f) XFlush (FRAME_X_DISPLAY (f)); unblock_input (); } +#ifdef HAVE_XWIDGETS + /* Make sure any X windows owned by xwidget views of the parent + still display below the lowered frame. */ + + if (FRAME_PARENT_FRAME (f)) + lower_frame_xwidget_views (FRAME_PARENT_FRAME (f)); +#endif } static void diff --git a/src/xwidget.c b/src/xwidget.c index 008eb07bcae..650572a8896 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -2810,6 +2810,20 @@ xwidget_end_redisplay (struct window *w, struct glyph_matrix *matrix) } #ifdef USE_GTK +void +lower_frame_xwidget_views (struct frame *f) +{ + struct xwidget_view *xv; + + for (Lisp_Object tail = internal_xwidget_view_list; CONSP (tail); + tail = XCDR (tail)) + { + xv = XXWIDGET_VIEW (XCAR (tail)); + if (xv->frame == f && xv->wdesc != None) + XLowerWindow (xv->dpy, xv->wdesc); + } +} + void kill_frame_xwidget_views (struct frame *f) { diff --git a/src/xwidget.h b/src/xwidget.h index df55dacffef..2f6d0442e20 100644 --- a/src/xwidget.h +++ b/src/xwidget.h @@ -188,6 +188,7 @@ extern struct xwidget *xwidget_from_id (uint32_t id); #ifdef HAVE_X_WINDOWS struct xwidget_view *xwidget_view_from_window (Window wdesc); void xwidget_expose (struct xwidget_view *xv); +extern void lower_frame_xwidget_views (struct frame *f); extern void kill_frame_xwidget_views (struct frame *f); extern void xwidget_button (struct xwidget_view *, bool, int, int, int, int, Time);