[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/pgtk ae3bb14 029/100: implement restacking and cleanup frame z o
From: |
Yuuki Harano |
Subject: |
feature/pgtk ae3bb14 029/100: implement restacking and cleanup frame z order |
Date: |
Tue, 24 Nov 2020 08:02:30 -0500 (EST) |
branch: feature/pgtk
commit ae3bb140912827c38e7033c07851a94ba710428d
Author: Yuuki Harano <masm+github@masm11.me>
Commit: Jeff Walsh <fejfighter@gmail.com>
implement restacking and cleanup frame z order
src/pgtkfns.c:
(pgtk_frame_restack, Fpgtk_frame_restack, syms_of_pgtkfns):
pgtk-frame-restack を実装だけ。
ついでに、pgtk-frame-list-z-order は無意味なので削除した。
---
src/pgtkfns.c | 54 +++++++++++++++++++++++++-----------------------------
1 file changed, 25 insertions(+), 29 deletions(-)
diff --git a/src/pgtkfns.c b/src/pgtkfns.c
index 52fc656..88702f17 100644
--- a/src/pgtkfns.c
+++ b/src/pgtkfns.c
@@ -1481,20 +1481,23 @@ pgtk_window_is_ancestor (PGTKWindow *win, PGTKWindow
*candidate)
}
#endif
-DEFUN ("pgtk-frame-list-z-order", Fpgtk_frame_list_z_order,
- Spgtk_frame_list_z_order, 0, 1, 0,
- doc: /* Return list of Emacs' frames, in Z (stacking) order.
-If TERMINAL is non-nil and specifies a live frame, return the child
-frames of that frame in Z (stacking) order.
-
-Frames are listed from topmost (first) to bottommost (last).
-
-On PGTK, this function is identical to frame-list. */)
- (Lisp_Object terminal)
+/**
+ * x_frame_restack:
+ *
+ * Restack frame F1 below frame F2, above if ABOVE_FLAG is non-nil. In
+ * practice this is a two-step action: The first step removes F1's
+ * window-system window from the display. The second step reinserts
+ * F1's window below (above if ABOVE_FLAG is true) that of F2.
+ */
+static void
+pgtk_frame_restack (struct frame *f1, struct frame *f2, bool above_flag)
{
- return Fframe_list();
+ block_input ();
+ xg_frame_restack (f1, f2, above_flag);
+ unblock_input ();
}
+
DEFUN ("pgtk-frame-restack", Fpgtk_frame_restack, Spgtk_frame_restack, 2, 3, 0,
doc: /* Restack FRAME1 below FRAME2.
This means that if both frames are visible and the display areas of
@@ -1503,29 +1506,23 @@ third argument ABOVE is non-nil, restack FRAME1 above
FRAME2. This
means that if both frames are visible and the display areas of these
frames overlap, FRAME1 (partially) obscures FRAME2.
+This may be thought of as an atomic action performed in two steps: The
+first step removes FRAME1's window-step window from the display. The
+second step reinserts FRAME1's window below (above if ABOVE is true)
+that of FRAME2. Hence the position of FRAME2 in its display's Z
+\(stacking) order relative to all other frames excluding FRAME1 remains
+unaltered.
+
Some window managers may refuse to restack windows. */)
(Lisp_Object frame1, Lisp_Object frame2, Lisp_Object above)
{
struct frame *f1 = decode_live_frame (frame1);
struct frame *f2 = decode_live_frame (frame2);
- if (FRAME_PGTK_VIEW (f1) && FRAME_PGTK_VIEW (f2))
- {
-#if 0
- PGTKWindow *window = [FRAME_PGTK_VIEW (f1) window];
- NSInteger window2 = [[FRAME_PGTK_VIEW (f2) window] windowNumber];
- PGTKWindowOrderingMode flag = NILP (above) ? PGTKWindowBelow :
PGTKWindowAbove;
-
- [window orderWindow: flag
- relativeTo: window2];
-#endif
- return Qt;
- }
- else
- {
- error ("Cannot restack frames");
- return Qnil;
- }
+ if (! (FRAME_GTK_OUTER_WIDGET (f1) && FRAME_GTK_OUTER_WIDGET (f2)))
+ error ("Cannot restack frames");
+ pgtk_frame_restack (f1, f2, !NILP (above));
+ return Qt;
}
#ifdef HAVE_GSETTINGS
@@ -2975,7 +2972,6 @@ be used as the image of the icon representing the frame.
*/);
defsubr (&Spgtk_display_monitor_attributes_list);
defsubr (&Spgtk_frame_geometry);
defsubr (&Spgtk_frame_edges);
- defsubr (&Spgtk_frame_list_z_order);
defsubr (&Spgtk_frame_restack);
defsubr (&Spgtk_set_mouse_absolute_pixel_position);
defsubr (&Spgtk_mouse_absolute_pixel_position);
- feature/pgtk d6ef9af 100/100: Fix crash when .schema.xml is not installed, (continued)
- feature/pgtk d6ef9af 100/100: Fix crash when .schema.xml is not installed, Yuuki Harano, 2020/11/24
- feature/pgtk 12cc104 009/100: Cleanup x_* to gui_ to match upstream work, Yuuki Harano, 2020/11/24
- feature/pgtk fde74fa 028/100: implement pgtk-frame-list-z-order same as frame-list., Yuuki Harano, 2020/11/24
- feature/pgtk c9e6b44 044/100: Some work toward posframe on wayland, Yuuki Harano, 2020/11/24
- feature/pgtk 964dfcf 062/100: * src/pgtkgui.h: change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk da3c351 019/100: border_color/pixel width, Yuuki Harano, 2020/11/24
- feature/pgtk 014d56f 052/100: * src/pgtkterm.c: Remove incorrect mark_object call., Yuuki Harano, 2020/11/24
- feature/pgtk bc35a1e 032/100: Make multipdisplay work by limiting selection while enabed, Yuuki Harano, 2020/11/24
- feature/pgtk d68633b 056/100: * src/pgtkterm.c (pgtk_defined_color): support gtk special colors, Yuuki Harano, 2020/11/24
- feature/pgtk 6957f94 024/100: Add PGTK support for fullscreen, Yuuki Harano, 2020/11/24
- feature/pgtk ae3bb14 029/100: implement restacking and cleanup frame z order,
Yuuki Harano <=
- feature/pgtk 49645df 047/100: minimize gtkutil.c differences., Yuuki Harano, 2020/11/24
- feature/pgtk d2a29e8 040/100: emacsclient should use both of DISPLAY and WAYLAND_DISPLAY., Yuuki Harano, 2020/11/24
- feature/pgtk be47e34 077/100: Re-port image drawing code from X, Yuuki Harano, 2020/11/24
- feature/pgtk 0b69b73 085/100: Fix crash when child frame updates toolbar, Yuuki Harano, 2020/11/24
- feature/pgtk 1d549fa 015/100: Add support for make-frame-(in)visible, Yuuki Harano, 2020/11/24
- feature/pgtk 19da22e 018/100: Add support for handing the internal border, Yuuki Harano, 2020/11/24
- feature/pgtk e021e23 043/100: End Resize flickering by copying surface rather than just clearing, Yuuki Harano, 2020/11/24
- feature/pgtk fd61a86 030/100: improve some efficiency - simplify draws, Yuuki Harano, 2020/11/24
- feature/pgtk 330a346 012/100: Migrate to Emacs_GC, Yuuki Harano, 2020/11/24
- feature/pgtk b1cc62c 037/100: Add support for Jpeglib, Yuuki Harano, 2020/11/24