]> git.eshelyaron.com Git - emacs.git/commitdiff
Get rid of obsolete xwidget-related code on PGTK
authorPo Lu <luangruo@yahoo.com>
Wed, 29 Dec 2021 10:06:34 +0000 (18:06 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 29 Dec 2021 10:06:34 +0000 (18:06 +0800)
* src/emacsgtkfixed.c (emacs_fixed_class_init): Stop setting
obsolete methods.

(EMACS_FIXED_GET_CLASS, struct GtkFixedPrivateL):
(emacs_fixed_gtk_widget_size_allocate): Delete obsolete things.

* src/xwidget.c (x_draw_xwidget_glyph_string): Work around
mysterious bug.

src/emacsgtkfixed.c
src/xwidget.c

index 7130e3535a7f6a7ae55587d65d5c89e77c95801a..bd365004ad625a02775b8399b8504b1cce8430fe 100644 (file)
@@ -27,7 +27,6 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #else
 #include "xterm.h"
 #endif
-#include "xwidget.h"
 #include "emacsgtkfixed.h"
 
 /* Silence a bogus diagnostic; see GNOME bug 683906.  */
@@ -63,92 +62,6 @@ EMACS_FIXED (GtkWidget *widget)
                                     EmacsFixed);
 }
 
-#if defined HAVE_XWIDGETS && defined HAVE_PGTK
-
-static EmacsFixedClass *
-EMACS_FIXED_GET_CLASS (GtkWidget *widget)
-{
-  return G_TYPE_INSTANCE_GET_CLASS (widget, emacs_fixed_get_type (),
-                                   EmacsFixedClass);
-}
-
-struct GtkFixedPrivateL
-{
-  GList *children;
-};
-
-static void
-emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget,
-                                     GtkAllocation *allocation)
-{
-  /* For xwidgets.
-
-     This basically re-implements the base class method and adds an
-     additional case for an xwidget view.
-
-     It would be nicer if the bse class method could be called first,
-     and the xview modification only would remain here. It wasn't
-     possible to solve it that way yet.  */
-  EmacsFixedClass *klass;
-  GtkWidgetClass *parent_class;
-  struct GtkFixedPrivateL *priv;
-
-  klass = EMACS_FIXED_GET_CLASS (widget);
-  parent_class = g_type_class_peek_parent (klass);
-  parent_class->size_allocate (widget, allocation);
-
-  priv = G_TYPE_INSTANCE_GET_PRIVATE (widget, GTK_TYPE_FIXED,
-                                     struct GtkFixedPrivateL);
-
-  gtk_widget_set_allocation (widget, allocation);
-
-  if (gtk_widget_get_has_window (widget))
-    {
-      if (gtk_widget_get_realized (widget))
-        gdk_window_move_resize (gtk_widget_get_window (widget),
-                                allocation->x,
-                                allocation->y,
-                                allocation->width,
-                                allocation->height);
-    }
-
-  for (GList *children = priv->children; children; children = children->next)
-    {
-      GtkFixedChild *child = children->data;
-
-      if (!gtk_widget_get_visible (child->widget))
-        continue;
-
-      GtkRequisition child_requisition;
-      gtk_widget_get_preferred_size (child->widget, &child_requisition, NULL);
-
-      GtkAllocation child_allocation;
-      child_allocation.x = child->x;
-      child_allocation.y = child->y;
-
-      if (!gtk_widget_get_has_window (widget))
-        {
-          child_allocation.x += allocation->x;
-          child_allocation.y += allocation->y;
-        }
-
-      child_allocation.width = child_requisition.width;
-      child_allocation.height = child_requisition.height;
-
-      struct xwidget_view *xv
-        = g_object_get_data (G_OBJECT (child->widget), XG_XWIDGET_VIEW);
-      if (xv)
-        {
-          child_allocation.width = xv->clip_right;
-          child_allocation.height = xv->clip_bottom - xv->clip_top;
-        }
-
-      gtk_widget_size_allocate (child->widget, &child_allocation);
-    }
-}
-
-#endif  /* HAVE_XWIDGETS && HAVE_PGTK */
-
 static void
 emacs_fixed_class_init (EmacsFixedClass *klass)
 {
@@ -158,9 +71,6 @@ emacs_fixed_class_init (EmacsFixedClass *klass)
 
   widget_class->get_preferred_width = emacs_fixed_get_preferred_width;
   widget_class->get_preferred_height = emacs_fixed_get_preferred_height;
-#if defined HAVE_XWIDGETS && defined HAVE_PGTK
-  widget_class->size_allocate = emacs_fixed_gtk_widget_size_allocate;
-#endif
   g_type_class_add_private (klass, sizeof (EmacsFixedPrivate));
 }
 
index 71a1a46d10bfd0e62b7a1798a7e52b7b5e12cb21..671d0390a0bfc49e52af6743c11cf127c04af03f 100644 (file)
@@ -2168,9 +2168,11 @@ x_draw_xwidget_glyph_string (struct glyph_string *s)
      covers the entire frame.  Clipping might have changed even if we
      haven't actually moved; try to figure out when we need to reclip
      for real.  */
+#ifndef HAVE_PGTK
   if (xv->clip_right != clip_right
       || xv->clip_bottom != clip_bottom
       || xv->clip_top != clip_top || xv->clip_left != clip_left)
+#endif
     {
 #ifdef USE_GTK
 #ifdef HAVE_X_WINDOWS