delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2020/01/22/02:10:35

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20161025;
h=date:from:to:subject:message-id:in-reply-to:references:mime-version;
bh=UPPjjXJv7chjO7gjbmSEK3GKbC0i2teyDXvQ6oNzvbY=;
b=PqzHQTbdjUfwGLCPfzea/6vjqR3JExjUokh+KenOyPs8K/0V0HVn8YCDAz7jmXoNUk
pK05HFbBip8EC2OEoKPO44tHYjy+Y3G0fPwaadX2/mCch1xGCetTKrNsKeyjObQZw7Ss
7jrHT1Ktb6N+bJfiar5BEUlFSi1hpr7KyQ8Pt4zEZsgEDurpF9lsi5B/Sx3xbX3pYic4
ZjrvURuIztnt7e/BHNKOVtDjKx/Kzh9si7MM0rziKBuW/lYtoYxnSF/7Codg7NLqcw6V
oFQt7QaChAHuWZgZU8Blb36U8nNmFQQxEoA6GWTXsQ6BWgUyol1DFZRJpbokPHBCq+vo
6VNA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to
:references:mime-version;
bh=UPPjjXJv7chjO7gjbmSEK3GKbC0i2teyDXvQ6oNzvbY=;
b=DOWK9bzSlIDTRwQsQ77iE+zt9CkyWHi208/qgBIxJm/uL9FvEn3Tcc/70mPYBPhPww
8r1EMNc+eHS8cKbfMmMpysynh+3icmzPfvo026jk1tzNnGNu/CBR7lfQ5/IsIn5REuJe
5W+RFcujmymE8bsyMUL5t9ao4FWTbd8iz+tK3nw/EANq/Uvt3S3MQdoBsl3pwB3lUyyV
hLeve37wT5pM0MetmVId3YZMcjuVASk50tP6M/jEf+MBGnyjnpfrkPgL5qKqxZwxMLQ5
J0rsTIHKIfv5EmrZRyaGqPDSBn4MSnQCVnJpDaJ6kJWV/B/ETaO73uZm+AcqfmBaiAwO
O87Q==
X-Gm-Message-State: APjAAAU9W/Q2GK/PwC+1JY/f9jEbKYYuA3cRtt8qlDO8GefGOejij9dR
k4R3kE0XgRjFsgFqghL7id/dbsEX
X-Google-Smtp-Source: APXvYqwVnd4EE/NwpqHslwtv6mIh1GoMty4cQOe9iM+tbK3M2hZpqU0n8HvwBRovpk1RQuVd8sRifw==
X-Received: by 2002:a2e:810d:: with SMTP id d13mr18893367ljg.113.1579675725990;
Tue, 21 Jan 2020 22:48:45 -0800 (PST)
Date: Wed, 22 Jan 2020 09:48:41 +0300
From: "dmn (graahnul DOT grom AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com>
To: geda-user AT delorie DOT com
Subject: Re: [geda-user] lepton 1.9.9 problems - SOLVED
Message-ID: <20200122094841.5c348184@demon>
In-Reply-To: <c5b79ff4-d532-1bf4-f6c0-29068015461e@fastmail.com>
References: <082a996c-2bf3-3fdb-a67b-06aa17c5bcb8 AT fastmail DOT com>
<20200119072337 DOT 391fdafa AT demon>
<2d33154d-7c71-a868-580a-ff292db6ffff AT fastmail DOT com>
<20200121022941 DOT 1916b69b AT demon>
<c5b79ff4-d532-1bf4-f6c0-29068015461e AT fastmail DOT com>
X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd11.3)
MIME-Version: 1.0
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--MP_/xX5Od/0K134fY0gfm7x6nXg
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Girvin,

> When I did try lepton-schematic's F-P to print my schematic, it
> crashed.

It was reported in [1] and fixed in [2] and [3] back in October, though
I could not reproduce it on my systems (including Slackware 14.2).
A patch that can be applied against 1.9.9 release sources is in
attachment.

 
> BTW: Another annoying thing I noticed about lepton-schematic is that
> the additional windows (i.e. status and page manager) do not honor
> window focus - they stay on top, which makes it difficult to work in
> the schematic editing main window without moving them aside. I do
> believe that gEDA 1.8 did honor window focus and the same windows
> went to the background when focus was changed to the main window.
> Fixing that could be an enhancement for a subsequent lepton release.

On the contrary, I prefer those dialogs to be above the main window.
It's possible to implement the behavior you've described (I've just
tried it), but I think it should be controlled by some configuration
parameter (since already two persons have different opinions on the
subject).

Thank you for testing.


[1] https://github.com/lepton-eda/lepton-eda/issues/480
[2] https://github.com/lepton-eda/lepton-eda/pull/482
[3] https://github.com/lepton-eda/lepton-eda/pull/485

Regards,
Dmitry.


--MP_/xX5Od/0K134fY0gfm7x6nXg
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=issue480fix.diff

diff --git a/schematic/src/gschem_log_widget.c b/schematic/src/gschem_log_widget.c
index f4ebd81b3..b39c10ae2 100644
--- a/schematic/src/gschem_log_widget.c
+++ b/schematic/src/gschem_log_widget.c
@@ -41,8 +41,8 @@ create_text_buffer();
 static void
 log_message (GschemLogWidgetClass *klass, const gchar *message, const gchar *style);
 
-static void
-scroll_to_bottom (GtkTextBuffer* buffer, GschemLogWidget* widget);
+static gboolean
+scroll_to_bottom (gpointer p);
 
 static void
 log_window_clear (GtkMenuItem* item, gpointer data);
@@ -147,7 +147,11 @@ changed_cb (GtkTextBuffer *buffer, GschemLogWidget *widget)
   g_return_if_fail (widget != NULL);
   g_return_if_fail (widget->viewer != NULL);
 
-  scroll_to_bottom (buffer, widget);
+  /* There is known issue with GtkTextView widget:
+   * to set scroll position in the text view properly,
+   * it should be done in an idle handler
+  */
+  g_idle_add (&scroll_to_bottom, widget);
 }
 
 
@@ -314,42 +318,30 @@ gschem_log_widget_init (GschemLogWidget *widget)
                     G_CALLBACK (&populate_popup_menu),
                     widget);
 
-
-  scroll_to_bottom (klass->buffer, widget);
-
 } /* instance_init() */
 
 
 
 /*! \brief scroll to the bottom of the log window
+ *  \note  Should be executed as an idle handler (g_idle_add())
  *
- *  \param [in] buffer  The text buffer
- *  \param [in] widget  The log widget
+ *  \param [in] p The log widget
  */
-static void
-scroll_to_bottom (GtkTextBuffer* buffer, GschemLogWidget* widget)
+static gboolean
+scroll_to_bottom (gpointer p)
 {
-  g_return_if_fail (buffer != NULL);
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (widget->viewer != NULL);
+  GschemLogWidget* widget = (GschemLogWidget*) p;
+  g_return_val_if_fail (widget != NULL, FALSE);
+  g_return_val_if_fail (widget->viewer != NULL, FALSE);
 
-  /* gtk_text_view_scroll_to_iter()
-   * relies upon the results of computations
-   * performed in an idle handler.
-   * Give that handler an opportunity to run -
-   * process pending events before the call, - so that
-   * the view will be scrolled correctly (to the bottom).
-   *
-   * \note using gtk_text_view_scroll_to_mark() instead
-   * of gtk_text_view_scroll_to_iter() (as suggested in the
-   * documentation of gtk_text_view_scroll_to_iter() doesn't help.
-  */
-  while (gtk_events_pending())
-    gtk_main_iteration();
+  GschemLogWidgetClass* cls = GSCHEM_LOG_WIDGET_GET_CLASS (widget);
+  g_return_val_if_fail (cls != NULL, FALSE);
+
+  GtkTextBuffer* buffer = cls->buffer;
+  g_return_val_if_fail (buffer != NULL, FALSE);
 
   GtkTextIter iter;
   gtk_text_buffer_get_end_iter (buffer, &iter);
-
   gtk_text_view_scroll_to_iter (widget->viewer,
                                 &iter,
                                 0.0,  /* within_margin */
@@ -357,6 +349,8 @@ scroll_to_bottom (GtkTextBuffer* buffer, GschemLogWidget* widget)
                                 0.0,  /* xalign: 0 => left */
                                 1.0); /* yalign: 1 => bottom */
 
+  return FALSE; /* execute only once when called as an idle handler */
+
 } /* scroll_to_bottom() */
 
 

--MP_/xX5Od/0K134fY0gfm7x6nXg--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019