[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (2b66cd7a7eec8b1d9394eb7e5feda0be3c7d47d3)



The branch, master has been updated
       via  2b66cd7a7eec8b1d9394eb7e5feda0be3c7d47d3 (commit)
       via  c1536167c44f4424ce40d394fcfd260431173f58 (commit)
      from  356d1e05840111c190490f2e6b2e5987a2d2364c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 src/hid/gtk/gtkhid-main.c        |   10 ++++------
 src/hid/gtk/gui-netlist-window.c |    5 +++++
 src/hid/gtk/gui.h                |    2 ++
 3 files changed, 11 insertions(+), 6 deletions(-)


=================
 Commit Messages
=================

commit 2b66cd7a7eec8b1d9394eb7e5feda0be3c7d47d3
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Fix NetlistChanged action crash when exporting from the commandline.
    
    I broke this in commit 7308f512307158944482227d58e66373fd023d62 when I
    added a missing notification to the GUI when free'ing the netlist. It turns
    out that a command-line invoked export (such as used to export images in the
    doc/ build) will hit this code-path, and provoke the GUI netlist window code
    to try and update before the GUI is actually loaded.
    
    For now, lets fix this with a bandaid and just skip the netlist update if the
    GUI is not up.
    
    A brief inspection of the code (and test for the doc/ build) suggests that the
    Lesstif HID is not affected by this problem. (It has similar code to avoid
    creating the netlist window if the main window is not already created).

:100644 100644 447b10e... 249066f... M	src/hid/gtk/gui-netlist-window.c

commit c1536167c44f4424ce40d394fcfd260431173f58
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Move ghid_gui_is_up variable into the ghidgui structure.
    
    This lets us access it outside of gtkhid-main.c

:100644 100644 db7d831... eb0ad14... M	src/hid/gtk/gtkhid-main.c
:100644 100644 e4d55dd... 34b4c11... M	src/hid/gtk/gui.h

=========
 Changes
=========

commit 2b66cd7a7eec8b1d9394eb7e5feda0be3c7d47d3
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Fix NetlistChanged action crash when exporting from the commandline.
    
    I broke this in commit 7308f512307158944482227d58e66373fd023d62 when I
    added a missing notification to the GUI when free'ing the netlist. It turns
    out that a command-line invoked export (such as used to export images in the
    doc/ build) will hit this code-path, and provoke the GUI netlist window code
    to try and update before the GUI is actually loaded.
    
    For now, lets fix this with a bandaid and just skip the netlist update if the
    GUI is not up.
    
    A brief inspection of the code (and test for the doc/ build) suggests that the
    Lesstif HID is not affected by this problem. (It has similar code to avoid
    creating the netlist window if the main window is not already created).

diff --git a/src/hid/gtk/gui-netlist-window.c b/src/hid/gtk/gui-netlist-window.c
index 447b10e..249066f 100644
--- a/src/hid/gtk/gui-netlist-window.c
+++ b/src/hid/gtk/gui-netlist-window.c
@@ -1009,6 +1009,11 @@ ghid_netlist_window_update (gboolean init_nodes)
 static gint
 GhidNetlistChanged (int argc, char **argv, Coord x, Coord y)
 {
+  /* XXX: We get called before the GUI is up when
+   *         exporting from the command-line. */
+  if (ghidgui == NULL || !ghidgui->is_up)
+    return 0;
+
   loading_new_netlist = TRUE;
   ghid_netlist_window_update (TRUE);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (disable_all_button),

commit c1536167c44f4424ce40d394fcfd260431173f58
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    hid/gtk: Move ghid_gui_is_up variable into the ghidgui structure.
    
    This lets us access it outside of gtkhid-main.c

diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
index db7d831..eb0ad14 100644
--- a/src/hid/gtk/gtkhid-main.c
+++ b/src/hid/gtk/gtkhid-main.c
@@ -239,12 +239,10 @@ ghid_calibrate (double xval, double yval)
   printf (_("ghid_calibrate() -- not implemented\n"));
 }
 
-static int ghid_gui_is_up = 0;
-
 void
 ghid_notify_gui_is_up ()
 {
-  ghid_gui_is_up = 1;
+  ghidgui->is_up = 1;
 }
 
 int
@@ -253,7 +251,7 @@ ghid_shift_is_pressed ()
   GdkModifierType mask;
   GHidPort *out = &ghid_port;
 
-  if( ! ghid_gui_is_up ) 
+  if (!ghidgui->is_up)
     return 0;
 
   gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area),
@@ -267,7 +265,7 @@ ghid_control_is_pressed ()
   GdkModifierType mask;
   GHidPort *out = &ghid_port;
 
-  if( ! ghid_gui_is_up )
+  if (!ghidgui->is_up)
     return 0;
 
   gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area),
@@ -281,7 +279,7 @@ ghid_mod1_is_pressed ()
   GdkModifierType mask;
   GHidPort *out = &ghid_port;
 
-  if( ! ghid_gui_is_up )
+  if (!ghidgui->is_up)
     return 0;
 
   gdk_window_get_pointer (gtk_widget_get_window (out->drawing_area),
diff --git a/src/hid/gtk/gui.h b/src/hid/gtk/gui.h
index e4d55dd..34b4c11 100644
--- a/src/hid/gtk/gui.h
+++ b/src/hid/gtk/gui.h
@@ -146,6 +146,8 @@ typedef struct
     library_window_width,
     library_window_height,
     netlist_window_height, history_size, settings_mode;
+
+  bool is_up;
 }
 GhidGui;
 




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs