GNOME Bugzilla – Bug 95316
Switching between scollbar/no-scrollbar tabs expands window
Last modified: 2006-10-12 17:35:24 UTC
If I have two profiles, one with scrollbar enabled and one with scrollbar disabled and I open a terminal with both profiles as tabs, clicking from without_scrollbar to with_scrollbar will cause the window to expand. So, eventually, I end up with a window that goes waaay off the right hand side of the screen.
I can reproduce in 2.1 as well.
this also happens in version 2.2.1 of gnome-terminal
Also reproducable with 2.3.1, vte 0.11.10
Created attachment 19008 [details] [review] patch to fix the problem
Hi all, this patch fixes the problem. The only part I don't like too much is were it calculates the amount of space to remove: + old_grid_width -= size.width / char_width; I don't know if this will work on all setups, but it should work on most though. adding PATCH keyword.
Anyone reviewing the patch? Can the reporter test the patch?
Created attachment 66108 [details] [review] Fix for scrollbar cause of window growth This patch I find to be better. The main problem with the old one is that when a scrollbar is enabled on a profile, the window size increases, and when it is hidden, the window size decreases. The other patch did not decrease the window size. In additition, it relied on private information in the terminal-screen (the scrollbar widget). This new patch is much simpler. All it basically does is hide the old terminal and show the new terminal (since it may have been previously hidden by the first part). Gtk then does the rest. :)
I guess I should have mentioned explicitly that the old patch did work (after slight modification - mainly I implemented screen_get_scrollbar). I don't know if that just didn't make its way into the patch or if that is just not in the GNOME 2.14.1 release (I would assume it was created for the patch because it was not terminal_screen_get_scrollbar).
Created attachment 66140 [details] [review] Same basic fix, also removes code no longer needed due to patch This patch is slightly cleaner and has comments. It also removes some code that forces the window size that is no longer needed due to the patch.
Created attachment 66207 [details] [review] Re-added functionality of previously removed code with better code So removing alltogether the old code had its problem. When you resized a terminal, that was the only terminal that experience the resize. If you had multiple tabs, the background tabs would not update to the new grid width and height. This is not really WRONG, but it did remove a feature. So the new patch adds back in the functionality, but in a better way. It sets the grid size directly on the terminal-widget before the window resize instead of resizing the window twice (since terminal_window_set_active calls terminal_window_set_size).
*** This bug has been marked as a duplicate of 324426 ***
Forget about the dup. sorry.
Confirmed that the patch fixes bug #338913 and this one. Guilherme, may I commit it.
Also confirming that the latest patch fixes this bug and bug 338913. These bugs are very irritating if you work with multiple tabs, so if there are no issues with the patch, please could we get it applied as soon as possible.
I notice bug 342968 is related, and possibly contains a newer patch. If this is the case could we mark this bug as superceded by bug 342968 to avoid confusion?
As I see it, there is very little reason why this patch should not be committed; it fixes many bugs with the current resize system with no known side effects. Bug 342968 does have newer patches, but they revamp the resizing system (making it from explicit to implicit). The patch should be more hesitantly applied and is probably not yet completed.
Confirming the patch works for me too. Why not commit it until a "better" patch comes around?
(In reply to comment #17) > Confirming the patch works for me too. Why not commit it until a "better" patch > comes around? Wouter, please go ahead and commit it. In HEAD and gnome-2-16. (seems like someone moved help/es to gnome-doc-utils and broke build too. :( )
I've committed the patch to HEAD and gnome-2-16. 2006-10-12 Wouter Bolsterlee <wbolster@gnome.org> * src/terminal-window.c: (terminal_window_set_active), (notebook_page_selected_callback): Hopefully fix the annoying window resizing bug triggered by switching between multiple tabs. Fixes bug #95316, patch by Eric Anderson.