Summer of Code 2006
Proposal by Mark Lenz

Project Proposal

My proposal is to implement tabs support in KDE's window manager KWin. My assumption is that this will be for KDE 4, but should be able to backport it to KDE 3 as well, depending upon the severity of the changes between version 3 and 4 that affect KWin's internals. Tabbing in KWin will give the user the ability to group several applications inside one window frame and to access those windows by clicking on a tab.

Tab Behavior

A lot of the way the tabs behave was influenced by how FluxBox implements their tabs, and I also got some ideas from the bug report discussion (Bug 42023). There are two ways a user can add or remove tabs. One is via drag-and-drop, and the other is via the tab context menu. To add a window to another window via drag-and-drop, the user drags a window onto the title bar, or tab bar, of another window while holding the control key. It should be possible to show a new tab with the window title as the label when the user is on top of the title or tab bar. Although the new tab isn't officially added until the user drops it. The add can be cancelled during the drop by dropping it somewhere else. If the user is still pressing the control key, nothing should happen. If the user is not pressing the control key, the window should move to the dropped position. Otherwise, the user can simply press the escape key. To remove a window from a tab list, the user can simply drag the tab out of the window frame and drop it.

To add a window via the context menu, the user would right-click on the title or tab bar and select "Add Window...". A small dialog box would pop up with a list of all the currently open windows on the desktop, excluding the window clicked upon. The user would then select the window and click the Add button, and the window would be added. The dialog box could stay open until a Close button is pushed so that the user can add multiple windows. It would also be possible to select multiple windows and then click the Add button to add more than one at a time. To remove a window via the context menu, the user would right-click on the tab, or title bar if the window is currently being shown, and select "Remove Window". The window would then be placed on the desktop in the position that a new window would have been placed. The user could also click a button on the tab bar that would close the window.

The user can also reorder tabs by dragging and dropping them on the tab bar.

KConfig Module

The tabs should be configurable in Control Center (or the KDE 4 equivalent). This would involve either creating a new KConfig Module for tabs, or modifying one of the existing KWin modules. The user should have the option to enable or disable the use of tabs. The tabs could be configured to display at the top, bottom, left, or right sides of a window and aligned left, center, or right. This would give the user the option to have tabs placed in one of twelve different positions, just like the panel position in Kasbar. The tabs could also be configured to be placed within the window frame or outside the window frame. If the tabs are placed within the window frame, they would still be placed above the title bar, if placed at the top. If the tabs are placed outside the window frame, the bar can be configured to take up just enough space for the tabs, or enough space to fill the entire width (or height depending upon orientation) of the window. The width and height of the tabs should also be configurable. There should also be configurations for auto-grouping the tabs. The user should be able to create a set of tabs and specify which applications would be opened and grouped under a set of tabs. The user should also be able to set specific applications to group all together under one set of tabs.

Session Management

KWin would also need to be modified to handle session management. That way, when a user logs out, and was using tabs, they can log back in with the windows restored to the same position within the same tabs.

Deliverables

Changes to KWin to support tabs with these features:

New or modified KConfig module for configuring tabs User tutorial explaining the features and use of tabs in KWin

Implementation Timeline

May 23 - Start of Summer of Code
June 2 - Tab bar implemented in window frame
June 9 - Can add/remove windows using the context menu and drag and drop
June 16 - Can reorder tabs using drag and drop - Initial KConfig module
June 30 - Tab bar can be in one of twelve positions
July 7 - Tab sizes can be changed
July 21 - Tab bar can be displayed inside or outside the window frame
August 4 - Auto-grouping implemented
August 11 - Session management modified
August 18 - Code cleaned, documentation and user tutorial written
August 21 - End of Summer of Code

I am really excited about this project. I use KDE every day, for work and everything else, and I would love to be able to use this feature. Even though it will be hard to pull myself away from this project, I must also work from home on other projects nearly 40 hours a week. So I would estimate I'll be working on the project about 20 hours a week, if not more.