GNOME Bugzilla – Bug 699450
New budgets cause Account Name column to expand until display bigger than screen.
Last modified: 2018-06-29 23:15:34 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.
*** Bug 705820 has been marked as a duplicate of this bug. ***
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.
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.
Great job. Many thanks for the patch. Applied to trunk as r23175
Created attachment 256111 [details] Columns not shown
Created attachment 256112 [details] columns shown
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.
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
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.
Thanks for committing it, Mike. Unfortunately you spelled my name wrong in the commit. Anyway, this bug can be marked closed.
Oops. My apologes for the mis-spellin. Closing this bug.
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.