Allow setting border on windows with borderless hint.

SVN revision: 19931
This commit is contained in:
Kim Woelders 2006-01-20 22:04:49 +00:00
parent 5014886a1f
commit 0bfe63c730
4 changed files with 28 additions and 21 deletions

View File

@ -422,24 +422,24 @@ EwinBorderSelect(EWin * ewin)
{
const Border *b;
#if 0 /* Handled in iclass.c */
/* Imlib2 will not render pixmaps with dimensions > 8192 */
if (ewin->client.w > 8000 || ewin->client.h > 8000)
ewin->state.no_border = 1;
#endif
if (ewin->state.no_border)
if (ewin->inh_wm.b.border)
{
b = FindItem("BORDERLESS", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER);
goto done;
}
else
{
/* Quit if we already have a border that isn't an internal one */
b = ewin->border;
if (b && strncmp(b->name, "__", 2))
goto done;
b = WindowMatchEwinBorder(ewin);
}
/* Quit if we already have a border that isn't an internal one */
b = ewin->border;
if (b && strncmp(b->name, "__", 2))
goto done;
b = NULL;
if (ewin->props.no_border)
b = FindItem("BORDERLESS", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER);
if (!b)
b = WindowMatchEwinBorder(ewin);
if (!b)
b = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER);
@ -500,6 +500,8 @@ EwinBorderSetTo(EWin * ewin, const Border * b)
BorderIncRefcount(b);
HintsSetWindowBorder(ewin);
ewin->state.no_border = b->num_winparts <= 0;
EventCallbackRegister(EoGetWin(ewin), 0, BorderFrameHandleEvents, ewin);
if (b->num_winparts > 0)
@ -572,6 +574,7 @@ EwinBorderSetTo(EWin * ewin, const Border * b)
ewin->update.shape = 1;
EwinBorderCalcSizes(ewin, 0);
EwinStateUpdate(ewin);
SnapshotEwinUpdate(ewin, SNAP_USE_BORDER);
}
@ -579,7 +582,7 @@ EwinBorderSetTo(EWin * ewin, const Border * b)
void
EwinSetBorder(EWin * ewin, const Border * b, int apply)
{
if (!b || ewin->border == b || ewin->state.no_border)
if (!b || ewin->border == b || ewin->inh_wm.b.border)
return;
if (apply)

View File

@ -185,6 +185,9 @@ EwinManage(EWin * ewin)
if (ewin->client.h <= 0)
ewin->client.h = 100;
if (ewin->state.docked)
ewin->inh_wm.b.border = 1;
if (ewin->client.argb && Conf.argb_client_mode > 0)
{
if (!XGetWindowAttributes(disp, _EwinGetClientXwin(ewin), &win_attr))
@ -197,7 +200,7 @@ EwinManage(EWin * ewin)
ewin->client.w, ewin->client.h, 0, &win_attr);
if (Conf.argb_client_mode == 1)
ewin->props.no_border = 1;
ewin->inh_wm.b.border = 1;
}
else
{
@ -649,9 +652,6 @@ EwinStateUpdate(EWin * ewin)
ewin->state.inhibit_focus = !ewin->icccm.need_input ||
EwinInhGetWM(ewin, focus) || ewin->state.iconified;
ewin->state.no_border = ewin->props.no_border || ewin->state.docked ||
(ewin->mwm.valid && !ewin->mwm.decor_title && !ewin->mwm.decor_border);
ewin->state.inhibit_move =
EwinInhGetUser(ewin, move) || ewin->state.fullscreen;
ewin->state.inhibit_resize = ewin->state.iconified || ewin->state.shaded ||

View File

@ -48,7 +48,8 @@ typedef union
unsigned char all:8;
struct
{
unsigned char rsvd:3;
unsigned char rsvd:2;
unsigned char border:1; /* W */
unsigned char close:1; /* AU */
unsigned char focus:1; /* WA */
unsigned char iconify:1; /* W U */

View File

@ -172,6 +172,9 @@ MWM_GetHints(EWin * ewin, Atom atom_change)
ewin->mwm.func_close = 1;
}
if (!ewin->mwm.decor_title && !ewin->mwm.decor_border)
ewin->props.no_border = 1;
done:
if (mwmhints)
XFree(mwmhints);