@@ -98,7 +98,7 @@ pgtk_any_window_to_frame (GdkWindow *window);
98
98
99
99
static void flip_cr_context (struct frame * f )
100
100
{
101
- APGTK_TRACE ("flip_cr_context" );
101
+ PGTK_TRACE ("flip_cr_context" );
102
102
cairo_t * cr = FRAME_CR_ACTIVE_CONTEXT (f );
103
103
104
104
block_input ();
@@ -407,7 +407,6 @@ pgtk_set_window_size (struct frame *f,
407
407
block_input ();
408
408
409
409
gtk_widget_get_size_request (FRAME_GTK_WIDGET (f ), & pixelwidth , & pixelheight );
410
- PGTK_TRACE ("old: %dx%d" , pixelwidth , pixelheight );
411
410
412
411
if (pixelwise )
413
412
{
@@ -428,18 +427,13 @@ pgtk_set_window_size (struct frame *f,
428
427
make_fixnum (FRAME_PGTK_TITLEBAR_HEIGHT (f )),
429
428
make_fixnum (FRAME_TOOLBAR_HEIGHT (f ))));
430
429
431
- PGTK_TRACE ("new: %dx%d" , pixelwidth , pixelheight );
432
430
for (GtkWidget * w = FRAME_GTK_WIDGET (f ); w != NULL ; w = gtk_widget_get_parent (w )) {
433
- PGTK_TRACE ("%p %s %d %d" , w , G_OBJECT_TYPE_NAME (w ), gtk_widget_get_mapped (w ), gtk_widget_get_visible (w ));
434
431
gint wd , hi ;
435
432
gtk_widget_get_size_request (w , & wd , & hi );
436
- PGTK_TRACE (" %dx%d" , wd , hi );
437
433
GtkAllocation alloc ;
438
434
gtk_widget_get_allocation (w , & alloc );
439
- PGTK_TRACE (" %dx%d+%d+%d" , alloc .width , alloc .height , alloc .x , alloc .y );
440
435
}
441
436
442
- PGTK_TRACE ("pgtk_set_window_size: %p: %dx%d." , f , width , height );
443
437
f -> output_data .pgtk -> preferred_width = pixelwidth ;
444
438
f -> output_data .pgtk -> preferred_height = pixelheight ;
445
439
x_wm_set_size_hint (f , 0 , 0 );
@@ -678,6 +672,63 @@ x_display_pixel_width (struct pgtk_display_info *dpyinfo)
678
672
return gdk_screen_get_width (gscr );
679
673
}
680
674
675
+ void
676
+ x_set_parent_frame (struct frame * f , Lisp_Object new_value , Lisp_Object old_value )
677
+ /* --------------------------------------------------------------------------
678
+ Set frame F's `parent-frame' parameter. If non-nil, make F a child
679
+ frame of the frame specified by that parameter. Technically, this
680
+ makes F's window-system window a child window of the parent frame's
681
+ window-system window. If nil, make F's window-system window a
682
+ top-level window--a child of its display's root window.
683
+
684
+ A child frame's `left' and `top' parameters specify positions
685
+ relative to the top-left corner of its parent frame's native
686
+ rectangle. On macOS moving a parent frame moves all its child
687
+ frames too, keeping their position relative to the parent
688
+ unaltered. When a parent frame is iconified or made invisible, its
689
+ child frames are made invisible. When a parent frame is deleted,
690
+ its child frames are deleted too.
691
+
692
+ Whether a child frame has a tool bar may be window-system or window
693
+ manager dependent. It's advisable to disable it via the frame
694
+ parameter settings.
695
+
696
+ Some window managers may not honor this parameter.
697
+ -------------------------------------------------------------------------- */
698
+ {
699
+ 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_X_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 );
707
+
708
+ if (!NILP (new_value )
709
+ && (!FRAMEP (new_value )
710
+ || !FRAME_LIVE_P (p = XFRAME (new_value ))
711
+ || !FRAME_PGTK_P (p )))
712
+ {
713
+ store_frame_param (f , Qparent_frame , old_value );
714
+ error ("Invalid specification of `parent-frame'" );
715
+ }
716
+
717
+ if (p != FRAME_PARENT_FRAME (f ))
718
+ {
719
+ block_input ();
720
+ gtk_window_set_transient_for (FRAME_X_WINDOW (f ), FRAME_X_WINDOW (p ));
721
+ gtk_window_set_attached_to (FRAME_X_WINDOW (f ), FRAME_X_WINDOW (p ));
722
+ gtk_window_move (FRAME_X_WINDOW (f ), f -> left_pos , f -> top_pos );
723
+ gtk_window_set_keep_above (FRAME_X_WINDOW (f ), true);
724
+ //fill this in
725
+ unblock_input ();
726
+
727
+ fset_parent_frame (f , new_value );
728
+ }
729
+ }
730
+
731
+
681
732
void
682
733
x_set_no_focus_on_map (struct frame * f , Lisp_Object new_value , Lisp_Object old_value )
683
734
/* Set frame F's `no-focus-on-map' parameter which, if non-nil, means
@@ -4807,9 +4858,9 @@ pgtk_handle_draw(GtkWidget *widget, cairo_t *cr, gpointer *data)
4807
4858
if (src == NULL && FRAME_CR_ACTIVE_CONTEXT (f ) != NULL )
4808
4859
src = cairo_get_target (FRAME_CR_ACTIVE_CONTEXT (f ));
4809
4860
}
4810
- APGTK_TRACE (" surface=%p" , src );
4861
+ PGTK_TRACE (" surface=%p" , src );
4811
4862
if (src != NULL ) {
4812
- APGTK_TRACE (" resized_p=%d" , f -> resized_p );
4863
+ PGTK_TRACE (" resized_p=%d" , f -> resized_p );
4813
4864
PGTK_TRACE (" garbaged=%d" , f -> garbaged );
4814
4865
PGTK_TRACE (" scroll_bar_width=%f" , (double ) PGTK_SCROLL_BAR_WIDTH (f ));
4815
4866
// PGTK_TRACE(" scroll_bar_adjust=%d", PGTK_SCROLL_BAR_ADJUST(f));
@@ -6600,7 +6651,7 @@ pgtk_end_cr_clip (struct frame *f)
6600
6651
void
6601
6652
pgtk_set_cr_source_with_gc_foreground (struct frame * f , Emacs_GC * gc )
6602
6653
{
6603
- PGTK_TRACE ("pgtk_set_cr_source_with_gc_foreground: %08lx" , gc -> foreground );
6654
+ PGTK_TRACE ("pgtk_set_cr_source_with_gc_foreground: %08lx" , gc -> foreground );
6604
6655
pgtk_set_cr_source_with_color (f , gc -> foreground );
6605
6656
}
6606
6657
0 commit comments