[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/pgtk 383ced7 071/100: Fix migrating Child frames
From: |
Yuuki Harano |
Subject: |
feature/pgtk 383ced7 071/100: Fix migrating Child frames |
Date: |
Tue, 24 Nov 2020 08:02:40 -0500 (EST) |
branch: feature/pgtk
commit 383ced7aee884c44d7422b085fe0d2a036e51724
Author: Jeff Walsh <fejfighter@gmail.com>
Commit: Jeff Walsh <jeff.walsh@drtusers-MacBook-Pro.local>
Fix migrating Child frames
* src/pgtkterm.c:
(x_calc_absolute_position): Remove Function that has no effect
(x_set_offset): titlebar off should not be stored as an offset, only
used to calculate final move locations
---
src/pgtkterm.c | 117 +++++++++------------------------------------------------
1 file changed, 18 insertions(+), 99 deletions(-)
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 413d421..5318d66 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -286,80 +286,6 @@ x_destroy_window (struct frame *f)
dpyinfo->reference_count--;
}
-/* Calculate the absolute position in frame F
- from its current recorded position values and gravity. */
-
-static void
-x_calc_absolute_position (struct frame *f)
-{
- int flags = f->size_hint_flags;
- struct frame *p = FRAME_PARENT_FRAME (f);
-
- /* We have nothing to do if the current position
- is already for the top-left corner. */
- if (!((flags & XNegative) || (flags & YNegative)))
- return;
-
- /* Treat negative positions as relative to the leftmost bottommost
- position that fits on the screen. */
- if ((flags & XNegative) && (f->left_pos <= 0))
- {
- int width = FRAME_PIXEL_WIDTH (f);
-
- /* A frame that has been visible at least once should have outer
- edges. */
- if (FRAME_X_OUTPUT (f)->has_been_visible && !p)
- {
- Lisp_Object frame;
- Lisp_Object edges = Qnil;
-
- XSETFRAME (frame, f);
- edges = Fpgtk_frame_edges (frame, Qouter_edges);
- if (!NILP (edges))
- width = (XFIXNUM (Fnth (make_fixnum (2), edges))
- - XFIXNUM (Fnth (make_fixnum (0), edges)));
- }
-
- if (p)
- f->left_pos = (FRAME_PIXEL_WIDTH (p) - width - 2 * f->border_width
- + f->left_pos);
- else
- f->left_pos = (x_display_pixel_width (FRAME_DISPLAY_INFO (f))
- - width + f->left_pos);
-
- }
-
- if ((flags & YNegative) && (f->top_pos <= 0))
- {
- int height = FRAME_PIXEL_HEIGHT (f);
-
- if (FRAME_X_OUTPUT (f)->has_been_visible && !p)
- {
- Lisp_Object frame;
- Lisp_Object edges = Qnil;
-
- XSETFRAME (frame, f);
- if (NILP (edges))
- edges = Fpgtk_frame_edges (frame, Qouter_edges);
- if (!NILP (edges))
- height = (XFIXNUM (Fnth (make_fixnum (3), edges))
- - XFIXNUM (Fnth (make_fixnum (1), edges)));
- }
-
- if (p)
- f->top_pos = (FRAME_PIXEL_HEIGHT (p) - height - 2 * f->border_width
- + f->top_pos);
- else
- f->top_pos = (x_display_pixel_height (FRAME_DISPLAY_INFO (f))
- - height + f->top_pos);
- }
-
- /* The left_pos and top_pos
- are now relative to the top and left screen edges,
- so the flags should correspond. */
- f->size_hint_flags &= ~(XNegative | YNegative);
-}
-
/* CHANGE_GRAVITY is 1 when calling from Fset_frame_position,
to really change the position, and 0 when calling from
x_make_frame_visible (in that case, XOFF and YOFF are the current
@@ -376,53 +302,46 @@ x_set_offset (struct frame *f, int xoff, int yoff, int
change_gravity)
struct frame *parent = FRAME_PARENT_FRAME (f);
GtkAllocation a = { 0 };
- if (change_gravity > 0)
+ int surface_pos_x = 0;
+ int surface_pos_y = 0;
+
+ if (parent)
{
- if (parent)
- {
- /* determing the "height" of the titlebar, by finding the
- location of the "emacsfixed" widget on the surface/window */
- GtkWidget *w = FRAME_GTK_WIDGET (parent);
- gtk_widget_get_allocation (w, &a);
- }
+ /* determing the "height" of the titlebar, by finding the
+ location of the "emacsfixed" widget on the surface/window */
+ GtkWidget *w = FRAME_GTK_WIDGET (parent);
+ gtk_widget_get_allocation (w, &a);
+ }
+ if (change_gravity > 0)
+ {
f->size_hint_flags &= ~(XNegative | YNegative);
- /* if the value is negative, don't include the titlebar offset */
+ f->left_pos = xoff;
+ f->top_pos = yoff;
+
if (xoff < 0)
{
f->size_hint_flags |= XNegative;
- f->left_pos = xoff;
- }
- else
- {
- f->left_pos = xoff + a.x; //~25
}
-
if (yoff < 0)
{
f->size_hint_flags |= YNegative;
- f->top_pos = yoff;
- }
- else
- {
- f->top_pos = yoff + a.y; //~60
}
f->win_gravity = NorthWestGravity;
}
- x_calc_absolute_position (f);
-
block_input ();
- x_wm_set_size_hint (f, 0, false);
+ surface_pos_y = f->top_pos + a.y;
+ surface_pos_x = f->left_pos + a.x;
/* When a position change was requested and the outer GTK widget
has been realized already, leave it to gtk_window_move to DTRT
and return. Used for Bug#25851 and Bug#25943. */
if (change_gravity != 0 && FRAME_GTK_OUTER_WIDGET (f))
{
- PGTK_TRACE ("x_set_offset: move to %d,%d.", f->left_pos, f->top_pos);
+ PGTK_TRACE ("x_set_offset: move to %d,%d.", surface_pos_x,
surface_pos_y);
gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
- f->left_pos, f->top_pos);
+ surface_pos_x, surface_pos_y);
}
unblock_input ();
- feature/pgtk 68b99a3 021/100: Implement invisible-pointer to create blinking effect, (continued)
- feature/pgtk 68b99a3 021/100: Implement invisible-pointer to create blinking effect, Yuuki Harano, 2020/11/24
- feature/pgtk 53cb431 007/100: replace listn with list., Yuuki Harano, 2020/11/24
- feature/pgtk 592badc 014/100: Early toolbar improvements, Yuuki Harano, 2020/11/24
- feature/pgtk 9d9c828 025/100: TIMERFD support for PGTK, prevent calling when timerfd<0, Yuuki Harano, 2020/11/24
- feature/pgtk fbba846 017/100: Addframe highlighting support, Yuuki Harano, 2020/11/24
- feature/pgtk 0056ca2 064/100: * src/pgtkterm.h: Change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk f761a09 065/100: * src/pgtkim.c: Change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk 27a92f7 072/100: Add font chooser functionality, Yuuki Harano, 2020/11/24
- feature/pgtk 9752896 042/100: Bring pgtk more inline with X11-cairo builds, Yuuki Harano, 2020/11/24
- feature/pgtk 164800d 013/100: Add Preferred geometry settings, Yuuki Harano, 2020/11/24
- feature/pgtk 383ced7 071/100: Fix migrating Child frames,
Yuuki Harano <=
- feature/pgtk 3b161dd 066/100: * src/pgtkselect.h: Change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk 89cbe37 070/100: * src/keyboard.c (make_lispy_event): Fix coding style, Yuuki Harano, 2020/11/24
- feature/pgtk f6d8c59 001/100: Introduce Pure GTK3 port, Yuuki Harano, 2020/11/24
- feature/pgtk a9c8a56 006/100: Fix xdg-open handling, Yuuki Harano, 2020/11/24
- feature/pgtk ed1f7d1 008/100: Simplify compilaiton condtion, Yuuki Harano, 2020/11/24
- feature/pgtk cdc04b4 010/100: Implement menubar for pgtk emacs, Yuuki Harano, 2020/11/24
- feature/pgtk 85441c9 016/100: Add Stipple support for PGTK, Yuuki Harano, 2020/11/24
- feature/pgtk bfbcb11 026/100: implement set-tool-bar-position and set-sticky, Yuuki Harano, 2020/11/24
- feature/pgtk af5b725 061/100: * src/pgtkmenu.c: change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk e649275 058/100: * src/pgtkterm.c: change coding style, Yuuki Harano, 2020/11/24