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

XKB lock relate. Allow you to disable language button in advance setting.

This commit is contained in:
id
1999-05-29 15:45:19 +00:00
parent 3b98adc9ae
commit a43f369ec3
4 changed files with 60 additions and 0 deletions

View File

@@ -83,6 +83,9 @@ static proplist_t AStartHidden; /* app */
static proplist_t ADontSaveSession; /* app */ static proplist_t ADontSaveSession; /* app */
static proplist_t AEmulateAppIcon; static proplist_t AEmulateAppIcon;
static proplist_t AFullMaximize; static proplist_t AFullMaximize;
#ifdef XKB_BUTTON_HINT
static proplist_t ANoLanguageButton;
#endif
static proplist_t AStartWorkspace; static proplist_t AStartWorkspace;
@@ -119,6 +122,9 @@ init_wdefaults(WScreen *scr)
ADontSaveSession = PLMakeString("DontSaveSession"); ADontSaveSession = PLMakeString("DontSaveSession");
AEmulateAppIcon = PLMakeString("EmulateAppIcon"); AEmulateAppIcon = PLMakeString("EmulateAppIcon");
AFullMaximize = PLMakeString("FullMaximize"); AFullMaximize = PLMakeString("FullMaximize");
#ifdef XKB_BUTTON_HINT
ANoLanguageButton = PLMakeString("NoLanguageButton");
#endif
AStartWorkspace = PLMakeString("StartWorkspace"); AStartWorkspace = PLMakeString("StartWorkspace");
@@ -304,6 +310,11 @@ wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
value = get_value(dw, dc, dn, da, AFullMaximize, No, useGlobalDefault); value = get_value(dw, dc, dn, da, AFullMaximize, No, useGlobalDefault);
APPLY_VAL(value, full_maximize, AFullMaximize); APPLY_VAL(value, full_maximize, AFullMaximize);
#ifdef XKB_BUTTON_HINT
value = get_value(dw, dc, dn, da, ANoLanguageButton, No, useGlobalDefault);
APPLY_VAL(value, no_language_button, ANoLanguageButton);
#endif
/* clean up */ /* clean up */
PLSetStringCmpHook(StringCompareHook); PLSetStringCmpHook(StringCompareHook);
} }

View File

@@ -2086,6 +2086,9 @@ wWindowConfigureBorders(WWindow *wwin)
int newy, oldh; int newy, oldh;
flags = WFF_LEFT_BUTTON|WFF_RIGHT_BUTTON; flags = WFF_LEFT_BUTTON|WFF_RIGHT_BUTTON;
#ifdef XKB_BUTTON_HINT
flags |= WFF_LANGUAGE_BUTTON;
#endif
if (!WFLAGP(wwin, no_titlebar)) if (!WFLAGP(wwin, no_titlebar))
flags |= WFF_TITLEBAR; flags |= WFF_TITLEBAR;
if (!WFLAGP(wwin, no_resizebar)) if (!WFLAGP(wwin, no_resizebar))
@@ -2108,6 +2111,12 @@ wWindowConfigureBorders(WWindow *wwin)
&& wwin->frame->flags.hide_left_button) && wwin->frame->flags.hide_left_button)
flags |= WFF_LEFT_BUTTON; flags |= WFF_LEFT_BUTTON;
#ifdef XKB_BUTTON_HINT
if (!WFLAGP(wwin, no_language_button)
&& wwin->frame->flags.hide_language_button)
flags |= WFF_LANGUAGE_BUTTON;
#endif
if (!WFLAGP(wwin, no_close_button) if (!WFLAGP(wwin, no_close_button)
&& wwin->frame->flags.hide_right_button) && wwin->frame->flags.hide_right_button)
flags |= WFF_RIGHT_BUTTON; flags |= WFF_RIGHT_BUTTON;
@@ -2122,6 +2131,12 @@ wWindowConfigureBorders(WWindow *wwin)
&& !wwin->frame->flags.hide_left_button) && !wwin->frame->flags.hide_left_button)
flags |= WFF_LEFT_BUTTON; flags |= WFF_LEFT_BUTTON;
#ifdef XKB_BUTTON_HINT
if (WFLAGP(wwin, no_language_button)
&& !wwin->frame->flags.hide_language_button)
flags |= WFF_LANGUAGE_BUTTON;
#endif
if (WFLAGP(wwin, no_close_button) if (WFLAGP(wwin, no_close_button)
&& !wwin->frame->flags.hide_right_button) && !wwin->frame->flags.hide_right_button)
flags |= WFF_RIGHT_BUTTON; flags |= WFF_RIGHT_BUTTON;

View File

@@ -74,6 +74,9 @@ static proplist_t AStartMaximized;
static proplist_t ADontSaveSession; static proplist_t ADontSaveSession;
static proplist_t AEmulateAppIcon; static proplist_t AEmulateAppIcon;
static proplist_t AFullMaximize; static proplist_t AFullMaximize;
#ifdef XKB_BUTTON_HINT
static proplist_t ANoLanguageButton;
#endif
static proplist_t AStartWorkspace; static proplist_t AStartWorkspace;
@@ -122,6 +125,9 @@ make_keys()
ADontSaveSession = PLMakeString("DontSaveSession"); ADontSaveSession = PLMakeString("DontSaveSession");
AEmulateAppIcon = PLMakeString("EmulateAppIcon"); AEmulateAppIcon = PLMakeString("EmulateAppIcon");
AFullMaximize = PLMakeString("FullMaximize"); AFullMaximize = PLMakeString("FullMaximize");
#ifdef XKB_BUTTON_HINT
ANoLanguageButton = PLMakeString("NoLanguageButton");
#endif
AStartWorkspace = PLMakeString("StartWorkspace"); AStartWorkspace = PLMakeString("StartWorkspace");
@@ -534,6 +540,11 @@ saveSettings(WMButton *button, InspectorPanel *panel)
value = (WMGetButtonSelected(panel->moreChk[7])!=0) ? Yes : No; value = (WMGetButtonSelected(panel->moreChk[7])!=0) ? Yes : No;
insertAttribute(dict, winDic, AFullMaximize, value, &different, flags); insertAttribute(dict, winDic, AFullMaximize, value, &different, flags);
#ifdef XKB_BUTTON_HINT
value = (WMGetButtonSelected(panel->moreChk[8])!=0) ? Yes : No;
insertAttribute(dict, winDic, ANoLanguageButton, value, &different, flags);
#endif
/* application wide settings for when */ /* application wide settings for when */
/* the window is the leader, save the attribute with the others */ /* the window is the leader, save the attribute with the others */
if (panel->inspected->main_window == panel->inspected->client_win) { if (panel->inspected->main_window == panel->inspected->client_win) {
@@ -713,6 +724,9 @@ applySettings(WMButton *button, InspectorPanel *panel)
WSETUFLAG(wwin, dont_save_session, WMGetButtonSelected(panel->moreChk[5])); WSETUFLAG(wwin, dont_save_session, WMGetButtonSelected(panel->moreChk[5]));
WSETUFLAG(wwin, emulate_appicon, WMGetButtonSelected(panel->moreChk[6])); WSETUFLAG(wwin, emulate_appicon, WMGetButtonSelected(panel->moreChk[6]));
WSETUFLAG(wwin, full_maximize, WMGetButtonSelected(panel->moreChk[7])); WSETUFLAG(wwin, full_maximize, WMGetButtonSelected(panel->moreChk[7]));
#ifdef XKB_BUTTON_HINT
WSETUFLAG(wwin, no_language_button, WMGetButtonSelected(panel->moreChk[8]));
#endif
WSETUFLAG(wwin, always_user_icon, WMGetButtonSelected(panel->alwChk)); WSETUFLAG(wwin, always_user_icon, WMGetButtonSelected(panel->alwChk));
if (WFLAGP(wwin, no_titlebar) && wwin->flags.shaded) if (WFLAGP(wwin, no_titlebar) && wwin->flags.shaded)
@@ -885,6 +899,11 @@ revertSettings(WMButton *button, InspectorPanel *panel)
case 7: case 7:
flag = WFLAGP(wwin, full_maximize); flag = WFLAGP(wwin, full_maximize);
break; break;
#ifdef XKB_BUTTON_HINT
case 8:
flag = WFLAGP(wwin, no_language_button);
break;
#endif
} }
WMSetButtonSelected(panel->moreChk[i], flag); WMSetButtonSelected(panel->moreChk[i], flag);
} }
@@ -1194,7 +1213,11 @@ createInspectorForWindow(WWindow *wwin)
WMMoveWidget(panel->moreFrm, 15, 45); WMMoveWidget(panel->moreFrm, 15, 45);
WMResizeWidget(panel->moreFrm, frame_width, 250); WMResizeWidget(panel->moreFrm, frame_width, 250);
#ifdef XKB_BUTTON_HINT
for (i=0; i < 9; i++) {
#else
for (i=0; i < 8; i++) { for (i=0; i < 8; i++) {
#endif
char *caption = NULL; char *caption = NULL;
int flag = 0; int flag = 0;
char *descr = NULL; char *descr = NULL;
@@ -1255,6 +1278,13 @@ createInspectorForWindow(WWindow *wwin)
"maximized. The titlebar and resizebar will be moved\n" "maximized. The titlebar and resizebar will be moved\n"
"to outside the screen."); "to outside the screen.");
break; break;
#ifdef XKB_BUTTON_HINT
case 8:
caption = _("Disable Language Button");
flag = WFLAGP(wwin, no_language_button);
descr = _("Remove the `toggle language' button of the window.");
break;
#endif
} }
panel->moreChk[i] = WMCreateSwitchButton(panel->moreFrm); panel->moreChk[i] = WMCreateSwitchButton(panel->moreFrm);
WMMoveWidget(panel->moreChk[i], 10, 20*(i+1)); WMMoveWidget(panel->moreChk[i], 10, 20*(i+1));

View File

@@ -60,7 +60,11 @@ typedef struct InspectorPanel {
/* 3rd page. more attributes */ /* 3rd page. more attributes */
WMFrame *moreFrm; WMFrame *moreFrm;
#ifdef XKB_BUTTON_HINT
WMButton *moreChk[9];
#else
WMButton *moreChk[8]; WMButton *moreChk[8];
#endif
/* 4th page. icon and workspace */ /* 4th page. icon and workspace */
WMFrame *iconFrm; WMFrame *iconFrm;