Skip to content

Commit f13768c

Browse files
committed
FvwmIconMan: Sort: add screen
Allow to sort windows by the screen they're on. XXX: WeightedSort to follow...
1 parent 3110289 commit f13768c

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

modules/FvwmIconMan/FvwmIconMan.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ typedef enum {
260260
SortId, /* sort by window id */
261261
SortName, /* case insensitive name sorting */
262262
SortNameCase, /* case sensitive name sorting */
263+
SortScreen, /* Sort by screen */
263264
SortWeighted, /* custom sort order */
264265
} SortType;
265266

@@ -268,6 +269,7 @@ typedef struct {
268269
char *classname;
269270
char *titlename;
270271
char *iconname;
272+
char *screenname;
271273
int weight;
272274
} WeightedSort;
273275

modules/FvwmIconMan/readconfig.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,6 +1834,9 @@ void read_in_resources(void)
18341834
else if (!strcasecmp(p, "none")) {
18351835
i = SortNone;
18361836
}
1837+
else if (!strcasecmp(p, "screen")) {
1838+
i = SortScreen;
1839+
}
18371840
else if (!strcasecmp(p, "weighted")) {
18381841
i = SortWeighted;
18391842
}

modules/FvwmIconMan/xmanager.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2204,6 +2204,11 @@ static int compare_windows(SortType type, WinData *a, WinData *b)
22042204
return strcmp((a->display_string)? a->display_string:"",
22052205
(b->display_string)? b->display_string:"");
22062206
}
2207+
else if (type == SortScreen)
2208+
{
2209+
return (strcmp(a->monitor ? a->monitor : "",
2210+
b->monitor ? b->monitor : ""));
2211+
}
22072212
else if (type == SortWeighted)
22082213
{
22092214
wa = compute_weight(a);

0 commit comments

Comments
 (0)