From c917f68883b0cf378bdada1c5e83821658b00fed Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 17 Sep 1999 22:11:43 +0000 Subject: [PATCH] Changed "Keep Inside Screen" user option with "Ignore PPosition/PSize hints" --- src/client.c | 3 --- src/session.c | 2 +- src/wconfig.h.in | 8 -------- src/wdefaults.c | 8 ++++---- src/window.c | 17 ++++++++++++++--- src/window.h | 2 +- src/winspector.c | 17 +++++++++-------- 7 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/client.c b/src/client.c index 5246180b..d95a4355 100644 --- a/src/client.c +++ b/src/client.c @@ -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; diff --git a/src/session.c b/src/session.c index d9903123..ba882065 100644 --- a/src/session.c +++ b/src/session.c @@ -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), diff --git a/src/wconfig.h.in b/src/wconfig.h.in index 12586f00..b452c6fa 100644 --- a/src/wconfig.h.in +++ b/src/wconfig.h.in @@ -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 diff --git a/src/wdefaults.c b/src/wdefaults.c index 5f193b8b..cc68494c 100644 --- a/src/wdefaults.c +++ b/src/wdefaults.c @@ -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); diff --git a/src/window.c b/src/window.c index d0b08539..c1a3184c 100644 --- a/src/window.c +++ b/src/window.c @@ -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); diff --git a/src/window.h b/src/window.h index d8937071..1919f395 100644 --- a/src/window.h +++ b/src/window.h @@ -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; diff --git a/src/winspector.c b/src/winspector.c index 5109e629..8a966411 100644 --- a/src/winspector.c +++ b/src/winspector.c @@ -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"); -- 2.11.4.GIT