After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 699450 - New budgets cause Account Name column to expand until display bigger than screen.
New budgets cause Account Name column to expand until display bigger than scr...
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Budgets
git-master
Other Linux
: Normal normal
: ---
Assigned To: Chris Shoemaker
: Marton (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-05-02 10:08 UTC by Mike Evans
Modified: 2018-06-29 23:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to fix bug. (1.64 KB, patch)
2013-09-17 20:09 UTC, R Ratliff
none Details | Review
Columns not shown (63.09 KB, image/png)
2013-09-30 16:26 UTC, R Ratliff
  Details
columns shown (69.11 KB, image/png)
2013-09-30 16:26 UTC, R Ratliff
  Details
gzipped tar of patch files (5.15 KB, application/octet-stream)
2013-09-30 17:16 UTC, R Ratliff
  Details

Description Mike Evans 2013-05-02 10:08:07 UTC
Select Actions->Budget->New Budget and watch as the Account Name column expands in width.  In a multi screen setup GnuCash will expand across all your screens and off the RH side.  Closing the budget stops the growth and GnuCash can be resized back to normal.
Comment 1 Mike Evans 2013-08-13 08:09:56 UTC
*** Bug 705820 has been marked as a duplicate of this bug. ***
Comment 2 R Ratliff 2013-09-13 19:20:50 UTC
I learned a way to stop this annoying behavior, however, it also prevents some of the columns from being rendered. It might be a clue to the actual cause of the bug.

In src/gnome/gnc-budget-view.c, the gnc_budget_view_refresh function, there is the following source code inside the 2nd while loop:

        col = gbv_create_totals_column(view, num_periods_visible);
        if (col != NULL)
        {
            gtk_tree_view_append_column(priv->totals_tree_view, col);
            totals_col_list = g_list_append(totals_col_list, col);
        }

I've found that if you comment out the gtk_tree_view_append_column function call, the display will stop expanding.
Comment 3 R Ratliff 2013-09-17 20:09:37 UTC
Created attachment 255134 [details] [review]
Patch to fix bug.

It turns out that gnc_tree_view_account_add_custom_column already calls gtk_tree_view_append_column, so when it is called again, that does some funky stuff to the display. The fix is to remove these calls in the gnc_budget_view_refresh function. I have attached a patch.
Comment 4 Mike Evans 2013-09-18 09:43:17 UTC
Great job. Many thanks for the patch.  Applied to trunk as r23175
Comment 5 R Ratliff 2013-09-30 16:26:21 UTC
Created attachment 256111 [details]
Columns not shown
Comment 6 R Ratliff 2013-09-30 16:26:37 UTC
Created attachment 256112 [details]
columns shown
Comment 7 R Ratliff 2013-09-30 16:32:04 UTC
Unfortunately my bug fix resulted in a regression. I removed the gtk_tree_view_append_column without understanding what it was doing. It turns out this was actually good code. The bug "New budgets cause Account Name column to expand until display bigger than screen" was actually caused by cascading calls to gbv_tree_view_resized_cb in src/gnome/gnc-budget-view.c.

These cascading calls were caused by some buggy code that tried to keep the totals view at the bottom of the screen in sync with the column widths of the main budget view. when I removed the gtk_tree_view_append_column code, I was actually preventing these columns from displaying, which had the side effect of fixing the bug. So basically, I caused a regression that hid some columns from the bottom of the screen. Compare the screenshots I've attached to see what I mean. I've prepared some code that fixes the bug, fixes the regression, and handles scrolling this new budget view a little better.

This new budget view code was written by Phil Longstaff in this commit:
https://github.com/Gnucash/gnucash/commit/190665ac2f1c8062d0abd5bdfb714ee048cf6546

and now I'm prepared to submit a patch to improve this.
Comment 8 R Ratliff 2013-09-30 17:16:23 UTC
Created attachment 256122 [details]
gzipped tar of patch files

The tar contains the following:

0001-Fix-budget-view-resizing-issue.patch
0002-Fix-the-way-column-width-is-determined.patch
0003-Change-column-sizing-method.patch
0004-Fix-regression-for-window-horizontal-resizing.patch
0005-Fix-horizontal-scrolling.patch
0006-Fix-vertical-scrolling.patch
0007-Clean-up-code-before-submitting-patch.patch
Comment 9 Mike Evans 2013-10-01 12:37:31 UTC
Thanks for the patches Bobby.

I've commited all the patches as a single commit.  The patch notes are reproduced in the commit message for traceability.
Comment 10 R Ratliff 2013-10-02 21:51:46 UTC
Thanks for committing it, Mike. Unfortunately you spelled my name wrong in the commit.  Anyway, this bug can be marked closed.
Comment 11 Mike Evans 2013-10-03 08:19:49 UTC
Oops.  My apologes for the mis-spellin.

Closing this bug.
Comment 12 John Ralls 2018-06-29 23:15:34 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=699450. Please update any external references or bookmarks.