diff -ruN vtwm-5.4.7/doc/vtwm.man vtwm-5.4.7-kos/doc/vtwm.man --- vtwm-5.4.7/doc/vtwm.man 2005-05-09 08:51:19.000000000 -0400 +++ vtwm-5.4.7-kos/doc/vtwm.man 2005-10-15 19:22:13.201632009 -0400 @@ -841,6 +841,12 @@ .IP This behavior was inspired by that of \fBvuewm\fP(1), Hewlett-Packard's workspace implementation of \fBmwm\fP(1). +.IP "\fBFixedSizeIcons\fP" 8 +When this variable is set and an \fBIconRegion\fP is defined, all window icons +will be tiled according to the spacing set in the \fBIconRegion\fP definition. +To ensure uniform display, the icon size will be set equal to the tile size, +no window pixmap will be displayed and icon cells will be populated as windows +get iconized. .IP "\fBFixManagedVirtualGeometries\fP" 8 .IP "\fBFixTransientVirtualGeometries\fP" 8 These are bug workarounds that *should* fix the way most windows' diff -ruN vtwm-5.4.7/events.c vtwm-5.4.7-kos/events.c --- vtwm-5.4.7/events.c 2005-05-09 07:34:17.000000000 -0400 +++ vtwm-5.4.7-kos/events.c 2005-10-15 17:53:04.993949096 -0400 @@ -1213,6 +1213,9 @@ { int x, y; + if(Scr->FixedSizeIcons) + return; + if (Tmp_win->list) { /* let the expose event cause the repaint */ diff -ruN vtwm-5.4.7/icons.c vtwm-5.4.7-kos/icons.c --- vtwm-5.4.7/icons.c 2005-05-09 07:34:17.000000000 -0400 +++ vtwm-5.4.7-kos/icons.c 2005-10-15 19:34:24.375650613 -0400 @@ -190,6 +190,60 @@ Scr->FirstIconRegion = rr; } +/* + * Create a fixed size 2D icon. + */ + +void +CreateFixedSizeIconWindow(tmp_win, def_x, def_y) +TwmWindow *tmp_win; +int def_x, def_y; +{ + unsigned long event_mask; + unsigned long valuemask; /* mask for create windows */ + XSetWindowAttributes attributes; /* attributes for create windows */ + Pixmap pm = None; /* tmp pixmap variable */ + int final_x, final_y; + int x; + + /* Bail out if we don't have an Icon Region, or when 3D is set */ + if(!Scr->FirstIconRegion || Scr->IconBevelWidth > 0) { + CreateIconWindow(tmp_win, def_x, def_y); + return; + } + + GetColorFromList(Scr->IconBorderColorL, tmp_win->full_name, &tmp_win->class, + &tmp_win->icon_border); + GetColorFromList(Scr->IconForegroundL, tmp_win->full_name, &tmp_win->class, + &tmp_win->iconc.fore); + GetColorFromList(Scr->IconBackgroundL, tmp_win->full_name, &tmp_win->class, + &tmp_win->iconc.back); + + FB(tmp_win->iconc.fore, tmp_win->iconc.back); + + tmp_win->forced = FALSE; + tmp_win->icon_not_ours = FALSE; + + tmp_win->icon_w_width = Scr->FirstIconRegion->stepx - 7; + tmp_win->icon_w_height = Scr->FirstIconRegion->stepy - 6; + tmp_win->icon_x = 1; + tmp_win->icon_y = (tmp_win->icon_w_height / 2) + 4; + + tmp_win->icon_w = XCreateSimpleWindow(dpy, Scr->Root,0,0, + tmp_win->icon_w_width, tmp_win->icon_w_height, + Scr->IconBorderWidth, tmp_win->icon_border, + tmp_win->iconc.back); + XSelectInput (dpy, tmp_win->icon_w, + KeyPressMask | ButtonPressMask | ButtonReleaseMask | ExposureMask); + PlaceIcon(tmp_win, def_x, def_y, &final_x, &final_y); + XMoveWindow(dpy, tmp_win->icon_w, final_x, final_y); + tmp_win->iconified = TRUE; + XMapWindow(dpy, tmp_win->icon_w); + XSaveContext(dpy, tmp_win->icon_w, TwmContext, (caddr_t)tmp_win); + XSaveContext(dpy, tmp_win->icon_w, ScreenContext, (caddr_t)Scr); + XDefineCursor(dpy, tmp_win->icon_w, Scr->IconCursor); +} + #ifdef ORIGINAL_PIXMAPS void CreateIconWindow(tmp_win, def_x, def_y) TwmWindow *tmp_win; @@ -202,6 +256,11 @@ int final_x, final_y; int x; + if(Scr->FixedSizeIcons) { + CreateFixedSizeIconWindow(tmp_win, def_x, def_y); + return; + } + /* djhjr - 4/27/96 */ GetColorFromList(Scr->IconBorderColorL, tmp_win->full_name, &tmp_win->class, &tmp_win->icon_border); @@ -605,7 +664,12 @@ Image *iconimage; char *icon_name; int x, final_x, final_y; - unsigned int pm_numcolors = 0; /* djhjr - 12/28/98 */ + unsigned int pm_numcolors = 0; /* djhjr - 12/28/98 */ + + if(Scr->FixedSizeIcons) { + CreateFixedSizeIconWindow(tmp_win, def_x, def_y); + return; + } /* djhjr - 4/27/96 */ GetColorFromList(Scr->IconBorderColorL, tmp_win->full_name, &tmp_win->class, @@ -967,4 +1031,4 @@ return; } #endif /* ORIGINAL_PIXMAPS */ - + diff -ruN vtwm-5.4.7/parse.c vtwm-5.4.7-kos/parse.c --- vtwm-5.4.7/parse.c 2005-05-09 08:46:24.000000000 -0400 +++ vtwm-5.4.7-kos/parse.c 2005-10-15 19:32:29.875995072 -0400 @@ -504,6 +504,8 @@ /* djhjr - 11/3/03 */ #define kw0_RaiseOnStart 67 +#define kw0_FixedSizeIcons 68 + /* djhjr - 9/24/02 #define kws_UsePPosition 1 */ @@ -856,6 +858,8 @@ { "f.zoom", FKEYWORD, F_ZOOM }, { "f.zoomzoom", FKEYWORD, F_ZOOMZOOM }, + { "fixedsizeicons", KEYWORD, kw0_FixedSizeIcons }, + /* djhjr - 1/6/98 */ { "fixmanagedvirtualgeometries", KEYWORD, kw0_FixManagedVirtualGeometries }, @@ -1501,6 +1505,10 @@ case kw0_RaiseOnStart: Scr->RaiseOnStart = TRUE; return 1; + case kw0_FixedSizeIcons: + Scr->FixedSizeIcons = TRUE; + return 1; + } return 0; diff -ruN vtwm-5.4.7/screen.h vtwm-5.4.7-kos/screen.h --- vtwm-5.4.7/screen.h 2005-05-09 08:46:24.000000000 -0400 +++ vtwm-5.4.7-kos/screen.h 2005-10-15 19:33:11.652126289 -0400 @@ -503,6 +503,8 @@ /* djhjr - 11/3/03 */ short RaiseOnStart; + + short FixedSizeIcons; #else struct { @@ -778,6 +780,8 @@ /* djhjr - 9/10/03 */ int IgnoreModifiers; /* binding modifiers to ignore */ + short FixedSizeIcons; + FuncKey FuncKeyRoot; TwmDoor *Doors; /* a list of doors on this screen */ diff -ruN vtwm-5.4.7/twm.c vtwm-5.4.7-kos/twm.c --- vtwm-5.4.7/twm.c 2005-05-09 08:46:24.000000000 -0400 +++ vtwm-5.4.7-kos/twm.c 2005-10-15 18:22:26.486202896 -0400 @@ -531,6 +531,8 @@ Scr->menuIconName = TBPM_MENU; Scr->iconMgrIconName = TBPM_XLOGO; + Scr->FixedSizeIcons = FALSE; + /* djhjr - 10/30/02 Scr->siconifyPm = NULL; Scr->pullPm = NULL;