From: Po Lu Date: Sun, 6 Mar 2022 07:13:07 +0000 (+0000) Subject: Implement frame cascading on Haiku X-Git-Tag: emacs-29.0.90~1996 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0adb2d507cdf386f2cc8b4fb6c5bfc953fec42e8;p=emacs.git Implement frame cascading on Haiku * haikufns.c (haiku_create_frame): Cascade frame position with the focused frame if position is not user or programmer specified. --- diff --git a/src/haikufns.c b/src/haikufns.c index 545edb27ae0..24e4613e3ee 100644 --- a/src/haikufns.c +++ b/src/haikufns.c @@ -565,7 +565,7 @@ unwind_popup (void) static Lisp_Object haiku_create_frame (Lisp_Object parms) { - struct frame *f; + struct frame *f, *cascade_target; Lisp_Object frame, tem; Lisp_Object name; bool minibuffer_only = false; @@ -575,6 +575,13 @@ haiku_create_frame (Lisp_Object parms) struct haiku_display_info *dpyinfo = NULL; struct kboard *kb; + if (x_display_list->focused_frame) + cascade_target = x_display_list->focused_frame; + else if (x_display_list->focus_event_frame) + cascade_target = x_display_list->focus_event_frame; + else + cascade_target = NULL; + parms = Fcopy_alist (parms); Vx_resource_name = Vinvocation_name; @@ -888,6 +895,9 @@ haiku_create_frame (Lisp_Object parms) block_input (); if (window_prompting & (USPosition | PPosition)) haiku_set_offset (f, f->left_pos, f->top_pos, 1); + else if (cascade_target) + haiku_set_offset (f, cascade_target->left_pos + 15, + cascade_target->top_pos + 15, 1); else BWindow_center_on_screen (FRAME_HAIKU_WINDOW (f)); unblock_input ();