Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h borders.c ewmh.c iconify.c
Log Message:
Initial showing desktop support.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.327
retrieving revision 1.328
diff -u -3 -r1.327 -r1.328
--- E.h 11 Sep 2004 10:45:21 -0000 1.327
+++ E.h 19 Sep 2004 09:27:38 -0000 1.328
@@ -838,12 +838,6 @@
char floating;
char shapedone;
char fixedpos;
-#if 0 /* ENABLE_GNOME - Not actually used */
- int expanded_x;
- int expanded_y;
- int expanded_width;
- int expanded_height;
-#endif
char ignorearrange;
char skiptask;
char skip_ext_pager;
@@ -873,6 +867,7 @@
} strut;
struct
{
+ unsigned donthide:1; /* Don't hide on show desktop */
unsigned vroot:1; /* Virtual root window */
unsigned int opacity;
} props;
@@ -881,6 +876,7 @@
unsigned maximized_horz:1;
unsigned maximized_vert:1;
unsigned fullscreen:1;
+ unsigned showingdesk:1; /* Iconified by show desktop */
} st;
struct
{
@@ -1718,6 +1714,8 @@
int EwinIsOnScreen(EWin * ewin);
int BorderWinpartIndex(EWin * ewin, Window win);
+void EwinRememberPositionSet(EWin * ewin);
+void EwinRememberPositionGet(EWin * ewin, int *px, int *py);
void EwinPropagateShapes(EWin * ewin);
void EwinChange(EWin * ewin, unsigned int flag);
void EwinChangesStart(EWin * ewin);
@@ -1725,6 +1723,7 @@
void EwinsEventsConfigure(int mode);
void EwinsSetFree(void);
+void EwinsShowDesktop(int on);
int BordersEventExpose(XEvent * ev);
int BordersEventMouseDown(XEvent * ev);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.228
retrieving revision 1.229
diff -u -3 -r1.228 -r1.229
--- borders.c 11 Sep 2004 10:45:21 -0000 1.228
+++ borders.c 19 Sep 2004 09:27:38 -0000 1.229
@@ -365,7 +365,10 @@
/* if is an afterstep/windowmaker dock app - dock it */
if (Conf.dockapp_support && ewin->docked)
- DockIt(ewin);
+ {
+ DockIt(ewin);
+ ewin->props.donthide = 1;
+ }
/* if set for borderless then dont slide it in */
if ((!ewin->client.mwm_decor_title) && (!ewin->client.mwm_decor_border))
@@ -3261,6 +3264,47 @@
return -1; /* Not found */
}
+/*
+ * Save current position in absolute viewport coordinates
+ */
+void
+EwinRememberPositionSet(EWin * ewin)
+{
+ int ax, ay;
+
+ ewin->req_x = ewin->x;
+ ewin->req_y = ewin->y;
+ if (!ewin->sticky)
+ {
+ ax = desks.desk[ewin->desktop].current_area_x;
+ ay = desks.desk[ewin->desktop].current_area_y;
+ ewin->req_x += ax * VRoot.w;
+ ewin->req_y += ay * VRoot.h;
+ }
+}
+
+/*
+ * Get saved position in relative viewport coordinates
+ */
+void
+EwinRememberPositionGet(EWin * ewin, int *px, int *py)
+{
+ int x, y, ax, ay;
+
+ x = ewin->req_x;
+ y = ewin->req_y;
+ if (!ewin->sticky)
+ {
+ ax = desks.desk[ewin->desktop].current_area_x;
+ ay = desks.desk[ewin->desktop].current_area_y;
+ x -= ax * VRoot.w;
+ y -= ay * VRoot.h;
+ }
+
+ *px = x;
+ *py = y;
+}
+
void
EwinPropagateShapes(EWin * ewin)
{
@@ -3407,6 +3451,38 @@
}
}
+void
+EwinsShowDesktop(int on)
+{
+ EWin *const *lst, *ewin;
+ int i, num;
+
+ lst = EwinListGetForDesktop(desks.current, &num);
+
+ for (i = 0; i < num; i++)
+ {
+ ewin = lst[i];
+
+ if (on)
+ {
+ if (ewin->internal || ewin->iconified || ewin->props.donthide ||
+ ewin->client.transient)
+ continue;
+
+ ewin->st.showingdesk = 1;
+ IconifyEwin(ewin);
+ }
+ else
+ {
+ if (!ewin->st.showingdesk)
+ continue;
+
+ DeIconifyEwin(ewin);
+ }
+ }
+ EWMH_SetShowingDesktop(on);
+}
+
/*
* Border event handlers
*/
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewmh.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -3 -r1.58 -r1.59
--- ewmh.c 20 Aug 2004 21:13:56 -0000 1.58
+++ ewmh.c 19 Sep 2004 09:27:38 -0000 1.59
@@ -694,6 +694,7 @@
ewin->skipfocus = 1;
ewin->fixedpos = 1;
EwinSetBorderByName(ewin, "BORDERLESS", 0);
+ ewin->props.donthide = 1;
}
else if (atom == _NET_WM_WINDOW_TYPE_DOCK)
{
@@ -702,6 +703,7 @@
ewin->skipfocus = 1;
ewin->sticky = 1;
ewin->never_use_area = 1;
+ ewin->props.donthide = 1;
}
else if (atom == _NET_WM_WINDOW_TYPE_UTILITY)
{
@@ -710,6 +712,7 @@
ewin->skipwinlist = 1;
ewin->skipfocus = 1;
ewin->never_use_area = 1;
+ ewin->props.donthide = 1;
}
#if 0 /* Not used by E (yet?) */
else if (atom == _NET_WM_WINDOW_TYPE_TOOLBAR)
@@ -864,9 +867,7 @@
}
else if (event->message_type == _NET_SHOWING_DESKTOP)
{
- Eprintf("EWMH_ProcessClientMessage: _NET_SHOWING_DESKTOP: %ld\n",
- event->data.l[0]);
- EWMH_SetShowingDesktop(event->data.l[0]);
+ EwinsShowDesktop(event->data.l[0]);
goto done;
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -3 -r1.118 -r1.119
--- iconify.c 31 Aug 2004 17:24:40 -0000 1.118
+++ iconify.c 19 Sep 2004 09:27:38 -0000 1.119
@@ -227,16 +227,16 @@
if (ib)
{
- if (ib->animate)
+ if (ib->animate && !ewin->st.showingdesk)
IB_Animate(1, ewin, ib->ewin);
UpdateAppIcon(ewin, ib->icon_mode);
IconboxAddEwin(ib, ewin);
}
HideEwin(ewin);
- /* Save position at which the window was iconified in req_x/y */
- ewin->req_x = ewin->x;
- ewin->req_y = ewin->y;
+
+ /* Save position at which the window was iconified */
+ EwinRememberPositionSet(ewin);
if (was_shaded != ewin->shaded)
EwinInstantShade(ewin, 0);
@@ -253,8 +253,7 @@
HideEwin(e);
e->iconified = 4;
- e->req_x = e->x;
- e->req_y = e->y;
+ EwinRememberPositionSet(e);
}
if (lst)
Efree(lst);
@@ -282,7 +281,7 @@
EWin **lst, *e;
int i, num;
Iconbox *ib;
- int x, y, dx, dy;
+ int x, y, ox, oy, dx, dy;
EDBUG(6, "DeIconifyEwin");
@@ -295,27 +294,31 @@
RemoveMiniIcon(ewin);
- x = ewin->req_x;
- y = ewin->req_y;
-
- /* If we iconified an offscreen window, get it back on screen */
- if (x + ewin->w <= 4 || x > VRoot.w - 4 ||
- y + ewin->h <= 4 || y > VRoot.h - 4)
- {
- dx = ewin->w / 2;
- dy = ewin->h / 2;
- x = (ewin->x + dx) % VRoot.w;
- if (x < 0)
- x += VRoot.w;
- x -= dx;
- y = (ewin->y + dy) % VRoot.h;
- if (y < 0)
- y += VRoot.h;
- y -= dy;
+ EwinRememberPositionGet(ewin, &ox, &oy);
+ x = ox;
+ y = oy;
+
+ if (!ewin->st.showingdesk)
+ {
+ /* If we iconified an offscreen window, get it back on screen */
+ if (x + ewin->w <= 4 || x > VRoot.w - 4 ||
+ y + ewin->h <= 4 || y > VRoot.h - 4)
+ {
+ dx = ewin->w / 2;
+ dy = ewin->h / 2;
+ x = (ewin->x + dx) % VRoot.w;
+ if (x < 0)
+ x += VRoot.w;
+ x -= dx;
+ y = (ewin->y + dy) % VRoot.h;
+ if (y < 0)
+ y += VRoot.h;
+ y -= dy;
+ }
}
- dx = x - ewin->req_x;
- dy = y - ewin->req_y;
+ dx = x - ox;
+ dy = y - oy;
if (ewin->sticky)
MoveEwin(ewin, x, y);
@@ -326,9 +329,11 @@
ewin->iconified = 0;
ib = SelectIconboxForEwin(ewin);
- if (ib && ib->animate)
+ if (ib && ib->animate && !ewin->st.showingdesk)
IB_Animate(0, ewin, ib->ewin);
+ ewin->st.showingdesk = 0;
+
RaiseEwin(ewin);
ShowEwin(ewin);
ICCCM_DeIconify(ewin);
@@ -340,10 +345,11 @@
if (e->iconified != 4)
continue;
+ EwinRememberPositionGet(e, &ox, &oy);
if (e->sticky)
- MoveEwin(e, e->req_x + dx, e->req_y + dy);
+ MoveEwin(e, ox + dx, oy + dy);
else
- MoveEwinToDesktopAt(e, desks.current, e->req_x + dx, e->req_y + dy);
+ MoveEwinToDesktopAt(e, desks.current, ox + dx, oy + dy);
RaiseEwin(e);
ShowEwin(e);
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs