mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
- added WMRemoveFromArrayMatching(array, match, cdata), which will remove the
first element in the array that is matched by match(item, cdata)==True. - added WMArrayFirst(), WMArrayLast(), WMArrayNext() and WMArrayPrevious() functions and also WM_ITERATE_ARRAY() and WM_ETARETI_ARRAY() macros, to make interfaces to WMBag and WMArray similar and to make life a little simpler when iterating through all elements of an array. - replaced bags with arrays wherever appropriate. This will improve performance a bit. - replaced some recursive code with iterative code in WINGs/selection.c - some code cleanup is src/
This commit is contained in:
12
src/window.c
12
src/window.c
@@ -227,10 +227,10 @@ wWindowDestroy(WWindow *wwin)
|
||||
if (!wwin->screen_ptr->shortcutWindows[i])
|
||||
continue;
|
||||
|
||||
WMRemoveFromBag(wwin->screen_ptr->shortcutWindows[i], wwin);
|
||||
WMRemoveFromArray(wwin->screen_ptr->shortcutWindows[i], wwin);
|
||||
|
||||
if (!WMGetBagItemCount(wwin->screen_ptr->shortcutWindows[i])) {
|
||||
WMFreeBag(wwin->screen_ptr->shortcutWindows[i]);
|
||||
if (!WMGetArrayItemCount(wwin->screen_ptr->shortcutWindows[i])) {
|
||||
WMFreeArray(wwin->screen_ptr->shortcutWindows[i]);
|
||||
wwin->screen_ptr->shortcutWindows[i] = NULL;
|
||||
}
|
||||
}
|
||||
@@ -862,9 +862,9 @@ wManageWindow(WScreen *scr, Window window)
|
||||
for (i = 0; i < MAX_WINDOW_SHORTCUTS; i++) {
|
||||
if (mask & (1<<i)) {
|
||||
if (!scr->shortcutWindows[i])
|
||||
scr->shortcutWindows[i] = WMCreateBag(4);
|
||||
scr->shortcutWindows[i] = WMCreateArray(4);
|
||||
|
||||
WMPutInBag(scr->shortcutWindows[i], wwin);
|
||||
WMAddToArray(scr->shortcutWindows[i], wwin);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2372,7 +2372,7 @@ wWindowSaveState(WWindow *wwin)
|
||||
|
||||
for (i = 0; i < MAX_WINDOW_SHORTCUTS; i++) {
|
||||
if (wwin->screen_ptr->shortcutWindows[i] &&
|
||||
WMCountInBag(wwin->screen_ptr->shortcutWindows[i], wwin))
|
||||
WMCountInArray(wwin->screen_ptr->shortcutWindows[i], wwin))
|
||||
data[9] |= 1<<i;
|
||||
}
|
||||
XChangeProperty(dpy, wwin->client_win, _XA_WINDOWMAKER_STATE,
|
||||
|
||||
Reference in New Issue
Block a user