mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 04:20:27 +01:00
fixed cycling
This commit is contained in:
@@ -216,14 +216,16 @@ StartWindozeCycle(WWindow *wwin, XEvent *event, Bool next)
|
|||||||
scr->flags.doing_alt_tab = 1;
|
scr->flags.doing_alt_tab = 1;
|
||||||
|
|
||||||
#ifdef MOX_CYCLING
|
#ifdef MOX_CYCLING
|
||||||
swpanel = wInitSwitchPanel(scr, scr->current_workspace);
|
swpanel = wInitSwitchPanel(scr, wwin, scr->current_workspace);
|
||||||
oldFocused = wwin;
|
oldFocused = wwin;
|
||||||
|
|
||||||
if (swpanel) {
|
if (swpanel) {
|
||||||
newFocused = wSwitchPanelSelectNext(swpanel, next);
|
newFocused = wSwitchPanelSelectNext(swpanel, !next);
|
||||||
wWindowFocus(newFocused, oldFocused);
|
wWindowFocus(newFocused, oldFocused);
|
||||||
oldFocused = newFocused;
|
oldFocused = newFocused;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
newFocused= wwin;
|
||||||
#else /* !MOX_CYCLING */
|
#else /* !MOX_CYCLING */
|
||||||
if (next) {
|
if (next) {
|
||||||
if (wPreferences.windows_cycling)
|
if (wPreferences.windows_cycling)
|
||||||
|
|||||||
@@ -1076,7 +1076,7 @@ wFrameWindowPaint(WFrameWindow *fwin)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
y = *fwin->title_clearance + TITLEBAR_EXTEND_SPACE - 1;
|
y = *fwin->title_clearance + TITLEBAR_EXTEND_SPACE;
|
||||||
h = WMFontHeight(*fwin->font);
|
h = WMFontHeight(*fwin->font);
|
||||||
|
|
||||||
/* We use a w+2 buffer to have an extra pixel on the left and
|
/* We use a w+2 buffer to have an extra pixel on the left and
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ static void addIconForWindow(WSwitchPanel *panel, WWindow *wwin, int iconWidth)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
WSwitchPanel *wInitSwitchPanel(WScreen *scr, int workspace)
|
WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace)
|
||||||
{
|
{
|
||||||
WWindow *wwin;
|
WWindow *wwin;
|
||||||
WSwitchPanel *panel= wmalloc(sizeof(WSwitchPanel));
|
WSwitchPanel *panel= wmalloc(sizeof(WSwitchPanel));
|
||||||
@@ -218,7 +218,6 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, int workspace)
|
|||||||
int iconWidth = ICON_IDEAL_SIZE;
|
int iconWidth = ICON_IDEAL_SIZE;
|
||||||
WMBox *vbox;
|
WMBox *vbox;
|
||||||
|
|
||||||
panel->current= 0;
|
|
||||||
panel->defIcon= NULL;
|
panel->defIcon= NULL;
|
||||||
|
|
||||||
panel->normalColor = WMGrayColor(scr->wmscreen);
|
panel->normalColor = WMGrayColor(scr->wmscreen);
|
||||||
@@ -227,7 +226,18 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, int workspace)
|
|||||||
panel->scr= scr;
|
panel->scr= scr;
|
||||||
panel->windows= WMCreateArray(10);
|
panel->windows= WMCreateArray(10);
|
||||||
|
|
||||||
for (wwin= scr->focused_window; wwin; wwin= wwin->prev) {
|
for (wwin= curwin; wwin; wwin= wwin->prev) {
|
||||||
|
if (wwin->frame->workspace == workspace && wWindowCanReceiveFocus(wwin) &&
|
||||||
|
(!WFLAGP(wwin, skip_window_list) || wwin->flags.internal_window)) {
|
||||||
|
WMInsertInArray(panel->windows, 0, wwin);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
wwin = curwin;
|
||||||
|
/* start over from the beginning of the list */
|
||||||
|
while (wwin->next)
|
||||||
|
wwin = wwin->next;
|
||||||
|
|
||||||
|
for (wwin= curwin; wwin && wwin != curwin; wwin= wwin->prev) {
|
||||||
if (wwin->frame->workspace == workspace && wWindowCanReceiveFocus(wwin) &&
|
if (wwin->frame->workspace == workspace && wWindowCanReceiveFocus(wwin) &&
|
||||||
(!WFLAGP(wwin, skip_window_list) || wwin->flags.internal_window)) {
|
(!WFLAGP(wwin, skip_window_list) || wwin->flags.internal_window)) {
|
||||||
WMInsertInArray(panel->windows, 0, wwin);
|
WMInsertInArray(panel->windows, 0, wwin);
|
||||||
@@ -274,6 +284,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, int workspace)
|
|||||||
WMSetLabelText(panel->label, scr->focused_window->frame->title);
|
WMSetLabelText(panel->label, scr->focused_window->frame->title);
|
||||||
else
|
else
|
||||||
WMSetLabelText(panel->label, "");
|
WMSetLabelText(panel->label, "");
|
||||||
|
|
||||||
{
|
{
|
||||||
WMColor *color;
|
WMColor *color;
|
||||||
WMFont *boldFont= WMBoldSystemFontOfSize(scr->wmscreen, 12);
|
WMFont *boldFont= WMBoldSystemFontOfSize(scr->wmscreen, 12);
|
||||||
@@ -316,7 +327,7 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, int workspace)
|
|||||||
|
|
||||||
panel->hbox = WMCreateBox(vbox);
|
panel->hbox = WMCreateBox(vbox);
|
||||||
WMSetBoxHorizontal(panel->hbox, True);
|
WMSetBoxHorizontal(panel->hbox, True);
|
||||||
WMAddBoxSubviewAtEnd(vbox, WMWidgetView(panel->hbox), True, True, 20, 0, 2);
|
WMAddBoxSubviewAtEnd(vbox, WMWidgetView(panel->hbox), True, True, 20, 0, 4);
|
||||||
|
|
||||||
WM_ITERATE_ARRAY(panel->windows, wwin, i) {
|
WM_ITERATE_ARRAY(panel->windows, wwin, i) {
|
||||||
addIconForWindow(panel, wwin, iconWidth);
|
addIconForWindow(panel, wwin, iconWidth);
|
||||||
@@ -334,7 +345,8 @@ WSwitchPanel *wInitSwitchPanel(WScreen *scr, int workspace)
|
|||||||
WMMoveWidget(panel->win, center.x, center.y);
|
WMMoveWidget(panel->win, center.x, center.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
changeImage(panel, 0, 1);
|
panel->current= WMGetFirstInArray(panel->windows, curwin);
|
||||||
|
changeImage(panel, panel->current, 1);
|
||||||
|
|
||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
typedef struct SwitchPanel WSwitchPanel;
|
typedef struct SwitchPanel WSwitchPanel;
|
||||||
|
|
||||||
WSwitchPanel *wInitSwitchPanel(WScreen *scr, int workspace);
|
WSwitchPanel *wInitSwitchPanel(WScreen *scr, WWindow *curwin, int workspace);
|
||||||
|
|
||||||
void wSwitchPanelDestroy(WSwitchPanel *panel);
|
void wSwitchPanelDestroy(WSwitchPanel *panel);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user