1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-21 21:38:00 +01:00

Add drawers to wmaker!

Drawers are horizontal docks, and they can themselves only live in the dock

To use them, right click on the dock or a docked appicon and select "Add
a drawer". Then move appicons into the drawer (drag them with the
mouse). You may change the icon of the drawer. By default, drawers
auto-expand and -collapse, and auto-raise/lower. This can be customized
in the same way as for the clip.

Set DisableDrawers to YES in G/D/WindowMaker if you do not want to see
the menu entry to add a drawer.

Just discovered this bug: the auto-attract icon functionality will not
work (to be precise, it crashes WM!) if the clip is disabled
(NoClip=YES). Will fix shortly, of course.
This commit is contained in:
Daniel Déchelotte
2013-04-12 01:42:41 +02:00
committed by Carlos R. Mafra
parent 707ce34a5e
commit e14e6b3da8
19 changed files with 1560 additions and 220 deletions

View File

@@ -236,16 +236,28 @@ static WMPropList *makeWindowState(WWindow * wwin, WApplication * wapp)
WMReleasePropList(shortcut);
if (wapp && wapp->app_icon && wapp->app_icon->dock) {
int i;
char *name;
char *name = NULL;
if (wapp->app_icon->dock == scr->dock) {
name = "Dock";
} else {
}
if (name == NULL) // Try the clips
{
for (i = 0; i < scr->workspace_count; i++)
if (scr->workspaces[i]->clip == wapp->app_icon->dock)
break;
assert(i < scr->workspace_count);
/*n = i+1; */
name = scr->workspaces[i]->name;
if (i < scr->workspace_count)
name = scr->workspaces[i]->name;
}
if (name == NULL) // Try the drawers
{
WDrawerChain *dc;
for (dc = scr->drawers; dc != NULL; dc = dc->next)
{
if (dc->adrawer == wapp->app_icon->dock)
break;
}
assert(dc != NULL);
name = dc->adrawer->icon_array[0]->wm_instance;
}
dock = WMCreatePLString(name);
WMPutInPLDictionary(win_state, sDock, dock);
@@ -462,7 +474,9 @@ void wSessionRestoreState(WScreen *scr)
if (sscanf(tmp, "%i", &n) != 1) {
if (!strcasecmp(tmp, "DOCK")) {
dock = scr->dock;
} else {
}
if (dock == NULL) // Try the clips
{
for (j = 0; j < scr->workspace_count; j++) {
if (strcmp(scr->workspaces[j]->name, tmp) == 0) {
dock = scr->workspaces[j]->clip;
@@ -470,6 +484,18 @@ void wSessionRestoreState(WScreen *scr)
}
}
}
if (dock == NULL) // Try the drawers
{
WDrawerChain *dc;
for (dc = scr->drawers; dc != NULL; dc = dc->next)
{
if (strcmp(dc->adrawer->icon_array[0]->wm_instance, tmp) == 0)
{
dock = dc->adrawer;
break;
}
}
}
} else {
if (n == 0) {
dock = scr->dock;