1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 14:08:06 +01:00

Revert "wmaker: fix clearing of window attribute that was not saved properly"

This reverts commit 14d1d3f141.

Conflicts:
	src/winspector.c

Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
Carlos R. Mafra
2015-07-07 14:36:13 -03:00
parent e545b2abf9
commit fee129b181

View File

@@ -203,7 +203,6 @@ typedef struct InspectorPanel {
/* second page. attributes */
WMFrame *attrFrm;
WMButton *attrClient[sizeof(window_attribute) / sizeof(window_attribute[0])];
WMButton *attrChk[sizeof(window_attribute) / sizeof(window_attribute[0])];
/* 3rd page. more attributes */
@@ -643,27 +642,8 @@ static void saveSettings(WMWidget *button, void *client_data)
/* Attributes... --> Window Attributes */
for (i = 0; i < wlengthof(window_attribute); i++) {
WMPropList *old_value;
int state;
old_value = WMGetFromPLDictionary(winDic, pl_attribute[i]);
state = WMGetButtonSelected(panel->attrChk[i]);
if (state > 0) {
if ((old_value == NULL) || !getBool(old_value)) {
WMPutInPLDictionary(winDic, pl_attribute[i], Yes);
different |= 1;
}
} else if (state == 0) {
if ((old_value == NULL) || getBool(old_value)) {
WMPutInPLDictionary(winDic, pl_attribute[i], No);
different |= 1;
}
} else { /* (state < 0) */
if (old_value != NULL) {
WMRemoveFromPLDictionary(winDic, pl_attribute[i]);
different |= 1;
}
}
value = (WMGetButtonSelected(panel->attrChk[i]) != 0) ? Yes : No;
different |= insertAttribute(dict, winDic, pl_attribute[i], value, flags);
}
/* Attributes... --> Advanced Options */
@@ -746,18 +726,11 @@ static void applySettings(WMWidget *button, void *client_data)
/* Attributes... --> Window Attributes */
for (i = 0; i < wlengthof(window_attribute); i++) {
int state;
state = WMGetButtonSelected(panel->attrChk[i]);
if (state > 0)
if (WMGetButtonSelected(panel->attrChk[i]))
set_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
else
clear_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
if (state < 0)
clear_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
else
set_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
}
@@ -931,7 +904,7 @@ static void revertSettings(WMWidget *button, void *client_data)
if (is_userdef)
flag = get_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
else
flag = -1;
flag = get_attr_flag(&wwin->client_flags, &window_attribute[i].flag);
WMSetButtonSelected(panel->attrChk[i], flag);
}
@@ -1342,31 +1315,15 @@ static void create_tab_window_attributes(WWindow *wwin, InspectorPanel *panel, i
for (i = 0; i < wlengthof(window_attribute); i++) {
int is_userdef, flag;
/* Read-only button to display the state requested by the application */
flag = get_attr_flag(&wwin->client_flags, &window_attribute[i].flag);
panel->attrClient[i] = WMCreateSwitchButton(panel->attrFrm);
WMMoveWidget(panel->attrClient[i], 10, 20 * (i + 1));
WMResizeWidget(panel->attrClient[i], 20, 20);
WMSetButtonText(panel->attrClient[i], NULL);
WMSetButtonSelected(panel->attrClient[i], flag);
WMSetButtonEnabled(panel->attrClient[i], False);
WMSetBalloonTextForView(_("Shows the state that was asked by the application.\n"
"You can use the checkbox on the right to change this setting;\n"
"when it is grayed it means to follow application's choice."),
WMWidgetView(panel->attrClient[i]));
/* Button to let user override this choice */
is_userdef = get_attr_flag(&wwin->defined_user_flags, &window_attribute[i].flag);
if (is_userdef)
flag = get_attr_flag(&wwin->user_flags, &window_attribute[i].flag);
else
flag = -1;
flag = get_attr_flag(&wwin->client_flags, &window_attribute[i].flag);
panel->attrChk[i] = WMCreateButton(panel->attrFrm, WBTTriState);
WMMoveWidget(panel->attrChk[i], 30, 20 * (i + 1));
WMResizeWidget(panel->attrChk[i], frame_width - 45, 20);
panel->attrChk[i] = WMCreateSwitchButton(panel->attrFrm);
WMMoveWidget(panel->attrChk[i], 10, 20 * (i + 1));
WMResizeWidget(panel->attrChk[i], frame_width - 15, 20);
WMSetButtonSelected(panel->attrChk[i], flag);
WMSetButtonText(panel->attrChk[i], _(window_attribute[i].caption));