From 43618cd44c44568947732aacfe99919f25202343 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sat, 15 Jan 2022 05:30:28 +0000 Subject: [PATCH] Find a way to make lowering frames work on Haiku * doc/lispref/frames.texi (Raising and Lowering): Document that lowering frames is now supported on Haiku. * src/haikuterm.c (haiku_frame_raise_lower): Implement a hack to lower frames. --- doc/lispref/frames.texi | 6 ++---- src/haikuterm.c | 7 +++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index ca7d9ada0ba..2eeb8b7ed74 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi @@ -3154,10 +3154,8 @@ raises @var{frame} above all other child frames of its parent. @deffn Command lower-frame &optional frame This function lowers frame @var{frame} (default, the selected frame) below all other frames belonging to the same or a higher z-group as -@var{frame}.@footnote{Lowering frames is not supported on Haiku, due -to limitations imposed by the system.} If @var{frame} is a child -frame (@pxref{Child Frames}), this lowers @var{frame} below all other -child frames of its parent. +@var{frame}. If @var{frame} is a child frame (@pxref{Child Frames}), +this lowers @var{frame} below all other child frames of its parent. @end deffn @defun frame-restack frame1 frame2 &optional above diff --git a/src/haikuterm.c b/src/haikuterm.c index 3e99cc1c8d9..ad89985b748 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -370,6 +370,13 @@ haiku_frame_raise_lower (struct frame *f, bool raise_p) BWindow_sync (FRAME_HAIKU_WINDOW (f)); unblock_input (); } + else + { + block_input (); + BWindow_send_behind (FRAME_HAIKU_WINDOW (f), NULL); + BWindow_sync (FRAME_HAIKU_WINDOW (f)); + unblock_input (); + } } /* Unfortunately, NOACTIVATE is not implementable on Haiku. */ -- 2.39.2