mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
Add new cycling option
When using Xinerama, make it possible only to cycle between those windows that are on the currently active head - AFAICT this means windows that have the majority of their area on the same head as the pointer. Patch complete with WPrefs integration, alas this being quite unusable - for a lack of a better idea, I tucked the option on the expert panel, making the item list too tall - making it scrollable would be a nice addition. The default for the new option (CycleActiveHeadOnly) should be NO, that is, no change in default behaviour.
This commit is contained in:
committed by
Carlos R. Mafra
parent
3f8248f534
commit
b59575e709
@@ -32,7 +32,7 @@ typedef struct _Panel {
|
|||||||
|
|
||||||
WMWidget *parent;
|
WMWidget *parent;
|
||||||
|
|
||||||
WMButton *swi[8];
|
WMButton *swi[9];
|
||||||
|
|
||||||
} _Panel;
|
} _Panel;
|
||||||
|
|
||||||
@@ -50,6 +50,7 @@ static void showData(_Panel * panel)
|
|||||||
WMSetButtonSelected(panel->swi[5], GetBoolForKey("DisableBlinking"));
|
WMSetButtonSelected(panel->swi[5], GetBoolForKey("DisableBlinking"));
|
||||||
WMSetButtonSelected(panel->swi[6], GetBoolForKey("AntialiasedText"));
|
WMSetButtonSelected(panel->swi[6], GetBoolForKey("AntialiasedText"));
|
||||||
WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch"));
|
WMSetButtonSelected(panel->swi[7], GetBoolForKey("SingleClickLaunch"));
|
||||||
|
WMSetButtonSelected(panel->swi[8], GetBoolForKey("CycleActiveHeadOnly"));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void createPanel(Panel * p)
|
static void createPanel(Panel * p)
|
||||||
@@ -60,12 +61,14 @@ static void createPanel(Panel * p)
|
|||||||
panel->box = WMCreateBox(panel->parent);
|
panel->box = WMCreateBox(panel->parent);
|
||||||
WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
|
WMSetViewExpandsToParent(WMWidgetView(panel->box), 2, 2, 2, 2);
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 9; i++) {
|
||||||
panel->swi[i] = WMCreateSwitchButton(panel->box);
|
panel->swi[i] = WMCreateSwitchButton(panel->box);
|
||||||
WMResizeWidget(panel->swi[i], FRAME_WIDTH - 40, 25);
|
WMResizeWidget(panel->swi[i], FRAME_WIDTH - 40, 25);
|
||||||
WMMoveWidget(panel->swi[i], 20, 20 + i * 25);
|
WMMoveWidget(panel->swi[i], 20, 20 + i * 25);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* XXX: it would be HIGHLY desireable if this could scroll vertically */
|
||||||
|
|
||||||
WMSetButtonText(panel->swi[0],
|
WMSetButtonText(panel->swi[0],
|
||||||
_("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."));
|
_("Disable miniwindows (icons for minimized windows). For use with KDE/GNOME."));
|
||||||
WMSetButtonText(panel->swi[1], _("Do not set non-WindowMaker specific parameters (do not use xset)."));
|
WMSetButtonText(panel->swi[1], _("Do not set non-WindowMaker specific parameters (do not use xset)."));
|
||||||
@@ -75,6 +78,7 @@ static void createPanel(Panel * p)
|
|||||||
WMSetButtonText(panel->swi[5], _("Disable selection animation for selected icons."));
|
WMSetButtonText(panel->swi[5], _("Disable selection animation for selected icons."));
|
||||||
WMSetButtonText(panel->swi[6], _("Smooth font edges (needs restart)."));
|
WMSetButtonText(panel->swi[6], _("Smooth font edges (needs restart)."));
|
||||||
WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click."));
|
WMSetButtonText(panel->swi[7], _("Launch applications and restore windows with a single click."));
|
||||||
|
WMSetButtonText(panel->swi[8], _("Cycle windows only on the active head."));
|
||||||
|
|
||||||
WMSetButtonEnabled(panel->swi[6], True);
|
WMSetButtonEnabled(panel->swi[6], True);
|
||||||
|
|
||||||
@@ -98,6 +102,7 @@ static void storeDefaults(_Panel * panel)
|
|||||||
SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DisableBlinking");
|
SetBoolForKey(WMGetButtonSelected(panel->swi[5]), "DisableBlinking");
|
||||||
SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "AntialiasedText");
|
SetBoolForKey(WMGetButtonSelected(panel->swi[6]), "AntialiasedText");
|
||||||
SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
|
SetBoolForKey(WMGetButtonSelected(panel->swi[7]), "SingleClickLaunch");
|
||||||
|
SetBoolForKey(WMGetButtonSelected(panel->swi[8]), "CycleActiveHeadOnly");
|
||||||
}
|
}
|
||||||
|
|
||||||
Panel *InitExpert(WMScreen * scr, WMWidget * parent)
|
Panel *InitExpert(WMScreen * scr, WMWidget * parent)
|
||||||
|
|||||||
@@ -413,6 +413,7 @@ typedef struct WPreferences {
|
|||||||
char workspace_border_position; /* Where to leave a workspace border */
|
char workspace_border_position; /* Where to leave a workspace border */
|
||||||
char single_click; /* single click to lauch applications */
|
char single_click; /* single click to lauch applications */
|
||||||
int history_lines; /* history of "Run..." dialog */
|
int history_lines; /* history of "Run..." dialog */
|
||||||
|
char cycle_active_head_only; /* Cycle only windows on the active head */
|
||||||
|
|
||||||
RImage *swtileImage;
|
RImage *swtileImage;
|
||||||
RImage *swbackImage[9];
|
RImage *swbackImage[9];
|
||||||
|
|||||||
@@ -655,7 +655,9 @@ WDefaultEntry optionList[] = {
|
|||||||
{"SelectCursor", "(builtin, cross)", (void *)WCUR_SELECT,
|
{"SelectCursor", "(builtin, cross)", (void *)WCUR_SELECT,
|
||||||
NULL, getCursor, setCursor},
|
NULL, getCursor, setCursor},
|
||||||
{"DialogHistoryLines", "500", NULL,
|
{"DialogHistoryLines", "500", NULL,
|
||||||
&wPreferences.history_lines, getInt, NULL}
|
&wPreferences.history_lines, getInt, NULL},
|
||||||
|
{"CycleActiveHeadOnly", "NO", NULL,
|
||||||
|
&wPreferences.cycle_active_head_only, getBool, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|||||||
@@ -80,6 +80,11 @@ static int canReceiveFocus(WWindow * wwin)
|
|||||||
{
|
{
|
||||||
if (wwin->frame->workspace != wwin->screen_ptr->current_workspace)
|
if (wwin->frame->workspace != wwin->screen_ptr->current_workspace)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (wPreferences.cycle_active_head_only &&
|
||||||
|
wGetHeadForWindow(wwin) != wGetHeadForPointerLocation(wwin->screen_ptr))
|
||||||
|
return 0;
|
||||||
|
|
||||||
if (!wwin->flags.mapped) {
|
if (!wwin->flags.mapped) {
|
||||||
if (!wwin->flags.shaded && !wwin->flags.miniaturized && !wwin->flags.hidden)
|
if (!wwin->flags.shaded && !wwin->flags.miniaturized && !wwin->flags.hidden)
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user