@@ -38,6 +38,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
38
38
39
39
#include "lisp.h"
40
40
#include "blockinput.h"
41
+ #include "frame.h"
41
42
#include "sysselect.h"
42
43
#include "gtkutil.h"
43
44
#include "systime.h"
@@ -357,13 +358,24 @@ x_set_offset (struct frame *f, int xoff, int yoff, int change_gravity)
357
358
{
358
359
/* not working on wayland. */
359
360
360
- APGTK_TRACE ("x_set_offset: %d,%d,%d." , xoff , yoff , change_gravity );
361
+ PGTK_TRACE ("x_set_offset: %d,%d,%d." , xoff , yoff , change_gravity );
362
+
363
+ struct frame * parent = FRAME_PARENT_FRAME (f );
364
+ GtkAllocation a = {0 };
365
+
366
+ if (parent )
367
+ {
368
+ GtkWidget * w = FRAME_GTK_WIDGET (parent );
369
+ gtk_widget_get_allocation (w , & a );
370
+ }
371
+
361
372
362
373
if (change_gravity > 0 )
363
374
{
364
- APGTK_TRACE ("x_set_offset: change_gravity > 0" );
365
- f -> top_pos = yoff + 60 ;
366
- f -> left_pos = xoff + 25 ;
375
+ PGTK_TRACE ("x_set_offset: change_gravity %d > 0, %d %d" , change_gravity , a .x , a .y );
376
+ f -> top_pos = yoff + a .y ; //~60
377
+ f -> left_pos = xoff + a .x ; //~25
378
+
367
379
f -> size_hint_flags &= ~ (XNegative | YNegative );
368
380
if (xoff < 0 )
369
381
f -> size_hint_flags |= XNegative ;
@@ -381,7 +393,7 @@ x_set_offset (struct frame *f, int xoff, int yoff, int change_gravity)
381
393
has been realized already, leave it to gtk_window_move to DTRT
382
394
and return. Used for Bug#25851 and Bug#25943. */
383
395
if (change_gravity != 0 && FRAME_GTK_OUTER_WIDGET (f )) {
384
- APGTK_TRACE ("x_set_offset: move to %d,%d." , f -> left_pos , f -> top_pos );
396
+ PGTK_TRACE ("x_set_offset: move to %d,%d." , f -> left_pos , f -> top_pos );
385
397
gtk_window_move (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f )),
386
398
f -> left_pos , f -> top_pos );
387
399
}
@@ -430,8 +442,6 @@ pgtk_set_window_size (struct frame *f,
430
442
for (GtkWidget * w = FRAME_GTK_WIDGET (f ); w != NULL ; w = gtk_widget_get_parent (w )) {
431
443
gint wd , hi ;
432
444
gtk_widget_get_size_request (w , & wd , & hi );
433
- GtkAllocation alloc ;
434
- gtk_widget_get_allocation (w , & alloc );
435
445
}
436
446
437
447
f -> output_data .pgtk -> preferred_width = pixelwidth ;
@@ -697,13 +707,7 @@ x_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
697
707
-------------------------------------------------------------------------- */
698
708
{
699
709
struct frame * p = NULL ;
700
- int width = 0 , height = 0 ;
701
-
702
- PGTK_TRACE ("x_set_parent_frame x: %d, y: %d, size: %d x %d" , f -> left_pos , f -> top_pos , width , height );
703
- gtk_window_get_size (FRAME_NATIVE_WINDOW (f ), & width , & height );
704
-
705
-
706
- PGTK_TRACE ("x_set_parent_frame x: %d, y: %d, size: %d x %d" , f -> left_pos , f -> top_pos , width , height );
710
+ PGTK_TRACE ("x_set_parent_frame x: %d, y: %d" , f -> left_pos , f -> top_pos );
707
711
708
712
if (!NILP (new_value )
709
713
&& (!FRAMEP (new_value )
@@ -722,7 +726,6 @@ x_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
722
726
gtk_window_set_attached_to (FRAME_NATIVE_WINDOW (f ), FRAME_GTK_WIDGET (p ));
723
727
gtk_window_move (FRAME_NATIVE_WINDOW (f ), f -> left_pos , f -> top_pos );
724
728
gtk_window_set_keep_above (FRAME_NATIVE_WINDOW (f ), true);
725
- //fill this in
726
729
unblock_input ();
727
730
728
731
fset_parent_frame (f , new_value );
@@ -2683,7 +2686,6 @@ pgtk_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x,
2683
2686
{
2684
2687
PGTK_TRACE ("draw_window_cursor: %d, %d, %d, %d, %d, %d." ,
2685
2688
x , y , cursor_type , cursor_width , on_p , active_p );
2686
-
2687
2689
if (on_p )
2688
2690
{
2689
2691
w -> phys_cursor_type = cursor_type ;
@@ -2732,6 +2734,7 @@ pgtk_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x,
2732
2734
xic_set_preeditarea (w , x , y );
2733
2735
#endif
2734
2736
}
2737
+
2735
2738
}
2736
2739
2737
2740
static void
0 commit comments