1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 20:38:08 +01:00

Make 'no miniaturizable' window property user-configurable

The flag to not let windows be minimized was already defined in
WM (it's called 'no_miniaturizable') and the minimize functions
respect it. However this flag can not currently be set manually.

As can be read in the NEWS file

  "NotMiniaturizable option changed to NoMiniaturizeButton"

it seems that the "non miniaturizable" property was a first-class citizen
in ancient times and probably configurable (those changes do not appear in
the old CVS history).

Let's make this property be user-configurable through the "Advanced Options"
panel.

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
Carlos R. Mafra
2011-08-11 13:17:28 +02:00
parent 25c67fc7cc
commit 8ba6118c2e
2 changed files with 29 additions and 9 deletions

View File

@@ -55,6 +55,7 @@ static char *getString(WMPropList *, WMPropList *);
static WMPropList *ANoTitlebar = NULL; static WMPropList *ANoTitlebar = NULL;
static WMPropList *ANoResizebar; static WMPropList *ANoResizebar;
static WMPropList *ANoMiniaturizeButton; static WMPropList *ANoMiniaturizeButton;
static WMPropList *ANoMiniaturizable;
static WMPropList *ANoCloseButton; static WMPropList *ANoCloseButton;
static WMPropList *ANoBorder; static WMPropList *ANoBorder;
static WMPropList *ANoHideOthers; static WMPropList *ANoHideOthers;
@@ -92,6 +93,7 @@ static void init_wdefaults(WScreen * scr)
ANoTitlebar = WMCreatePLString("NoTitlebar"); ANoTitlebar = WMCreatePLString("NoTitlebar");
ANoResizebar = WMCreatePLString("NoResizebar"); ANoResizebar = WMCreatePLString("NoResizebar");
ANoMiniaturizeButton = WMCreatePLString("NoMiniaturizeButton"); ANoMiniaturizeButton = WMCreatePLString("NoMiniaturizeButton");
ANoMiniaturizable = WMCreatePLString("NoMiniaturizable");
ANoCloseButton = WMCreatePLString("NoCloseButton"); ANoCloseButton = WMCreatePLString("NoCloseButton");
ANoBorder = WMCreatePLString("NoBorder"); ANoBorder = WMCreatePLString("NoBorder");
ANoHideOthers = WMCreatePLString("NoHideOthers"); ANoHideOthers = WMCreatePLString("NoHideOthers");
@@ -243,6 +245,9 @@ wDefaultFillAttributes(WScreen * scr, char *instance, char *class,
value = get_value(dw, dc, dn, da, ANoMiniaturizeButton, No, useGlobalDefault); value = get_value(dw, dc, dn, da, ANoMiniaturizeButton, No, useGlobalDefault);
APPLY_VAL(value, no_miniaturize_button, ANoMiniaturizeButton); APPLY_VAL(value, no_miniaturize_button, ANoMiniaturizeButton);
value = get_value(dw, dc, dn, da, ANoMiniaturizable, No, useGlobalDefault);
APPLY_VAL(value, no_miniaturizable, ANoMiniaturizable);
value = get_value(dw, dc, dn, da, ANoCloseButton, No, useGlobalDefault); value = get_value(dw, dc, dn, da, ANoCloseButton, No, useGlobalDefault);
APPLY_VAL(value, no_close_button, ANoCloseButton); APPLY_VAL(value, no_close_button, ANoCloseButton);

View File

@@ -89,9 +89,9 @@ typedef struct InspectorPanel {
/* 3rd page. more attributes */ /* 3rd page. more attributes */
WMFrame *moreFrm; WMFrame *moreFrm;
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
WMButton *moreChk[11]; WMButton *moreChk[12];
#else #else
WMButton *moreChk[10]; WMButton *moreChk[11];
#endif #endif
/* 4th page. icon and workspace */ /* 4th page. icon and workspace */
@@ -146,6 +146,7 @@ static WMPropList *ADontSaveSession;
static WMPropList *AEmulateAppIcon; static WMPropList *AEmulateAppIcon;
static WMPropList *AFullMaximize; static WMPropList *AFullMaximize;
static WMPropList *ASharedAppIcon; static WMPropList *ASharedAppIcon;
static WMPropList *ANoMiniaturizable;
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
static WMPropList *ANoLanguageButton; static WMPropList *ANoLanguageButton;
#endif #endif
@@ -199,6 +200,7 @@ static void make_keys(void)
AEmulateAppIcon = WMCreatePLString("EmulateAppIcon"); AEmulateAppIcon = WMCreatePLString("EmulateAppIcon");
AFullMaximize = WMCreatePLString("FullMaximize"); AFullMaximize = WMCreatePLString("FullMaximize");
ASharedAppIcon = WMCreatePLString("SharedAppIcon"); ASharedAppIcon = WMCreatePLString("SharedAppIcon");
ANoMiniaturizable = WMCreatePLString("NoMiniaturizable");
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
ANoLanguageButton = WMCreatePLString("NoLanguageButton"); ANoLanguageButton = WMCreatePLString("NoLanguageButton");
#endif #endif
@@ -597,8 +599,11 @@ static void saveSettings(WMButton * button, InspectorPanel * panel)
value = (WMGetButtonSelected(panel->moreChk[9]) != 0) ? Yes : No; value = (WMGetButtonSelected(panel->moreChk[9]) != 0) ? Yes : No;
different |= insertAttribute(dict, winDic, AFocusAcrossWorkspace, value, flags); different |= insertAttribute(dict, winDic, AFocusAcrossWorkspace, value, flags);
#ifdef XKB_BUTTON_HINT
value = (WMGetButtonSelected(panel->moreChk[10]) != 0) ? Yes : No; value = (WMGetButtonSelected(panel->moreChk[10]) != 0) ? Yes : No;
different |= insertAttribute(dict, winDic, ANoMiniaturizable, value, flags);
#ifdef XKB_BUTTON_HINT
value = (WMGetButtonSelected(panel->moreChk[11]) != 0) ? Yes : No;
different |= insertAttribute(dict, winDic, ANoLanguageButton, value, flags); different |= insertAttribute(dict, winDic, ANoLanguageButton, value, flags);
#endif #endif
@@ -774,8 +779,9 @@ static void applySettings(WMButton * button, InspectorPanel * panel)
WSETUFLAG(wwin, dont_save_session, WMGetButtonSelected(panel->moreChk[7])); WSETUFLAG(wwin, dont_save_session, WMGetButtonSelected(panel->moreChk[7]));
WSETUFLAG(wwin, emulate_appicon, WMGetButtonSelected(panel->moreChk[8])); WSETUFLAG(wwin, emulate_appicon, WMGetButtonSelected(panel->moreChk[8]));
WSETUFLAG(wwin, focus_across_wksp, WMGetButtonSelected(panel->moreChk[9])); WSETUFLAG(wwin, focus_across_wksp, WMGetButtonSelected(panel->moreChk[9]));
WSETUFLAG(wwin, no_miniaturizable, WMGetButtonSelected(panel->moreChk[10]));
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
WSETUFLAG(wwin, no_language_button, WMGetButtonSelected(panel->moreChk[10])); WSETUFLAG(wwin, no_language_button, WMGetButtonSelected(panel->moreChk[11]));
#endif #endif
WSETUFLAG(wwin, always_user_icon, WMGetButtonSelected(panel->alwChk)); WSETUFLAG(wwin, always_user_icon, WMGetButtonSelected(panel->alwChk));
@@ -919,7 +925,7 @@ static void revertSettings(WMButton * button, InspectorPanel * panel)
} }
WMSetButtonSelected(panel->attrChk[i], flag); WMSetButtonSelected(panel->attrChk[i], flag);
} }
for (i = 0; i < 11; i++) { for (i = 0; i < 12; i++) {
int flag = 0; int flag = 0;
switch (i) { switch (i) {
@@ -953,8 +959,11 @@ static void revertSettings(WMButton * button, InspectorPanel * panel)
case 9: case 9:
flag = WFLAGP(wwin, focus_across_wksp); flag = WFLAGP(wwin, focus_across_wksp);
break; break;
#ifdef XKB_BUTTON_HINT
case 10: case 10:
flag = WFLAGP(wwin, no_miniaturizable);
break;
#ifdef XKB_BUTTON_HINT
case 11:
flag = WFLAGP(wwin, no_language_button); flag = WFLAGP(wwin, no_language_button);
break; break;
#endif #endif
@@ -1329,9 +1338,9 @@ static InspectorPanel *createInspectorForWindow(WWindow * wwin, int xpos, int yp
for (i = 0; for (i = 0;
#ifdef XKB_BUTTON_HINT #ifdef XKB_BUTTON_HINT
i < 11; i < 12;
#else #else
i < 10; i < 11;
#endif #endif
i++) { i++) {
char *caption = NULL; char *caption = NULL;
@@ -1399,8 +1408,14 @@ static InspectorPanel *createInspectorForWindow(WWindow * wwin, int xpos, int yp
descr = _("Allow Window Maker to switch workspace to satisfy\n" descr = _("Allow Window Maker to switch workspace to satisfy\n"
"a focus request (annoying)."); "a focus request (annoying).");
break; break;
#ifdef XKB_BUTTON_HINT
case 10: case 10:
caption = _("Do not let it be minimized");
flag = WFLAGP(wwin, no_miniaturizable);
descr = _("Do not let the window of this application be\n"
"minimized.\n");
break;
#ifdef XKB_BUTTON_HINT
case 11:
caption = _("Disable language button"); caption = _("Disable language button");
flag = WFLAGP(wwin, no_language_button); flag = WFLAGP(wwin, no_language_button);
descr = _("Remove the `toggle language' button of the window."); descr = _("Remove the `toggle language' button of the window.");