Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h borders.c ewin-ops.c ewins.c icccm.c iclass.c x.c
Log Message:
Deuglify fullscreen windows not filling available space.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.352
retrieving revision 1.353
diff -u -3 -r1.352 -r1.353
--- E.h 29 Jan 2005 15:00:00 -0000 1.352
+++ E.h 30 Jan 2005 11:02:38 -0000 1.353
@@ -606,6 +606,7 @@
WinPart *part;
char changes_shape;
char shadedir;
+ char throwaway;
unsigned int ref_count;
ActionClass *aclass;
}
@@ -1262,6 +1263,8 @@
void BorderWinpartChange(EWin * ewin, int i, int force);
int BorderWinpartIndex(EWin * ewin, Window win);
void HonorIclass(char *s, int id);
+Border *BorderCreateFiller(int left, int right, int top,
+ int bottom);
void BordersSetupFallback(void);
/* buttons.c */
@@ -1859,6 +1862,8 @@
void ICCCM_Save(const EWin * ewin);
void ICCCM_Iconify(const EWin * ewin);
void ICCCM_DeIconify(const EWin * ewin);
+void ICCCM_SizeMatch(const EWin * ewin, int wi, int hi, int
*pwo,
+ int *pho);
void ICCCM_MatchSize(EWin * ewin);
void ICCCM_Configure(const EWin * ewin);
void ICCCM_AdoptStart(const EWin * ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.246
retrieving revision 1.247
diff -u -3 -r1.246 -r1.247
--- borders.c 29 Jan 2005 15:00:00 -0000 1.246
+++ borders.c 30 Jan 2005 11:02:39 -0000 1.247
@@ -488,10 +488,10 @@
{
const Border *b;
- /* Quit if we allready have a border that isn't the fallback one */
+ /* Quit if we allready have a border that isn't an internal one */
b = ewin->border;
- if (b && strcmp(b->name, "__FALLBACK_BORDER"))
- return;
+ if (b && strncmp(b->name, "__", 2))
+ goto done;
ICCCM_GetShapeInfo(ewin);
@@ -511,6 +511,7 @@
if (!b)
b = FindItem("__FALLBACK_BORDER", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER);
+ done:
ewin->normal_border = ewin->border = b;
}
@@ -537,6 +538,9 @@
BorderDecRefcount(b);
ewin->border = NULL;
+
+ if (b->throwaway)
+ BorderDestroy((Border *) b);
}
void
@@ -661,18 +665,15 @@
void
EwinSetBorder(EWin * ewin, const Border * b, int apply)
{
- if (!b)
+ if (!b || ewin->border == b)
return;
if (apply)
{
- if (ewin->border != b)
- {
- EwinBorderSetTo(ewin, b);
- ICCCM_MatchSize(ewin);
- MoveResizeEwin(ewin, EoGetX(ewin), EoGetY(ewin),
- ewin->client.w, ewin->client.h);
- }
+ EwinBorderSetTo(ewin, b);
+ ICCCM_MatchSize(ewin);
+ MoveResizeEwin(ewin, EoGetX(ewin), EoGetY(ewin),
+ ewin->client.w, ewin->client.h);
}
else
{
@@ -1346,6 +1347,44 @@
return err;
}
+Border *
+BorderCreateFiller(int left, int right, int top, int bottom)
+{
+ Border *b;
+ ImageClass *ic;
+
+ ic = FindItem("__BLACK", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
+
+ b = BorderCreate("__FILLER");
+ b->throwaway = 1;
+
+ b->border.left = left;
+ b->border.right = right;
+ b->border.top = top;
+ b->border.bottom = bottom;
+
+ if (top)
+ BorderWinpartAdd(b, ic, NULL, NULL, NULL, 1, FLAG_BUTTON, 0,
+ 1, 99999, 1, 99999,
+ -1, 0, 0, 0, 0, -1, 1024, -1, 0, top - 1, 1);
+ if (bottom)
+ BorderWinpartAdd(b, ic, NULL, NULL, NULL, 1, FLAG_BUTTON, 0,
+ 1, 99999, 1, 99999,
+ -1, 0, 0, 1024, -bottom, -1, 1024, -1, 1024, -1, 1);
+ if (left)
+ BorderWinpartAdd(b, ic, NULL, NULL, NULL, 1, FLAG_BUTTON, 0,
+ 1, 99999, 1, 99999,
+ -1, 0, 0, 0, top,
+ -1, 0, left - 1, 1024, -(bottom + 1), 1);
+ if (right)
+ BorderWinpartAdd(b, ic, NULL, NULL, NULL, 1, FLAG_BUTTON, 0,
+ 1, 99999, 1, 99999,
+ -1, 1024, -right, 0, top,
+ -1, 1024, -1, 1024, -(bottom + 1), 1);
+
+ return b;
+}
+
void
BordersSetupFallback(void)
{
@@ -1376,7 +1415,6 @@
99999, -1, 0, 0, 1024, -8, -1, 1024, -1, 1024, -1, 1);
BorderWinpartAdd(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8,
99999, -1, 0, 0, 0, 8, -1, 0, 7, 1024, -9, 1);
-
BorderWinpartAdd(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8,
99999, -1, 1024, -8, 0, 8, -1, 1024, -1, 1024, -9, 1);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewin-ops.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ewin-ops.c 25 Jan 2005 21:57:12 -0000 1.8
+++ ewin-ops.c 30 Jan 2005 11:02:42 -0000 1.9
@@ -1112,7 +1112,7 @@
void
EwinSetFullscreen(EWin * ewin, int on)
{
- int x, y, w, h;
+ int x, y, w, h, ww, hh;
EWin **lst;
int i, num;
const Border *b;
@@ -1129,6 +1129,25 @@
ewin->ll = EoGetLayer(ewin);
ScreenGetAvailableArea(EoGetX(ewin), EoGetY(ewin), &x, &y, &w, &h);
+ /* Fixup if available space doesn't match ICCCM size constraints */
+ ICCCM_SizeMatch(ewin, w, h, &ww, &hh);
+ if (w == ww && h == hh)
+ {
+ b = FindItem("BORDERLESS", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER);
+ }
+ else
+ {
+ int l, t;
+
+ l = (w - ww) / 2;
+ l = (l < 0) ? 0 : l;
+ t = (h - hh) / 2;
+ t = (t < 0) ? 0 : t;
+ b = BorderCreateFiller(l, w - ww - l, t, h - hh - t);
+ w = ww;
+ h = hh;
+ }
+
if (Conf.place.raise_fullscreen)
{
EoSetLayer(ewin, 8);
@@ -1143,8 +1162,6 @@
}
ewin->fixedpos = 1;
- b = (Border *) FindItem("BORDERLESS", 0, LIST_FINDBY_NAME,
- LIST_TYPE_BORDER);
}
else
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- ewins.c 29 Jan 2005 15:00:00 -0000 1.12
+++ ewins.c 30 Jan 2005 11:02:42 -0000 1.13
@@ -1802,6 +1802,10 @@
}
}
+/*
+ * Event handlers
+ */
+
static int
ActionsCheck(const char *which, EWin * ewin, XEvent * ev)
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -3 -r1.83 -r1.84
--- icccm.c 29 Jan 2005 07:11:57 -0000 1.83
+++ icccm.c 30 Jan 2005 11:02:42 -0000 1.84
@@ -227,14 +227,14 @@
}
void
-ICCCM_MatchSize(EWin * ewin)
+ICCCM_SizeMatch(const EWin * ewin, int wi, int hi, int *pwo, int *pho)
{
int w, h;
int i, j;
double aspect;
- w = ewin->client.w;
- h = ewin->client.h;
+ w = wi;
+ h = hi;
if (w < ewin->client.width.min)
w = ewin->client.width.min;
@@ -280,8 +280,16 @@
w += ewin->client.base_w;
h += ewin->client.base_h;
}
- ewin->client.w = w;
- ewin->client.h = h;
+
+ *pwo = w;
+ *pho = h;
+}
+
+void
+ICCCM_MatchSize(EWin * ewin)
+{
+ ICCCM_SizeMatch(ewin, ewin->client.w, ewin->client.h, &ewin->client.w,
+ &ewin->client.h);
}
void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iclass.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- iclass.c 29 Jan 2005 07:41:49 -0000 1.49
+++ iclass.c 30 Jan 2005 11:02:42 -0000 1.50
@@ -201,7 +201,7 @@
{
ImageClass *ic;
- ic = Emalloc(sizeof(ImageClass));
+ ic = Ecalloc(1, sizeof(ImageClass));
if (!ic)
return NULL;
@@ -1299,6 +1299,19 @@
ImageclassPopulate(ic);
AddItem(ic, ic->name, 0, LIST_TYPE_ICLASS);
+
+ /* Create all black image class for filler borders */
+ ic = ImageclassCreate("__BLACK");
+
+ ic->norm.normal = ImagestateCreate();
+ ESetColor(&(ic->norm.normal->hihi), 0, 0, 0);
+ ESetColor(&(ic->norm.normal->hi), 0, 0, 0);
+ ESetColor(&(ic->norm.normal->bg), 0, 0, 0);
+ ESetColor(&(ic->norm.normal->lo), 0, 0, 0);
+ ESetColor(&(ic->norm.normal->lolo), 0, 0, 0);
+
+ ImageclassPopulate(ic);
+ AddItem(ic, ic->name, 0, LIST_TYPE_ICLASS);
}
/*
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/x.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -3 -r1.75 -r1.76
--- x.c 25 Jan 2005 21:58:28 -0000 1.75
+++ x.c 30 Jan 2005 11:02:43 -0000 1.76
@@ -62,6 +62,7 @@
EXID *xid;
xid = Ecalloc(1, sizeof(EXID));
+ xid->bgcol = -1;
return xid;
}
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs