mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-20 04:48:06 +01:00
Changed "Keep Inside Screen" user option with "Ignore PPosition/PSize hints"
This commit is contained in:
@@ -715,9 +715,6 @@ wClientGetNormalHints(WWindow *wwin, XWindowAttributes *wattribs, Bool geometry,
|
|||||||
wwin->normal_hints->min_width = wwin->normal_hints->max_width;
|
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 (/* check this !pre_icccm && */!wwin->screen_ptr->flags.startup && geometry) {
|
||||||
if (wwin->normal_hints->flags & (USPosition|PPosition)) {
|
if (wwin->normal_hints->flags & (USPosition|PPosition)) {
|
||||||
*x = wwin->normal_hints->x;
|
*x = wwin->normal_hints->x;
|
||||||
|
|||||||
@@ -844,7 +844,7 @@ makeAttributeState(WWindow *wwin)
|
|||||||
W_FLAG(no_bind_mouse),
|
W_FLAG(no_bind_mouse),
|
||||||
W_FLAG(no_hide_others),
|
W_FLAG(no_hide_others),
|
||||||
W_FLAG(no_appicon),
|
W_FLAG(no_appicon),
|
||||||
W_FLAG(dont_move_off),
|
W_FLAG(ignore_stupid_hints),
|
||||||
W_FLAG(no_focusable),
|
W_FLAG(no_focusable),
|
||||||
W_FLAG(always_user_icon),
|
W_FLAG(always_user_icon),
|
||||||
W_FLAG(start_miniaturized),
|
W_FLAG(start_miniaturized),
|
||||||
|
|||||||
@@ -170,14 +170,6 @@
|
|||||||
#define HIDDENDOT
|
#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
|
#define SILLYNESS
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ static proplist_t AKeepOnTop;
|
|||||||
static proplist_t AKeepOnBottom;
|
static proplist_t AKeepOnBottom;
|
||||||
static proplist_t AOmnipresent;
|
static proplist_t AOmnipresent;
|
||||||
static proplist_t ASkipWindowList;
|
static proplist_t ASkipWindowList;
|
||||||
static proplist_t AKeepInsideScreen;
|
static proplist_t AIgnoreGeometryHints;
|
||||||
static proplist_t AUnfocusable;
|
static proplist_t AUnfocusable;
|
||||||
static proplist_t AAlwaysUserIcon;
|
static proplist_t AAlwaysUserIcon;
|
||||||
static proplist_t AStartMiniaturized;
|
static proplist_t AStartMiniaturized;
|
||||||
@@ -113,7 +113,7 @@ init_wdefaults(WScreen *scr)
|
|||||||
AKeepOnBottom = PLMakeString("KeepOnBottom");
|
AKeepOnBottom = PLMakeString("KeepOnBottom");
|
||||||
AOmnipresent = PLMakeString("Omnipresent");
|
AOmnipresent = PLMakeString("Omnipresent");
|
||||||
ASkipWindowList = PLMakeString("SkipWindowList");
|
ASkipWindowList = PLMakeString("SkipWindowList");
|
||||||
AKeepInsideScreen = PLMakeString("KeepInsideScreen");
|
AIgnoreGeometryHints = PLMakeString("IgnoreGeometryHints");
|
||||||
AUnfocusable = PLMakeString("Unfocusable");
|
AUnfocusable = PLMakeString("Unfocusable");
|
||||||
AAlwaysUserIcon = PLMakeString("AlwaysUserIcon");
|
AAlwaysUserIcon = PLMakeString("AlwaysUserIcon");
|
||||||
AStartMiniaturized = PLMakeString("StartMiniaturized");
|
AStartMiniaturized = PLMakeString("StartMiniaturized");
|
||||||
@@ -285,8 +285,8 @@ wDefaultFillAttributes(WScreen *scr, char *instance, char *class,
|
|||||||
value = get_value(dw, dc, dn, da, ASkipWindowList, No, useGlobalDefault);
|
value = get_value(dw, dc, dn, da, ASkipWindowList, No, useGlobalDefault);
|
||||||
APPLY_VAL(value, skip_window_list, ASkipWindowList);
|
APPLY_VAL(value, skip_window_list, ASkipWindowList);
|
||||||
|
|
||||||
value = get_value(dw, dc, dn, da, AKeepInsideScreen, No, useGlobalDefault);
|
value = get_value(dw, dc, dn, da, AIgnoreGeometryHints, No, useGlobalDefault);
|
||||||
APPLY_VAL(value, dont_move_off, AKeepInsideScreen);
|
APPLY_VAL(value, ignore_stupid_hints, AIgnoreGeometryHints);
|
||||||
|
|
||||||
value = get_value(dw, dc, dn, da, AUnfocusable, No, useGlobalDefault);
|
value = get_value(dw, dc, dn, da, AUnfocusable, No, useGlobalDefault);
|
||||||
APPLY_VAL(value, no_focusable, AUnfocusable);
|
APPLY_VAL(value, no_focusable, AUnfocusable);
|
||||||
|
|||||||
17
src/window.c
17
src/window.c
@@ -692,6 +692,17 @@ wManageWindow(WScreen *scr, Window window)
|
|||||||
|
|
||||||
wWindowSetupInitialAttributes(wwin, &window_level, &workspace);
|
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
|
#ifdef OLWM_HINTS
|
||||||
if (wwin->client_flags.olwm_transient && wwin->transient_for==None
|
if (wwin->client_flags.olwm_transient && wwin->transient_for==None
|
||||||
&& wwin->group_id != None && wwin->group_id != window) {
|
&& wwin->group_id != None && wwin->group_id != window) {
|
||||||
@@ -873,7 +884,7 @@ wManageWindow(WScreen *scr, Window window)
|
|||||||
dontBring = True;
|
dontBring = True;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WFLAGP(wwin, dont_move_off) && dontBring)
|
if (WFLAGP(wwin, ignore_stupid_hints) && dontBring)
|
||||||
wScreenBringInside(scr, &x, &y, width, height);
|
wScreenBringInside(scr, &x, &y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1911,7 +1922,7 @@ int req_width, req_height; /* new size of the client */
|
|||||||
synth_notify = True;
|
synth_notify = True;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WFLAGP(wwin, dont_move_off))
|
if (WFLAGP(wwin, ignore_stupid_hints))
|
||||||
wScreenBringInside(wwin->screen_ptr, &req_x, &req_y,
|
wScreenBringInside(wwin->screen_ptr, &req_x, &req_y,
|
||||||
req_width, req_height);
|
req_width, req_height);
|
||||||
if (resize) {
|
if (resize) {
|
||||||
@@ -1987,7 +1998,7 @@ int req_x, req_y; /* new position of the frame */
|
|||||||
* a completed (opaque) movement in moveres.c */
|
* a completed (opaque) movement in moveres.c */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (WFLAGP(wwin, dont_move_off))
|
if (WFLAGP(wwin, ignore_stupid_hints))
|
||||||
wScreenBringInside(wwin->screen_ptr, &req_x, &req_y,
|
wScreenBringInside(wwin->screen_ptr, &req_x, &req_y,
|
||||||
wwin->frame->core->width, wwin->frame->core->height);
|
wwin->frame->core->width, wwin->frame->core->height);
|
||||||
|
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ typedef struct {
|
|||||||
unsigned int no_hide_others:1; /* hide window when doing hideothers */
|
unsigned int no_hide_others:1; /* hide window when doing hideothers */
|
||||||
unsigned int no_appicon:1; /* make app icon */
|
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;
|
unsigned int no_focusable:1;
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ static proplist_t AKeepOnTop;
|
|||||||
static proplist_t AKeepOnBottom;
|
static proplist_t AKeepOnBottom;
|
||||||
static proplist_t AOmnipresent;
|
static proplist_t AOmnipresent;
|
||||||
static proplist_t ASkipWindowList;
|
static proplist_t ASkipWindowList;
|
||||||
static proplist_t AKeepInsideScreen;
|
static proplist_t AIgnoreGeometryHints;
|
||||||
static proplist_t AUnfocusable;
|
static proplist_t AUnfocusable;
|
||||||
static proplist_t AAlwaysUserIcon;
|
static proplist_t AAlwaysUserIcon;
|
||||||
static proplist_t AStartMiniaturized;
|
static proplist_t AStartMiniaturized;
|
||||||
@@ -116,7 +116,7 @@ make_keys()
|
|||||||
AKeepOnBottom = PLMakeString("KeepOnBottom");
|
AKeepOnBottom = PLMakeString("KeepOnBottom");
|
||||||
AOmnipresent = PLMakeString("Omnipresent");
|
AOmnipresent = PLMakeString("Omnipresent");
|
||||||
ASkipWindowList = PLMakeString("SkipWindowList");
|
ASkipWindowList = PLMakeString("SkipWindowList");
|
||||||
AKeepInsideScreen = PLMakeString("KeepInsideScreen");
|
AIgnoreGeometryHints = PLMakeString("IgnoreGeometryHints");
|
||||||
AUnfocusable = PLMakeString("Unfocusable");
|
AUnfocusable = PLMakeString("Unfocusable");
|
||||||
AAlwaysUserIcon = PLMakeString("AlwaysUserIcon");
|
AAlwaysUserIcon = PLMakeString("AlwaysUserIcon");
|
||||||
AStartMiniaturized = PLMakeString("StartMiniaturized");
|
AStartMiniaturized = PLMakeString("StartMiniaturized");
|
||||||
@@ -532,7 +532,7 @@ saveSettings(WMButton *button, InspectorPanel *panel)
|
|||||||
different |= insertAttribute(dict, winDic, ANoMouseBindings, value, flags);
|
different |= insertAttribute(dict, winDic, ANoMouseBindings, value, flags);
|
||||||
|
|
||||||
value = (WMGetButtonSelected(panel->moreChk[3])!=0) ? Yes : No;
|
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;
|
value = (WMGetButtonSelected(panel->moreChk[4])!=0) ? Yes : No;
|
||||||
different |= insertAttribute(dict, winDic, AUnfocusable, value, flags);
|
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_hide_others, WMGetButtonSelected(panel->moreChk[0]));
|
||||||
WSETUFLAG(wwin, no_bind_keys, WMGetButtonSelected(panel->moreChk[1]));
|
WSETUFLAG(wwin, no_bind_keys, WMGetButtonSelected(panel->moreChk[1]));
|
||||||
WSETUFLAG(wwin, no_bind_mouse, WMGetButtonSelected(panel->moreChk[2]));
|
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, no_focusable, WMGetButtonSelected(panel->moreChk[4]));
|
||||||
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]));
|
||||||
@@ -897,7 +897,7 @@ revertSettings(WMButton *button, InspectorPanel *panel)
|
|||||||
flag = WFLAGP(wwin, no_bind_mouse);
|
flag = WFLAGP(wwin, no_bind_mouse);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
flag = WFLAGP(wwin, dont_move_off);
|
flag = WFLAGP(wwin, ignore_stupid_hints);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
flag = WFLAGP(wwin, no_focusable);
|
flag = WFLAGP(wwin, no_focusable);
|
||||||
@@ -1282,10 +1282,11 @@ createInspectorForWindow(WWindow *wwin)
|
|||||||
"configured).");
|
"configured).");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
caption = _("Keep Inside Screen");
|
caption = _("Ignore PPosition/PSize hints");
|
||||||
flag = WFLAGP(wwin, dont_move_off);
|
flag = WFLAGP(wwin, ignore_stupid_hints);
|
||||||
descr = _("Do not allow the window to move itself completely\n"
|
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;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
caption = _("Don't Let It Take Focus");
|
caption = _("Don't Let It Take Focus");
|
||||||
|
|||||||
Reference in New Issue
Block a user