emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/pgtk c1fbfb3 093/100: Don't use gtk_window_resize to resize offs


From: Yuuki Harano
Subject: feature/pgtk c1fbfb3 093/100: Don't use gtk_window_resize to resize offscreen window
Date: Tue, 24 Nov 2020 08:02:45 -0500 (EST)

branch: feature/pgtk
commit c1fbfb3fe04e3185fa64df2ed69cd97b0a6bbb40
Author: Yuuki Harano <masm+github@masm11.me>
Commit: Jeff Walsh <jeff.walsh@drtusers-MacBook-Pro.local>

    Don't use gtk_window_resize to resize offscreen window
    
    * src/xwidget.c (Fmake_xwidget): Use gtk_container_check_resize instead.
    (Fxwidget_resize): Use gtk_container_check_resize instead.
    
    ; Gtk+3 document says:
    ; > Applications should not use any API specific to GtkWindow
    ; > to operate on this object. It should be treated as a GtkBin
    ; > that has no parent widget.
---
 src/xwidget.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/xwidget.c b/src/xwidget.c
index c9fc706..893292c 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -122,8 +122,12 @@ Returns the newly constructed xwidget, or nil if 
construction fails.  */)
 # endif
 
       xw->widgetwindow_osr = gtk_offscreen_window_new ();
+#ifndef HAVE_PGTK
       gtk_window_resize (GTK_WINDOW (xw->widgetwindow_osr), xw->width,
                          xw->height);
+#else
+      gtk_container_check_resize (GTK_CONTAINER (xw->widgetwindow_osr));
+#endif
 
       if (EQ (xw->type, Qwebkit))
         {
@@ -966,8 +970,12 @@ DEFUN ("xwidget-resize", Fxwidget_resize, Sxwidget_resize, 
3, 3, 0,
 #ifdef USE_GTK
   if (xw->widget_osr)
     {
+#ifndef HAVE_PGTK
       gtk_window_resize (GTK_WINDOW (xw->widgetwindow_osr), xw->width,
                          xw->height);
+#else
+      gtk_container_check_resize (GTK_CONTAINER (xw->widgetwindow_osr));
+#endif
       gtk_container_resize_children (GTK_CONTAINER (xw->widgetwindow_osr));
       gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width,
                                    xw->height);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]