GNOME Bugzilla – Bug 353775
Use GtkNotebook instead of TerminalNotebook
Last modified: 2007-11-27 10:55:56 UTC
Here comes a patch which uses GtkNotebook and its new magic instead of TerminalNotebook. This is preliminary, has some tracing turned on. Who knows how this interacts with our 713 sizing bugs... Some comments: * note the parent-set listener on screens, which nicely replaces our previous handling of having to set the parent on realizing to get things right. In any case, when/if this stabilizes, terminal-screen.c:parent_set_callback can become a little less paranoid. * I removed the destroy method override in terminal window, and do most of the stuff in the dispose method. The rationale is «follow the gobject tutorial»: in dispose, references to the window being destroyed are removed, and in finalize, everything is killed/freed/put out to pasture. * The only regression (up to bugs and dire dumbness in the patch) is that when dragging a tab, you need to drop _on_tabs_. Currently we can drop tabs on the vte widget and things work nicely. This can be fixed easily, by making the vte widgets drop destinations, and essentially copying the code that handles that from gtk+/gtk/gtknotebook.c. I wish GtkNotebook allows to set the whole page as a drop destination. Oh well. * I think the terminal_window_adopt_screen and the corresponding use in terminal_app_new_terminal are no longer required, as all that should be handled by the notebook now. Did I mention that I am quite impressed at the new GtkNotebook API?
Created attachment 72006 [details] [review] Preliminary patch, so that people can stress test it...
Btw, using GtkNotebook buys us the following: now you can start a drag of a tab, decide you want to drag to a terminal window which is covered by other windows, hold the pointer a bit on the panel window list and see how the obscured window comes up.
Also missing is dropping a tab to the desktop. gtk_notebook_set_window_creation_hook shoudl fix that easily.
Created attachment 72227 [details] [review] Update to HEAD, and add two missing things This is the previous patch updated to HEAD, without debugging thingies, and now allows you to drag a tab and drop it in the terminal widget and on the desktop; you can't drop it on other windows, because GtkWindow does not yet allow that. I changed the priv->terms member to a plain int, instead of a list of the terms, because it is much much much much easier to keep the invariant that it actually matches the tab count on a window. I do not see that this patch adds /more/ sizing problems. I do not see that it reduces the sizing problems, either...
*** Bug 340962 has been marked as a duplicate of this bug. ***
Created attachment 99553 [details] [review] updated to svn trunk
Went ahead and committed that. Thanks! Do we need to bump required gtk+ version? 2007-11-26 Behdad Esfahbod <behdad@gnome.org> Bug 353775 – Use GtkNotebook instead of TerminalNotebook Patch from Christian Persch and Mariano Suárez-Alvarez * src/Makefile.am: * src/terminal-screen.c: * src/terminal-window.h: * src/terminal.c: * src/terminal.h: Do that.
It's already requiring 2.10.0, which is sufficient for the notebook tab reordering stuff.