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

Changed "Keep Inside Screen" user option with "Ignore PPosition/PSize hints"

This commit is contained in:
dan
1999-09-17 22:11:43 +00:00
parent 0e263f7394
commit c917f68883
7 changed files with 29 additions and 28 deletions

View File

@@ -715,9 +715,6 @@ wClientGetNormalHints(WWindow *wwin, XWindowAttributes *wattribs, Bool geometry,
wwin->normal_hints->min_width = wwin->normal_hints->max_width;
}
#ifdef IGNORE_PPOSITION
wwin->normal_hints->flags &= ~PPosition;
#endif
if (/* check this !pre_icccm && */!wwin->screen_ptr->flags.startup && geometry) {
if (wwin->normal_hints->flags & (USPosition|PPosition)) {
*x = wwin->normal_hints->x;

View File

@@ -844,7 +844,7 @@ makeAttributeState(WWindow *wwin)
W_FLAG(no_bind_mouse),
W_FLAG(no_hide_others),
W_FLAG(no_appicon),
W_FLAG(dont_move_off),
W_FLAG(ignore_stupid_hints),
W_FLAG(no_focusable),
W_FLAG(always_user_icon),
W_FLAG(start_miniaturized),

View File

@@ -170,14 +170,6 @@
#define HIDDENDOT
/*
* Ignores the PPosition hint from clients. This is needed for some
* programs that have buggy implementations of such hint and place
* themselves in strange locations.
*/
#undef IGNORE_PPOSITION
#define SILLYNESS

View File

@@ -74,7 +74,7 @@ static proplist_t AKeepOnTop;
static proplist_t AKeepOnBottom;
static proplist_t AOmnipresent;
static proplist_t ASkipWindowList;
static proplist_t AKeepInsideScreen;
static proplist_t AIgnoreGeometryHints;
static proplist_t AUnfocusable;
static proplist_t AAlwaysUserIcon;
static proplist_t AStartMiniaturized;
@@ -113,7 +113,7 @@ init_wdefaults(WScreen *scr)
AKeepOnBottom = PLMakeString("KeepOnBottom");
AOmnipresent = PLMakeString("Omnipresent");
ASkipWindowList = PLMakeString("SkipWindowList");
AKeepInsideScreen = PLMakeString("KeepInsideScreen");
AIgnoreGeometryHints = PLMakeString("IgnoreGeometryHints");
AUnfocusable = PLMakeString("Unfocusable");
AAlwaysUserIcon = PLMakeString("AlwaysUserIcon");
AStartMiniaturized = PLMakeString("StartMiniaturized");
@@ -285,8 +285,8 @@ wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
value = get_value(dw, dc, dn, da, ASkipWindowList, No, useGlobalDefault);
APPLY_VAL(value, skip_window_list, ASkipWindowList);
value = get_value(dw, dc, dn, da, AKeepInsideScreen, No, useGlobalDefault);
APPLY_VAL(value, dont_move_off, AKeepInsideScreen);
value = get_value(dw, dc, dn, da, AIgnoreGeometryHints, No, useGlobalDefault);
APPLY_VAL(value, ignore_stupid_hints, AIgnoreGeometryHints);
value = get_value(dw, dc, dn, da, AUnfocusable, No, useGlobalDefault);
APPLY_VAL(value, no_focusable, AUnfocusable);

View File

@@ -692,6 +692,17 @@ wManageWindow(WScreen *scr, Window window)
wWindowSetupInitialAttributes(wwin, &window_level, &workspace);
/* if the window has bad PPosition/PSize hints, and user asked to ignore
* them, revert the size values */
if ((wwin->normal_hints->flags & (PSize|PPosition))
&& WFLAGP(wwin, ignore_stupid_hints)) {
wwin->normal_hints->flags &= ~(PPosition|PSize);
x = wattribs.x;
y = wattribs.y;
width = wattribs.width;
height = wattribs.height;
}
#ifdef OLWM_HINTS
if (wwin->client_flags.olwm_transient && wwin->transient_for==None
&& wwin->group_id != None && wwin->group_id != window) {
@@ -873,7 +884,7 @@ wManageWindow(WScreen *scr, Window window)
dontBring = True;
}
if (WFLAGP(wwin, dont_move_off) && dontBring)
if (WFLAGP(wwin, ignore_stupid_hints) && dontBring)
wScreenBringInside(scr, &x, &y, width, height);
}
@@ -1911,7 +1922,7 @@ int req_width, req_height; /* new size of the client */
synth_notify = True;
}
if (WFLAGP(wwin, dont_move_off))
if (WFLAGP(wwin, ignore_stupid_hints))
wScreenBringInside(wwin->screen_ptr, &req_x, &req_y,
req_width, req_height);
if (resize) {
@@ -1987,7 +1998,7 @@ int req_x, req_y; /* new position of the frame */
* a completed (opaque) movement in moveres.c */
#endif
if (WFLAGP(wwin, dont_move_off))
if (WFLAGP(wwin, ignore_stupid_hints))
wScreenBringInside(wwin->screen_ptr, &req_x, &req_y,
wwin->frame->core->width, wwin->frame->core->height);

View File

@@ -118,7 +118,7 @@ typedef struct {
unsigned int no_hide_others:1; /* hide window when doing hideothers */
unsigned int no_appicon:1; /* make app icon */
unsigned int dont_move_off:1;
unsigned int ignore_stupid_hints:1;
unsigned int no_focusable:1;

View File

@@ -66,7 +66,7 @@ static proplist_t AKeepOnTop;
static proplist_t AKeepOnBottom;
static proplist_t AOmnipresent;
static proplist_t ASkipWindowList;
static proplist_t AKeepInsideScreen;
static proplist_t AIgnoreGeometryHints;
static proplist_t AUnfocusable;
static proplist_t AAlwaysUserIcon;
static proplist_t AStartMiniaturized;
@@ -116,7 +116,7 @@ make_keys()
AKeepOnBottom = PLMakeString("KeepOnBottom");
AOmnipresent = PLMakeString("Omnipresent");
ASkipWindowList = PLMakeString("SkipWindowList");
AKeepInsideScreen = PLMakeString("KeepInsideScreen");
AIgnoreGeometryHints = PLMakeString("IgnoreGeometryHints");
AUnfocusable = PLMakeString("Unfocusable");
AAlwaysUserIcon = PLMakeString("AlwaysUserIcon");
AStartMiniaturized = PLMakeString("StartMiniaturized");
@@ -532,7 +532,7 @@ saveSettings(WMButton *button, InspectorPanel *panel)
different |= insertAttribute(dict, winDic, ANoMouseBindings, value, flags);
value = (WMGetButtonSelected(panel->moreChk[3])!=0) ? Yes : No;
different |= insertAttribute(dict, winDic, AKeepInsideScreen,value, flags);
different |= insertAttribute(dict, winDic, AIgnoreGeometryHints,value, flags);
value = (WMGetButtonSelected(panel->moreChk[4])!=0) ? Yes : No;
different |= insertAttribute(dict, winDic, AUnfocusable, value, flags);
@@ -731,7 +731,7 @@ applySettings(WMButton *button, InspectorPanel *panel)
WSETUFLAG(wwin, no_hide_others, WMGetButtonSelected(panel->moreChk[0]));
WSETUFLAG(wwin, no_bind_keys, WMGetButtonSelected(panel->moreChk[1]));
WSETUFLAG(wwin, no_bind_mouse, WMGetButtonSelected(panel->moreChk[2]));
WSETUFLAG(wwin, dont_move_off, WMGetButtonSelected(panel->moreChk[3]));
WSETUFLAG(wwin, ignore_stupid_hints, WMGetButtonSelected(panel->moreChk[3]));
WSETUFLAG(wwin, no_focusable, WMGetButtonSelected(panel->moreChk[4]));
WSETUFLAG(wwin, dont_save_session, WMGetButtonSelected(panel->moreChk[5]));
WSETUFLAG(wwin, emulate_appicon, WMGetButtonSelected(panel->moreChk[6]));
@@ -897,7 +897,7 @@ revertSettings(WMButton *button, InspectorPanel *panel)
flag = WFLAGP(wwin, no_bind_mouse);
break;
case 3:
flag = WFLAGP(wwin, dont_move_off);
flag = WFLAGP(wwin, ignore_stupid_hints);
break;
case 4:
flag = WFLAGP(wwin, no_focusable);
@@ -1282,10 +1282,11 @@ createInspectorForWindow(WWindow *wwin)
"configured).");
break;
case 3:
caption = _("Keep Inside Screen");
flag = WFLAGP(wwin, dont_move_off);
caption = _("Ignore PPosition/PSize hints");
flag = WFLAGP(wwin, ignore_stupid_hints);
descr = _("Do not allow the window to move itself completely\n"
"outside the screen. For bug compatibility.\n");
"outside the screen, nor take imposible sizes like 1x1.\n"
"For bug compatibility.\n");
break;
case 4:
caption = _("Don't Let It Take Focus");