Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
ewin-ops.c ewins.c ewins.h hints.c size.c
Log Message:
Fix resizing normal->maximized->fullscreen and back.
Fix preserving maximised state across restart.
===================================================================
RCS file: /cvs/e/e16/e/src/ewin-ops.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -3 -r1.115 -r1.116
--- ewin-ops.c 16 Mar 2007 03:56:11 -0000 1.115
+++ ewin-ops.c 17 Mar 2007 15:49:40 -0000 1.116
@@ -491,7 +491,7 @@
EwinBorderCalcSizes(ewin, 0);
/* Clear maximized state on resize */
- if (!ewin->state.maximizing && !ewin->state.shading)
+ if (resize && !ewin->state.maximizing && !ewin->state.shading)
{
if (ewin->state.maximized_horz || ewin->state.maximized_vert)
{
@@ -1381,11 +1381,11 @@
{
if (ewin->state.inhibit_fullscreeen)
return;
- ewin->lx = EoGetX(ewin);
- ewin->ly = EoGetY(ewin);
- ewin->lw = ewin->client.w;
- ewin->lh = ewin->client.h;
- ewin->ll = EoGetLayer(ewin);
+ ewin->save_fs.x = EoGetX(ewin);
+ ewin->save_fs.y = EoGetY(ewin);
+ ewin->save_fs.w = ewin->client.w;
+ ewin->save_fs.h = ewin->client.h;
+ ewin->save_fs.layer = EoGetLayer(ewin);
}
ScreenGetAvailableArea(EoGetX(ewin), EoGetY(ewin), &x, &y, &w, &h);
@@ -1415,25 +1415,27 @@
lst = EwinListTransients(ewin, &num, 0);
for (i = 0; i < num; i++)
{
- lst[i]->ll = EoGetLayer(lst[i]);
- EoSetLayer(lst[i], lst[i]->ll + EoGetLayer(ewin) - ewin->ll);
+ lst[i]->save_fs.layer = EoGetLayer(lst[i]);
+ EoSetLayer(lst[i], lst[i]->save_fs.layer +
+ EoGetLayer(ewin) - ewin->save_fs.layer);
}
if (lst)
Efree(lst);
}
EwinRaise(ewin);
+ ewin->state.maximizing = 1;
EwinMoveResize(ewin, x, y, w, h);
- ewin->state.maximized_horz = ewin->state.maximized_vert = 0;
+ ewin->state.maximizing = 0;
ewin->state.fullscreen = 1;
EwinStateUpdate(ewin);
}
else
{
- x = ewin->lx;
- y = ewin->ly;
- w = ewin->lw;
- h = ewin->lh;
+ x = ewin->save_fs.x;
+ y = ewin->save_fs.y;
+ w = ewin->save_fs.w;
+ h = ewin->save_fs.h;
GetOnScreenPos(x, y, w, h, &x, &y);
b = ewin->normal_border;
EwinBorderSetTo(ewin, b);
@@ -1442,16 +1444,18 @@
{
lst = EwinListTransients(ewin, &num, 0);
for (i = 0; i < num; i++)
- EoSetLayer(lst[i], lst[i]->ll);
+ EoSetLayer(lst[i], lst[i]->save_fs.layer);
if (lst)
Efree(lst);
}
- EoSetLayer(ewin, ewin->ll);
+ EoSetLayer(ewin, ewin->save_fs.layer);
ewin->state.fullscreen = 0;
EwinStateUpdate(ewin);
EwinRaise(ewin);
+ ewin->state.maximizing = 1;
EwinMoveResize(ewin, x, y, w, h);
+ ewin->state.maximizing = 0;
}
HintsSetWindowState(ewin);
===================================================================
RCS file: /cvs/e/e16/e/src/ewins.c,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -3 -r1.191 -r1.192
--- ewins.c 4 Mar 2007 23:25:11 -0000 1.191
+++ ewins.c 17 Mar 2007 15:49:41 -0000 1.192
@@ -111,11 +111,10 @@
ewin->update.shape = 1;
ewin->update.border = 1;
- ewin->lx = -1;
- ewin->ly = -1;
- ewin->lw = -1;
- ewin->lh = -1;
- ewin->ll = -1;
+ ewin->save_max.x = ewin->save_max.y = ewin->save_max.w = ewin->save_max.h =
+ -1;
+ ewin->save_fs.x = ewin->save_fs.y = ewin->save_fs.w = ewin->save_fs.h = -1;
+ ewin->save_fs.layer = -1;
ewin->icccm.need_input = 1;
@@ -161,10 +160,10 @@
EGetWindowAttributes(win, &xwa);
ewin->client.win = win;
- ewin->client.x = ewin->lx = xwa.x;
- ewin->client.y = ewin->ly = xwa.y;
- ewin->client.w = ewin->lw = xwa.width;
- ewin->client.h = ewin->lh = xwa.height;
+ ewin->client.x = ewin->save_max.x = ewin->save_fs.x = xwa.x;
+ ewin->client.y = ewin->save_max.y = ewin->save_fs.y = xwa.y;
+ ewin->client.w = ewin->save_max.w = ewin->save_fs.w = xwa.width;
+ ewin->client.h = ewin->save_max.h = ewin->save_fs.h = xwa.height;
ewin->client.bw = xwa.border_width;
ewin->client.cmap = xwa.colormap;
ewin->client.grav = NorthWestGravity;
@@ -308,8 +307,8 @@
SnapshotsEwinMatch(ewin); /* Find a saved settings match */
SnapshotEwinApply(ewin); /* Apply saved settings */
- if (ewin->ll < 0)
- ewin->ll = EoGetLayer(ewin);
+ if (ewin->save_fs.layer < 0)
+ ewin->save_fs.layer = EoGetLayer(ewin);
EwinStateUpdate(ewin); /* Update after snaps etc. */
===================================================================
RCS file: /cvs/e/e16/e/src/ewins.h,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -3 -r1.68 -r1.69
--- ewins.h 16 Mar 2007 03:56:11 -0000 1.68
+++ ewins.h 17 Mar 2007 15:49:41 -0000 1.69
@@ -257,9 +257,17 @@
int head; /* Unused? */
int vx, vy; /* Position in virtual root */
- int lx, ly; /* Last pos */
- int lw, lh; /* Last size */
- int ll; /* Last layer */
+ struct
+ { /* Saved state before maximization */
+ int x, y; /* Position */
+ int w, h; /* Size */
+ } save_max;
+ struct
+ { /* Saved state before fullscreen */
+ int x, y; /* Position */
+ int w, h; /* Size */
+ int layer; /* Layer */
+ } save_fs;
void *data; /* Data hook for internal windows */
const EWinOps *ops;
===================================================================
RCS file: /cvs/e/e16/e/src/hints.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- hints.c 17 Jan 2007 01:10:43 -0000 1.77
+++ hints.c 17 Mar 2007 15:49:41 -0000 1.78
@@ -324,8 +324,8 @@
int all:32;
} EWinInfoFlags;
-#define ENL_DATA_ITEMS 8
-#define ENL_DATA_VERSION 0
+#define ENL_DATA_ITEMS 12
+#define ENL_DATA_VERSION 1
void
EHintsSetInfo(const EWin * ewin)
@@ -346,11 +346,15 @@
c[2] = 0;
- c[3] = ewin->lx;
- c[4] = ewin->ly;
- c[5] = ewin->lw;
- c[6] = ewin->lh;
- c[7] = ewin->ll;
+ c[3] = ewin->save_max.x;
+ c[4] = ewin->save_max.y;
+ c[5] = ewin->save_max.w;
+ c[6] = ewin->save_max.h;
+ c[7] = ewin->save_fs.x;
+ c[8] = ewin->save_fs.y;
+ c[9] = ewin->save_fs.w;
+ c[10] = ewin->save_fs.h;
+ c[11] = ewin->save_fs.layer;
ecore_x_window_prop_card32_set(EwinGetClientXwin(ewin), ENL_WIN_DATA,
(unsigned int *)c, ENL_DATA_ITEMS);
@@ -392,11 +396,15 @@
EwinFlagsDecode(ewin, c[1]);
- ewin->lx = c[3];
- ewin->ly = c[4];
- ewin->lw = c[5];
- ewin->lh = c[6];
- ewin->ll = c[7];
+ ewin->save_max.x = c[3];
+ ewin->save_max.y = c[4];
+ ewin->save_max.w = c[5];
+ ewin->save_max.h = c[6];
+ ewin->save_fs.x = c[7];
+ ewin->save_fs.y = c[8];
+ ewin->save_fs.w = c[9];
+ ewin->save_fs.h = c[10];
+ ewin->save_fs.layer = c[11];
str =
ecore_x_window_prop_string_get(EwinGetClientXwin(ewin), ENL_WIN_BORDER);
===================================================================
RCS file: /cvs/e/e16/e/src/size.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -3 -r1.54 -r1.55
--- size.c 16 Mar 2007 03:48:48 -0000 1.54
+++ size.c 17 Mar 2007 15:49:41 -0000 1.55
@@ -51,11 +51,12 @@
if (ewin->state.maximized_horz || ewin->state.maximized_vert)
{
- EwinMoveResize(ewin, ewin->lx, ewin->ly, ewin->lw, ewin->lh);
- ewin->lx = EoGetX(ewin);
- ewin->ly = EoGetY(ewin);
- ewin->lw = ewin->client.w;
- ewin->lh = ewin->client.h;
+ EwinMoveResize(ewin, ewin->save_max.x, ewin->save_max.y,
+ ewin->save_max.w, ewin->save_max.h);
+ ewin->save_max.x = EoGetX(ewin);
+ ewin->save_max.y = EoGetY(ewin);
+ ewin->save_max.w = ewin->client.w;
+ ewin->save_max.h = ewin->client.h;
ewin->state.maximized_horz = 0;
ewin->state.maximized_vert = 0;
goto done;
@@ -178,10 +179,10 @@
if (h < 10)
h = 10;
- ewin->lx = EoGetX(ewin);
- ewin->ly = EoGetY(ewin);
- ewin->lw = ewin->client.w;
- ewin->lh = ewin->client.h;
+ ewin->save_max.x = EoGetX(ewin);
+ ewin->save_max.y = EoGetY(ewin);
+ ewin->save_max.w = ewin->client.w;
+ ewin->save_max.h = ewin->client.h;
ewin->state.maximizing = 1;
EwinMoveResize(ewin, x, y, w, h);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs