symbol editor and footprint browser "item" column invisible/too small

Bug #1841584 reported by Dino Ghilardi
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Committed
Medium
Ian McInerney

Bug Description

Opening symbol editor I get those warnings

(kicad:14465): Gtk-CRITICAL **: IA__gtk_tree_view_column_set_fixed_width: assertion 'fixed_width > 0' failed

(kicad:14465): Gtk-CRITICAL **: IA__gtk_tree_view_column_set_fixed_width: assertion 'fixed_width > 0' failed

then the "libraries" box at the left seems empty, but double-clicking on a line the description fields for the footprint appear. Also the column header "Description" is now visible.
In stable branch the table header is not shown.

It seems just like the first column of the treeview having zero width.

See attached images for details.

-------------------------------------------------------------------------
Application: LibEdit
Version: (5.99.0-10-g37b166348), release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.52.1 OpenSSL/1.0.2s zlib/1.2.8 libidn2/0.16 libpsl/0.17.0 (+libidn2/0.16) libssh2/1.7.0 nghttp2/1.18.1 librtmp/2.3
Platform: Linux 4.9.0-8-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.52.1
    Compiler: GCC 6.3.0 with C++ ABI 1010

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote :
Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote :
Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote :

After re-compiling (git clean -fx, make, make clean) also the footprint editor has the same issue.

On stable branch (on the same machine) it works fine.

Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote :

It seems the default width for the column is too small (or not set).
Workaround: just go to the very left of the "description" header and drag right the column. Now the "Item" column appears again, but closing and re-opening the window the column disappears again..

summary: - symbol editor "libraries" box with no text
+ symbol editor and footprint browser "item" column invisible/too small
Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote :

may be related to commit 6b6e9eddee891b6cf8522e0770505b353a94dc9c "Return control of Symbol and Footprint chooser col widths to user."

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I cannot duplicate this on Debian testing.

Application: LibEdit
Version: (5.99.0-11-g9dac8534c), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.65.3 OpenSSL/1.1.1c zlib/1.2.11 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.39.2 librtmp/2.3
Platform: Linux 4.19.0-5-amd64 x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
    Boost: 1.67.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.65.3
    Compiler: Clang 7.0.1 with C++ ABI 1002

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=ON
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
    KICAD_STDLIB_DEBUG=OFF
    KICAD_STDLIB_LIGHT_DEBUG=OFF
    KICAD_SANITIZE=OFF

Changed in kicad:
status: New → Incomplete
Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote : Re: [Bug 1841584] Re: symbol editor and footprint browser "item" column invisible/too small

May be it is related to the gtk-version: I got the issue on debian
oldstable, with:

wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24

Do you get the warnings:

(kicad:30738): Gtk-CRITICAL **:
IA__gtk_tree_view_column_set_fixed_width: assertion 'fixed_width > 0' failed

(kicad:30738): Gtk-CRITICAL **:
IA__gtk_tree_view_column_set_fixed_width: assertion 'fixed_width > 0' failed

when opening the symbol editor?

---------------------------------------------------------

On 27/08/19 15:35, Wayne Stambaugh wrote:
> I cannot duplicate this on Debian testing.
>
> Application: LibEdit
> Version: (5.99.0-11-g9dac8534c), debug build
> Libraries:
> wxWidgets 3.0.4
> libcurl/7.65.3 OpenSSL/1.1.1c zlib/1.2.11 libidn2/2.2.0 libpsl/0.20.2 (+libidn2/2.0.5) libssh2/1.8.0 nghttp2/1.39.2 librtmp/2.3
> Platform: Linux 4.19.0-5-amd64 x86_64, 64 bit, Little endian, wxGTK
> Build Info:
> wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 3.24
> Boost: 1.67.0
> OpenCASCADE Community Edition: 6.9.1
> Curl: 7.65.3
> Compiler: Clang 7.0.1 with C++ ABI 1002
>
> Build settings:
> KICAD_SCRIPTING=ON
> KICAD_SCRIPTING_MODULES=ON
> KICAD_SCRIPTING_PYTHON3=ON
> KICAD_SCRIPTING_WXPYTHON=ON
> KICAD_SCRIPTING_WXPYTHON_PHOENIX=ON
> KICAD_SCRIPTING_ACTION_MENU=ON
> BUILD_GITHUB_PLUGIN=ON
> KICAD_USE_OCE=ON
> KICAD_USE_OCC=OFF
> KICAD_SPICE=ON
> KICAD_STDLIB_DEBUG=OFF
> KICAD_STDLIB_LIGHT_DEBUG=OFF
> KICAD_SANITIZE=OFF
>
>
> ** Changed in: kicad
> Status: New => Incomplete
>

Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote :

Got it!

For GTK2:
https://developer.gnome.org/gtk2/stable/GtkTreeViewColumn.html#gtk-tree-view-column-set-fixed-width

For GTK3:
https://developer.gnome.org/gtk3/stable/GtkTreeViewColumn.html#gtk-tree-view-column-set-fixed-width

Using -1 as arguments is used to unset the fixed width in gtk3, while in
gtk2 is not legal and sets the column width to 0, issuing the warning.

Cheers,
Dino.

summary: symbol editor and footprint browser "item" column invisible/too small
+ (gtk-2 specific)
tags: added: eeschema pcbnew
removed: libedit
Revision history for this message
Ian McInerney (imcinerney) wrote : Re: symbol editor and footprint browser "item" column invisible/too small (gtk-2 specific)

wxWidgets has an autosize flag we can default to using for the column if we don't find a size in the config. Can you give the attached patch a try to see if it behaves better on GTK2? I don't see any issues with it on GTK3.

Note that this would only affect new runs (e.g. when the config file doesn't exist), since the size of 0 was automatically saved in the config file the first time the window was ever opened.

Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote : Re: [Bug 1841584] Re: symbol editor and footprint browser "item" column invisible/too small (gtk-2 specific)

On 06/09/19 00:29, Ian McInerney wrote:
> wxWidgets has an autosize flag we can default to using for the column if
> we don't find a size in the config. Can you give the attached patch a
> try to see if it behaves better on GTK2? I don't see any issues with it
> on GTK3.
>
> Note that this would only affect new runs (e.g. when the config file
> doesn't exist), since the size of 0 was automatically saved in the
> config file the first time the window was ever opened.
>
> ** Patch added: "0001-Default-the-lib_tree-to-autosize-the-columns-if-no-s.patch"
> https://bugs.launchpad.net/kicad/+bug/1841584/+attachment/5287042/+files/0001-Default-the-lib_tree-to-autosize-the-columns-if-no-s.patch
>

I tried deleting all the config files, but no change. Also I still get
the two warnings, than mean that wxWidget did call
gtk_tree_view_column_set_fixed_width with the a negative or zero argument.
I still get launching symbol editor:

(kicad:9255): Gtk-CRITICAL **: IA__gtk_tree_view_column_set_fixed_width:
assertion 'fixed_width > 0' failed

(kicad:9255): Gtk-CRITICAL **: IA__gtk_tree_view_column_set_fixed_width:
assertion 'fixed_width > 0' failed

wit the first column shrinked to zero.

Cheers, Dino.

Revision history for this message
Ian McInerney (imcinerney) wrote : Re: symbol editor and footprint browser "item" column invisible/too small (gtk-2 specific)

Dino, can you see what the column size being stored in the eeschema config file is? It should be under a label of "15wxObjectDataPtrI22LIB_TREE_MODEL_ADAPTERESelectorColumnWidth" (or similar). That should be the width being passed into the wxWidgets functions. If that is zero/negative, then it might be we can't read back the width properly when the window exits on GTK2. If it is zero/negative, give it a positive value (say 300) and see if the column is visible on the next open.

Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote : Re: [Bug 1841584] Re: symbol editor and footprint browser "item" column invisible/too small (gtk-2 specific)

On 06/09/19 11:48, Ian McInerney wrote:
> Dino, can you see what the column size being stored in the eeschema
> config file is? It should be under a label of
> "15wxObjectDataPtrI22LIB_TREE_MODEL_ADAPTERESelectorColumnWidth" (or
> similar). That should be the width being passed into the wxWidgets
> functions. If that is zero/negative, then it might be we can't read back
> the width properly when the window exits on GTK2. If it is
> zero/negative, give it a positive value (say 300) and see if the column
> is visible on the next open.
>

In non-patched version:
Opened symbol editor, resized column, closed symbol editor and kicad:

15wxObjectDataPtrI22LIB_TREE_MODEL_ADAPTERESelectorColumnWidth=193

Opened symbol editor, closed symbol editor and kicad (without touching
that column):

15wxObjectDataPtrI22LIB_TREE_MODEL_ADAPTERESelectorColumnWidth=1

Patched, rebuild with make -j7 and re-executed:
Opened symbol editor, resized column, closed symbol editor and kicad:

15wxObjectDataPtrI22LIB_TREE_MODEL_ADAPTERESelectorColumnWidth=225

Opened symbol editor, closed symbol editor and kicad (without touching
that column):
15wxObjectDataPtrI22LIB_TREE_MODEL_ADAPTERESelectorColumnWidth=1

So opening symbol editor with a positive value (225), the column is not
visible and the value in the file is set to 1 when closing kicad (not
symbol editor but the project manager). The behaviour does not change
with the patched version.

P.S.: The patch I'm talking about just changes
/common/widgets/lib_tree.cpp, line 116

- int colWidth = 0;
+ int colWidth = wxCOL_WIDTH_AUTOSIZE;

Cheers,
Dino.

Revision history for this message
Seth Hillbrand (sethh) wrote : Re: symbol editor and footprint browser "item" column invisible/too small (gtk-2 specific)

I suspect I am seeing a related (if not same) issue. Debian testing, GTK3.

Attached is a video of triggering the issue. It doesn't happen for the same action each time but eventually it happens.

Changed in kicad:
status: Incomplete → Triaged
milestone: none → 6.0.0-rc1
summary: symbol editor and footprint browser "item" column invisible/too small
- (gtk-2 specific)
Revision history for this message
Ian McInerney (imcinerney) wrote :

@Seth, this always reproduces for me if I type fast enough in the filter box, so type a little faster :).

What seems to be happening is that on GTK the size of the columns in the data view are not updated right away, and instead are updated wen GTK feels like it. The calls to GetWidth() that we do will only return the displayed column size. On Linux/Mac we destroy the columns and re-add them when filtering, so there is no width until GTK does its first update after the filter. If the filter events happen close enough together, GTK won't do an update so the width returned before we destroy the columns on the next filter event is 0 (since the displayed columns haven't had their width calculated).

Changed in kicad:
assignee: nobody → Ian McInerney (imcinerney)
importance: Undecided → Low
tags: added: gtk
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

@Ian, I'm assuming your patch resolves this issue for gtk2 and gtk3. If so, I will merge it.

Revision history for this message
Ian McInerney (imcinerney) wrote :

@Wayne, not yet. That patch was an attempt to see what was going on with Dino's machine. I am still working on the fix for the behavior that Seth reported (which may or may not fix Dino's problem).

Changed in kicad:
importance: Low → Medium
Revision history for this message
Ian McInerney (imcinerney) wrote :

@Seth and @Dino can you try this patch to see if the issues go away? It is primarily designed to fix the issue that Seth noticed (the column size going to 0 when typing), but I am hoping it will also fix the issue that Dino saw.

This patch also cleans up the column size handling, and moves it into the library adapter (instead of being spread across the two classes).

Changed in kicad:
status: Triaged → In Progress
Revision history for this message
Seth Hillbrand (sethh) wrote :

This fixes my issue (and I assume Victor's from the dupe). I don't see any issues here, so I've pushed the patch.

@Dino, if you are still seeing your issue with this patch, we'll re-open the ticket.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision bb596ebdafa30eef2881fb10c29e4c3a23fc7f5f
https://git.launchpad.net/kicad/patch/?id=bb596ebdafa30eef2881fb10c29e4c3a23fc7f5f

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Dino Ghilardi (dino-ghilardi) wrote :

I Just tested it: It fixes my issue too (tested revision: bb596ebdafa30eef2881fb10c29e4c3a23fc7f5f).

Cheers,
Dino.

Revision history for this message
Victor W (vicw) wrote :

I can also confirm that this issue is resolved in:

g16f495843

Application: Eeschema
Version: (5.99.0-140-g16f495843), release build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.64.1 OpenSSL/1.1.1b zlib/1.2.11 libidn2/2.1.1 libpsl/0.20.2 (+libidn2/2.1.1) libssh2/1.8.1 nghttp2/1.36.0
Platform: Linux 5.0.9-arch1-1-ARCH x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.4 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.64.1
    Compiler: GCC 8.3.0 with C++ ABI 1013

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.