mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
- Fixed the PPosition/PSize code (I hope) --Dan
- removed "Ignore PPosition/PSize hints" user options, and reverted to the old "Keep Inside Screen"
This commit is contained in:
@@ -304,6 +304,10 @@ makeFilePanel(WMScreen *scrPtr, char *name, char *title)
|
|||||||
|
|
||||||
WMLoadBrowserColumnZero(fPtr->browser);
|
WMLoadBrowserColumnZero(fPtr->browser);
|
||||||
|
|
||||||
|
WMSetWindowInitialPosition(fPtr->win,
|
||||||
|
(scrPtr->rootView->size.width - WMWidgetWidth(fPtr->win))/2,
|
||||||
|
(scrPtr->rootView->size.height - WMWidgetHeight(fPtr->win))/2);
|
||||||
|
|
||||||
fPtr->flags.canChooseFiles = 1;
|
fPtr->flags.canChooseFiles = 1;
|
||||||
fPtr->flags.canChooseDirectories = 1;
|
fPtr->flags.canChooseDirectories = 1;
|
||||||
fPtr->flags.autoCompletion = 1;
|
fPtr->flags.autoCompletion = 1;
|
||||||
@@ -398,9 +402,6 @@ WMRunModalFilePanelForDirectory(WMFilePanel *panel, WMWindow *owner,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
WMSetWindowInitialPosition(panel->win,
|
|
||||||
(scr->rootView->size.width - WMWidgetWidth(panel->win))/2,
|
|
||||||
(scr->rootView->size.height - WMWidgetHeight(panel->win))/2);
|
|
||||||
WMSetLabelText(panel->titleLabel, name);
|
WMSetLabelText(panel->titleLabel, name);
|
||||||
|
|
||||||
scr->modalView = W_VIEW(panel->win);
|
scr->modalView = W_VIEW(panel->win);
|
||||||
|
|||||||
@@ -98,6 +98,7 @@ WMCreateAlertPanel(WMScreen *scrPtr, WMWindow *owner,
|
|||||||
WMSetWindowInitialPosition(panel->win,
|
WMSetWindowInitialPosition(panel->win,
|
||||||
(scrPtr->rootView->size.width - WMWidgetWidth(panel->win))/2,
|
(scrPtr->rootView->size.width - WMWidgetWidth(panel->win))/2,
|
||||||
(scrPtr->rootView->size.height - WMWidgetHeight(panel->win))/2);
|
(scrPtr->rootView->size.height - WMWidgetHeight(panel->win))/2);
|
||||||
|
|
||||||
WMSetWindowTitle(panel->win, "");
|
WMSetWindowTitle(panel->win, "");
|
||||||
|
|
||||||
if (scrPtr->applicationIcon) {
|
if (scrPtr->applicationIcon) {
|
||||||
|
|||||||
@@ -453,7 +453,8 @@ WMSetWindowInitialPosition(WMWindow *win, int x, int y)
|
|||||||
win->upos.x = x;
|
win->upos.x = x;
|
||||||
win->upos.y = y;
|
win->upos.y = y;
|
||||||
if (win->view->flags.realized)
|
if (win->view->flags.realized)
|
||||||
setSizeHints(win);
|
setSizeHints(win);
|
||||||
|
WMMoveWidget(win, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -464,7 +465,8 @@ WMSetWindowInitialSize(WMWindow *win, unsigned width, unsigned height)
|
|||||||
win->usize.width = width;
|
win->usize.width = width;
|
||||||
win->usize.height = height;
|
win->usize.height = height;
|
||||||
if (win->view->flags.realized)
|
if (win->view->flags.realized)
|
||||||
setSizeHints(win);
|
setSizeHints(win);
|
||||||
|
WMResizeWidget(win, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -715,6 +715,14 @@ 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 0
|
||||||
|
/* this seems obsoleted. Now geometry is taken from XGetWindowAttributes()
|
||||||
|
* in XGetNormalHints() we only have the hints themselves.
|
||||||
|
* check this. --Dan
|
||||||
|
*/
|
||||||
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;
|
||||||
@@ -725,6 +733,7 @@ wClientGetNormalHints(WWindow *wwin, XWindowAttributes *wattribs, Bool geometry,
|
|||||||
*height = wwin->normal_hints->height;
|
*height = wwin->normal_hints->height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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(ignore_stupid_hints),
|
W_FLAG(dont_move_off),
|
||||||
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,6 +170,14 @@
|
|||||||
#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 AIgnoreGeometryHints;
|
static proplist_t AKeepInsideScreen;
|
||||||
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");
|
||||||
AIgnoreGeometryHints = PLMakeString("IgnoreGeometryHints");
|
AKeepInsideScreen = PLMakeString("KeepInsideScreen");
|
||||||
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, AIgnoreGeometryHints, No, useGlobalDefault);
|
value = get_value(dw, dc, dn, da, AKeepInsideScreen, No, useGlobalDefault);
|
||||||
APPLY_VAL(value, ignore_stupid_hints, AIgnoreGeometryHints);
|
APPLY_VAL(value, dont_move_off, AKeepInsideScreen);
|
||||||
|
|
||||||
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,17 +692,6 @@ 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) {
|
||||||
@@ -884,7 +873,7 @@ wManageWindow(WScreen *scr, Window window)
|
|||||||
dontBring = True;
|
dontBring = True;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WFLAGP(wwin, ignore_stupid_hints) && dontBring)
|
if (WFLAGP(wwin, dont_move_off) && dontBring)
|
||||||
wScreenBringInside(scr, &x, &y, width, height);
|
wScreenBringInside(scr, &x, &y, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1922,7 +1911,7 @@ int req_width, req_height; /* new size of the client */
|
|||||||
synth_notify = True;
|
synth_notify = True;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WFLAGP(wwin, ignore_stupid_hints))
|
if (WFLAGP(wwin, dont_move_off))
|
||||||
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) {
|
||||||
@@ -1998,7 +1987,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, ignore_stupid_hints))
|
if (WFLAGP(wwin, dont_move_off))
|
||||||
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 ignore_stupid_hints:1;
|
unsigned int dont_move_off: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 AIgnoreGeometryHints;
|
static proplist_t AKeepInsideScreen;
|
||||||
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");
|
||||||
AIgnoreGeometryHints = PLMakeString("IgnoreGeometryHints");
|
AKeepInsideScreen = PLMakeString("KeepInsideScreen");
|
||||||
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, AIgnoreGeometryHints,value, flags);
|
different |= insertAttribute(dict, winDic, AKeepInsideScreen,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, ignore_stupid_hints, WMGetButtonSelected(panel->moreChk[3]));
|
WSETUFLAG(wwin, dont_move_off, 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, ignore_stupid_hints);
|
flag = WFLAGP(wwin, dont_move_off);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
flag = WFLAGP(wwin, no_focusable);
|
flag = WFLAGP(wwin, no_focusable);
|
||||||
@@ -1282,11 +1282,10 @@ createInspectorForWindow(WWindow *wwin)
|
|||||||
"configured).");
|
"configured).");
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
caption = _("Ignore PPosition/PSize hints");
|
caption = _("Keep Inside Screen");
|
||||||
flag = WFLAGP(wwin, ignore_stupid_hints);
|
flag = WFLAGP(wwin, dont_move_off);
|
||||||
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, nor take imposible sizes like 1x1.\n"
|
"outside the screen. For bug compatibility.\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