Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: Tag: branch-exp E.h borders.c buttons.c desktops.c dialog.c ecompmgr.c ecompmgr.h eobj.c ewin-ops.c ewins.c focus.c iconify.c main.c mod-desks.c mod-misc.c settings.c stacking.c startup.c theme.c Log Message: Assorted cleanups and fixes. =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v retrieving revision 1.314.2.76 retrieving revision 1.314.2.77 diff -u -3 -r1.314.2.76 -r1.314.2.77 --- E.h 24 Dec 2004 14:03:52 -0000 1.314.2.76 +++ E.h 26 Dec 2004 15:58:14 -0000 1.314.2.77 @@ -549,15 +549,16 @@ short ilayer; /* Internal stacking layer */ short layer; /* Stacking layer */ short desk; /* Belongs on desk */ - char sticky:1; - char floating; int x, y; int w, h; - char *name; /* Debug only */ + char sticky; + char floating; #if USE_COMPOSITE + char shadow; /* Enable shadows */ unsigned int opacity; void *cmhook; #endif + char *name; /* Debug only */ }; #define EOBJ_TYPE_EWIN 0 @@ -578,7 +579,6 @@ #define EoGetPixmap(eo) EobjGetPixmap(&((eo)->o)) #define EoSetWin(eo, _x) (eo)->o.win = (_x) -#define EoSetType(eo, _x) (eo)->o.type = (_x) #define EoSetX(eo, _x) (eo)->o.x = (_x) #define EoSetY(eo, _y) (eo)->o.y = (_y) #define EoSetW(eo, _w) (eo)->o.w = (_w) @@ -590,9 +590,11 @@ #if USE_COMPOSITE #define EoSetOpacity(eo, _o) (eo)->o.opacity = (_o) #define EoChangeOpacity(eo, _o) EobjChangeOpacity(&((eo)->o), _o) +#define EoDisableShadows(eo) (eo)->o.shadow = 0 #else #define EoSetOpacity(eo, _o) #define EoChangeOpacity(eo, _o) +#define EoDisableShadows(eo) #endif typedef struct _constraints @@ -950,8 +952,12 @@ } snap; struct { + char firsttime; + char animate; + } startup; + struct + { char *name; - char use_startup_background; } theme; #ifdef ENABLE_THEME_TRANSPARENCY struct @@ -1485,6 +1491,9 @@ void DialogSetTitle(Dialog * d, const char *title); void DialogSetExitFunction(Dialog * d, DialogCallbackFunc * func, int val); +void DialogSetData(Dialog * d, void *data); +void *DialogGetData(Dialog * d); + void DialogRedraw(Dialog * d); void ShowDialog(Dialog * d); void DialogClose(Dialog * d); @@ -1584,6 +1593,8 @@ void EdgeWindowsHide(void); /* eobj.c */ +void EobjInit(EObj * eo, int type, int x, int y, int w, int h); + #if USE_COMPOSITE EObj *EobjCreate(Window win); void EobjDestroy(EObj * eo); @@ -2181,6 +2192,7 @@ EWin *const *EwinListStackGet(int *num); EWin *const *EwinListFocusGet(int *num); EWin *const *EwinListGetForDesk(int *num, int desk); +EWin *EwinListStackGetTop(void); #define EwinListGetAll EwinListStackGet #define EwinListStackRaise(ewin) EobjListStackRaise(&(ewin->o)) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v retrieving revision 1.221.2.20 retrieving revision 1.221.2.21 diff -u -3 -r1.221.2.20 -r1.221.2.21 --- borders.c 18 Dec 2004 00:00:57 -0000 1.221.2.20 +++ borders.c 26 Dec 2004 15:58:15 -0000 1.221.2.21 @@ -989,6 +989,8 @@ if (ewin->border->part[part].aclass) EventAclass(ev, ewin, ewin->border->part[part].aclass); + + FocusHandleClick(ewin, wbit->win); } static void =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/buttons.c,v retrieving revision 1.36.2.19 retrieving revision 1.36.2.20 diff -u -3 -r1.36.2.19 -r1.36.2.20 --- buttons.c 9 Dec 2004 21:40:41 -0000 1.36.2.19 +++ buttons.c 26 Dec 2004 15:58:15 -0000 1.36.2.20 @@ -146,15 +146,11 @@ XSelectInput(disp, EoGetWin(b), BUTTON_EVENT_MASK); EventCallbackRegister(EoGetWin(b), 0, ButtonHandleEvents, b); - EoSetType(b, EOBJ_TYPE_BUTTON); - EoSetX(b, -1); - EoSetY(b, -1); - EoSetW(b, -1); - EoSetH(b, -1); + EobjInit(&b->o, EOBJ_TYPE_BUTTON, -1, -1, -1, -1); EoSetSticky(b, sticky); EoSetDesk(b, desk); EoSetLayer(b, ontop); - EoSetOpacity(b, 0xFFFFFFFF); + EoDisableShadows(b); EobjListStackAdd(&b->o, 0); EwinListStackRaise(b); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v retrieving revision 1.95.2.32 retrieving revision 1.95.2.33 diff -u -3 -r1.95.2.32 -r1.95.2.33 --- desktops.c 30 Nov 2004 23:31:51 -0000 1.95.2.32 +++ desktops.c 26 Dec 2004 15:58:15 -0000 1.95.2.33 @@ -391,6 +391,9 @@ if (!desks.desk[desk].viewable) EDBUG_RETURN_; + if (EventDebug(EDBUG_TYPE_DESKS)) + Eprintf("RefreshDesktop %d\n", desk); + bg = desks.desk[desk].bg; if (!bg) EDBUG_RETURN_; @@ -431,7 +434,7 @@ for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++) { Esnprintf(s, sizeof(s), "DRAGBAR_DESKTOP_%i", i); - Eprintf("InitDesktopControls: %s\n", s); + ac = FindItem(s, 0, LIST_FINDBY_NAME, LIST_TYPE_ACLASS); if (!ac) { @@ -719,7 +722,8 @@ EoGetY(ewin)); EoSetDesk(ewin, 0); } - XRaiseWindow(disp, EoGetWin(ewin)); + EwinListStackRaise(ewin); + StackDesktop(EoGetDesk(ewin)); EdgeWindowsShow(); ICCCM_Configure(ewin); } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/dialog.c,v retrieving revision 1.91.2.13 retrieving revision 1.91.2.14 diff -u -3 -r1.91.2.13 -r1.91.2.14 --- dialog.c 24 Dec 2004 14:03:53 -0000 1.91.2.13 +++ dialog.c 26 Dec 2004 15:58:16 -0000 1.91.2.14 @@ -190,6 +190,7 @@ int exit_val; int num_bindings; DKeyBind *keybindings; + void *data; }; static Dialog *FindDialog(Window win); @@ -318,6 +319,18 @@ } void +DialogSetData(Dialog * d, void *data) +{ + d->data = data; +} + +void * +DialogGetData(Dialog * d) +{ + return d->data; +} + +void DialogAddButton(Dialog * d, const char *text, DialogCallbackFunc * func, char doclose) { =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ecompmgr.c,v retrieving revision 1.1.2.13 retrieving revision 1.1.2.14 diff -u -3 -r1.1.2.13 -r1.1.2.14 --- ecompmgr.c 24 Dec 2004 00:59:54 -0000 1.1.2.13 +++ ecompmgr.c 26 Dec 2004 15:58:16 -0000 1.1.2.14 @@ -81,10 +81,13 @@ #define CAN_DO_USABLE 0 #define ENABLE_SHADOWS 1 +#if HAS_NAME_WINDOW_PIXMAP +#define ENABLE_FADING 0 +#else #define ENABLE_FADING 0 +#endif #define ENABLE_DEBUG 1 - #if ENABLE_DEBUG #define EDBUG_TYPE_COMPMGR 161 #define EDBUG_TYPE_COMPMGR2 162 @@ -96,15 +99,12 @@ #define D2printf(fmt...) #endif /* ENABLE_DEBUG */ -#define DEBUG_EVENTS 0 - #define INV_POS 0x01 #define INV_SIZE 0x02 #define INV_OPACITY 0x04 +#define INV_SHADOW 0x08 #define INV_GEOM (INV_POS | INV_SIZE) -#define INV_ALL (INV_POS | INV_SIZE | INV_OPACITY) - -extern Atom _NET_WM_WINDOW_OPACITY; +#define INV_ALL (INV_POS | INV_SIZE | INV_OPACITY | INV_SHADOW) typedef struct _ecmwininfo ECmWinInfo; /* TBD */ @@ -120,7 +120,8 @@ XRectangle damage_bounds; /* bounds of damage */ #endif int mode; - int damaged; + char visible; + char damaged; Damage damage; Picture picture; Picture alphaPict; @@ -143,31 +144,27 @@ }; #if ENABLE_SHADOWS -typedef enum _compMode -{ - CompSimple, /* looks like a regular X server */ - CompServerShadows, /* use window alpha for shadow; sharp, but precise */ - CompClientShadows, /* use window extents for shadow, blurred */ -} CompMode; +#define ECM_SHADOWS_OFF 0 +#define ECM_SHADOWS_SHARP 1 /* use window alpha for shadow; sharp, but precise */ +#define ECM_SHADOWS_BLURRED 2 /* use window extents for shadow, blurred */ #endif static struct { - char *args; int mode; -#if ENABLE_SHADOWS int shadow; -#endif + int shadow_radius; char resize_fix_enable; } Conf_compmgr; -#define ECOMPMGR_MODE_OFF 0 -#define ECOMPMGR_MODE_ROOT 1 -#define ECOMPMGR_MODE_WINDOW 2 -#define ECOMPMGR_MODE_AUTO 3 +#define ECM_MODE_OFF 0 +#define ECM_MODE_ROOT 1 +#define ECM_MODE_WINDOW 2 +#define ECM_MODE_AUTO 3 static struct { + char *args; char active; #if HAS_NAME_WINDOW_PIXMAP char have_name_pixmap; @@ -179,19 +176,17 @@ static XserverRegion allDamage; -static Bool clipChanged; +#define OPAQUE 0xffffffff -#define OPAQUE 0xffffffff +#define WINDOW_SOLID 0 +#define WINDOW_TRANS 1 +#define WINDOW_ARGB 2 -#define WINDOW_SOLID 0 -#define WINDOW_TRANS 1 -#define WINDOW_ARGB 2 +#define TRANS_OPACITY 0.75 -#define TRANS_OPACITY 0.75 - -static void ECompMgrDamageMerge(XserverRegion damage, int destroy); +static void ECompMgrDamageAll(void); +static void ECompMgrHandleRootEvent(XEvent * ev, void *prm); static void ECompMgrHandleWindowEvent(XEvent * ev, void *prm); -static void ECompMgrWinNew(EObj * eo); static void ESelectInputAdd(Display * dpy, Window win, long mask) @@ -380,7 +375,7 @@ } /* New background, all must be repainted */ - ECompMgrDamageMerge(ERegionCreate(0, 0, VRoot.w, VRoot.h), 1); + ECompMgrDamageAll(); desks[desk].bgpict = pict; @@ -432,6 +427,12 @@ ERegionShow("ECompMgrDamageMerge all:", allDamage); } +static void +ECompMgrDamageAll(void) +{ + ECompMgrDamageMerge(ERegionCreate(0, 0, VRoot.w, VRoot.h), 1); +} + #if ENABLE_FADING typedef struct _fade @@ -595,8 +596,6 @@ #if ENABLE_SHADOWS #define SHADOW_OPACITY 0.75 -#define SHADOW_OFFSET_X (-shadowRadius * 5 / 4) -#define SHADOW_OFFSET_Y (-shadowRadius * 5 / 4) static Picture blackPicture; static Picture transBlackPicture; @@ -609,11 +608,6 @@ static conv *gaussianMap; -#define SHADOWS 1 -#define SHARP_SHADOW 0 - -int shadowRadius = 12; - static double gaussian(double r, double x, double y) { @@ -873,12 +867,12 @@ r.height = w->a.height + w->a.border_width * 2; #if ENABLE_SHADOWS - if (Conf_compmgr.shadow != CompSimple && - (Conf_compmgr.shadow == CompServerShadows || w->mode != WINDOW_ARGB)) + if (eo->shadow && Conf_compmgr.shadow != ECM_SHADOWS_OFF && + (Conf_compmgr.shadow == ECM_SHADOWS_SHARP || w->mode != WINDOW_ARGB)) { XRectangle sr; - if (Conf_compmgr.shadow == CompServerShadows) + if (Conf_compmgr.shadow == ECM_SHADOWS_SHARP) { w->shadow_dx = 2; w->shadow_dy = 7; @@ -887,8 +881,8 @@ } else { - w->shadow_dx = SHADOW_OFFSET_X; - w->shadow_dy = SHADOW_OFFSET_Y; + w->shadow_dx = -Conf_compmgr.shadow_radius * 5 / 4; + w->shadow_dy = -Conf_compmgr.shadow_radius * 5 / 4; if (!w->shadow) { double opacity = SHADOW_OPACITY; @@ -963,13 +957,16 @@ #endif } -/* pixmap picture borderSize shadowPict borderClip - alphaPict */ static void -ECompMgrWinInvalidate(ECmWinInfo * w, int what) +ECompMgrWinInvalidate(EObj * eo, int what) { + ECmWinInfo *w = eo->cmhook; Display *dpy = disp; - if ((what & INV_GEOM) && w->extents != None) + if (!w) + return; + + if ((what & (INV_GEOM | INV_SHADOW)) && w->extents != None) { XFixesDestroyRegion(dpy, w->extents); w->extents = None; @@ -994,38 +991,25 @@ w->borderSize = None; } -#if ENABLE_SHADOWS - if ((what & INV_SIZE) && w->shadow != None) - { - XRenderFreePicture(dpy, w->shadow); - w->shadow = None; - } - if ((what & INV_SIZE) && w->shadowPict != None) + if ((what & INV_OPACITY) && w->alphaPict != None) { - XRenderFreePicture(dpy, w->shadowPict); - w->shadowPict = None; + XRenderFreePicture(dpy, w->alphaPict); + w->alphaPict = None; } -#endif if ((what & INV_SIZE) && w->borderClip != None) { XFixesDestroyRegion(dpy, w->borderClip); w->borderClip = None; } -} -static void -ECompMgrWinInvalidateOpacity(ECmWinInfo * w) -{ - Display *dpy = disp; - - if (w->alphaPict != None) +#if ENABLE_SHADOWS + if ((what & (INV_SIZE | INV_SHADOW)) && w->shadow != None) { - XRenderFreePicture(dpy, w->alphaPict); - w->alphaPict = None; + XRenderFreePicture(dpy, w->shadow); + w->shadow = None; } -#if ENABLE_SHADOWS - if (w->shadowPict != None) + if ((what & (INV_SIZE | INV_OPACITY | INV_SHADOW)) && w->shadowPict != None) { XRenderFreePicture(dpy, w->shadowPict); w->shadowPict = None; @@ -1050,7 +1034,7 @@ w->opacity); /* Invalidate stuff changed by opacity */ - ECompMgrWinInvalidateOpacity(w); + ECompMgrWinInvalidate(eo, INV_OPACITY); if (w->a.class == InputOnly) pictfmt = NULL; @@ -1084,19 +1068,14 @@ } w->a.map_state = IsViewable; + w->visible = 1; D1printf("ECompMgrWinMap %#lx\n", eo->win); #if CAN_DO_USABLE w->damage_bounds.x = w->damage_bounds.y = 0; w->damage_bounds.width = w->damage_bounds.height = 0; #endif -#if 0 - w->damaged = 0; -#endif - - if (w->extents) - XFixesDestroyRegion(disp, w->extents); - w->extents = win_extents(disp, eo); + ECompMgrDamageMerge(w->extents, 0); } static void @@ -1104,6 +1083,8 @@ { ECmWinInfo *w = eo->cmhook; + w->visible = 0; + #if 0 w->damaged = 0; @@ -1111,7 +1092,7 @@ w->usable = False; #endif - ECompMgrWinInvalidate(w, INV_SIZE); + ECompMgrWinInvalidate(eo, INV_SIZE); if (w->extents != None) { @@ -1122,19 +1103,15 @@ if (w->extents != None) ECompMgrDamageMerge(w->extents, 0); #endif - - clipChanged = True; } #if ENABLE_FADING -#if HAS_NAME_WINDOW_PIXMAP static void unmap_callback(Display * dpy, ECmWinInfo * w, Bool gone __UNUSED__) { finish_unmap_win(dpy, w); } #endif -#endif static void ECompMgrWinUnmap(EObj * eo, Bool do_fade __UNUSED__) @@ -1142,14 +1119,12 @@ D1printf("ECompMgrWinUnmap %#lx\n", eo->win); #if ENABLE_FADING -#if HAS_NAME_WINDOW_PIXMAP ECmWinInfo *w = eo->cmhook; if (w->pixmap && do_fade && fadeWindows) set_fade(dpy, w, False, unmap_callback, False); else #endif -#endif finish_unmap_win(eo); } @@ -1201,7 +1176,7 @@ } } -static void +void ECompMgrWinNew(EObj * eo) { ECmWinInfo *w; @@ -1259,15 +1234,15 @@ w->borderClip = None; +#if 0 /* moved mode setting to one place */ ESelectInputAdd(disp, eo->win, PropertyChangeMask /* | StructureNotifyMask */ ); +#endif /* Find new window region */ w->extents = win_extents(disp, eo); - clipChanged = True; - w->opacity = 0xdeadbeef; ECompMgrWinChangeOpacity(eo, eo->opacity); @@ -1316,7 +1291,7 @@ if (invalidate) { - ECompMgrWinInvalidate(w, invalidate); + ECompMgrWinInvalidate(eo, invalidate); if (invalidate & INV_SIZE) ECompMgrWinSetPicts(eo); @@ -1334,8 +1309,6 @@ /* Invalidate new window region */ XFixesUnionRegion(disp, damage, damage, w->extents); ECompMgrDamageMerge(damage, 1); - - clipChanged = True; } static void @@ -1344,40 +1317,30 @@ D1printf("ECompMgrWinCirculate %#lx %#lx\n", ev->xany.window, eo->win); /* FIXME - Check if stacking was changed */ - clipChanged = True; } static void -ECompMgrWinInvalidateAll(ECmWinInfo * w) +finish_destroy_win(EObj * eo, Bool gone) { - /* Free pixmap, picture, borderSize, shadowPict, borderClip */ - ECompMgrWinInvalidate(w, INV_ALL); + ECmWinInfo *w = eo->cmhook; + + if (!gone) + finish_unmap_win(eo); + else + ECompMgrDamageMerge(w->extents, 0); - /* Free alphaPict, shadowPict */ - ECompMgrWinInvalidateOpacity(w); + ECompMgrWinInvalidate(eo, INV_ALL); -#if 1 if (w->picture != None) { XRenderFreePicture(disp, w->picture); w->picture = None; } -#endif -} - -static void -finish_destroy_win(EObj * eo, Bool gone) -{ - ECmWinInfo *w = eo->cmhook; - - if (!gone) - finish_unmap_win(eo); - - ECompMgrWinInvalidateAll(w); if (w->damage != None) { XDamageDestroy(disp, w->damage); + w->damage = None; } #if ENABLE_FADING @@ -1388,16 +1351,14 @@ } #if ENABLE_FADING -#if HAS_NAME_WINDOW_PIXMAP static void destroy_callback(EObj * eo, Bool gone) { finish_destroy_win(eo, gone); } #endif -#endif -static void +void ECompMgrWinDel(EObj * eo, Bool gone, Bool do_fade) { ECmWinInfo *w = eo->cmhook; @@ -1408,12 +1369,10 @@ D1printf("ECompMgrWinDel %#lx\n", eo->win); #if ENABLE_FADING -#if HAS_NAME_WINDOW_PIXMAP if (w && w->pixmap && do_fade && fadeWindows) set_fade(disp, w, False, destroy_callback, gone); else #endif -#endif finish_destroy_win(eo, gone); do_fade = False; @@ -1478,7 +1437,6 @@ w->a.width <= w->damage_bounds.x + w->damage_bounds.width && w->a.height <= w->damage_bounds.y + w->damage_bounds.height) { - clipChanged = True; #if ENABLE_FADING if (fadeWindows) set_fade(dpy, w, True, 0, False); @@ -1505,7 +1463,7 @@ w->a.x + w->a.border_width, w->a.y + w->a.border_width); #if ENABLE_SHADOWS - if (Conf_compmgr.shadow == CompServerShadows) + if (Conf_compmgr.shadow == ECM_SHADOWS_SHARP) { XserverRegion o; @@ -1531,8 +1489,10 @@ } static void -ECompMgrRepaint(Display * dpy, XserverRegion region) +ECompMgrRepaint(void) { + Display *dpy = disp; + XserverRegion region = allDamage; EObj *const *lst, *eo; int i, num; ECmWinInfo *w; @@ -1541,7 +1501,7 @@ D2printf("ECompMgrRepaint rootBuffer=%#lx rootPicture=%#lx\n", rootBuffer, rootPicture); if (EventDebug(EDBUG_TYPE_COMPMGR3)) - ERegionShow("Paint", region); + ERegionShow("ECompMgrRepaint", region); if (!rootBuffer) rootBuffer = EPictureCreateBuffer(VRoot.win, VRoot.w, VRoot.h, @@ -1552,7 +1512,7 @@ /* Draw desktop background picture */ pict = DeskBackgroundPictureGet(0); - D1printf("paint_root desk picture=%#lx\n", pict); + D1printf("ECompMgrRepaint desk picture=%#lx\n", pict); XRenderComposite(dpy, PictOpSrc, pict, None, pbuf, 0, 0, 0, 0, 0, 0, VRoot.w, VRoot.h); @@ -1569,6 +1529,8 @@ } w = eo->cmhook; + if (!w->visible) + continue; #if CAN_DO_USABLE if (!w->usable) continue; @@ -1582,27 +1544,8 @@ ECompMgrWinSetPicts(eo); #endif - D2printf("paint %#lx %d %#lx\n", eo->win, w->mode, w->picture); -#if 0 /* FIXME - Why? */ - if (clipChanged) - { - if (w->borderSize) - { - XFixesDestroyRegion(dpy, w->borderSize); - w->borderSize = None; - } - if (w->extents) - { - XFixesDestroyRegion(dpy, w->extents); - w->extents = None; - } - if (w->borderClip) - { - XFixesDestroyRegion(dpy, w->borderClip); - w->borderClip = None; - } - } -#endif + D2printf("ECompMgrRepaint paint %#lx %d %#lx\n", eo->win, w->mode, + w->picture); /* Region of shaped window in screen coordinates */ if (!w->borderSize) @@ -1617,16 +1560,6 @@ ERegionShow("Window extents", w->extents); #if 0 - if (w->mode == WINDOW_SOLID) - { - XFixesSetPictureClipRegion(dpy, rootBuffer, 0, 0, region); - XFixesSubtractRegion(dpy, region, region, w->borderSize); - XRenderComposite(dpy, PictOpSrc, w->picture, None, rootBuffer, - 0, 0, 0, 0, w->rcx, w->rcy, w->rcw, w->rch); - } -#endif - -#if 0 if (!w->borderClip) { w->borderClip = XFixesCreateRegion(dpy, 0, 0); @@ -1634,12 +1567,13 @@ } XFixesSetPictureClipRegion(dpy, pbuf, 0, 0, w->borderClip); #endif + #if ENABLE_SHADOWS switch (Conf_compmgr.shadow) { - case CompSimple: + case ECM_SHADOWS_OFF: break; - case CompServerShadows: + case ECM_SHADOWS_SHARP: if (w->opacity != OPAQUE && !w->shadowPict) w->shadowPict = EPictureCreateSolid(True, (double)w->opacity / @@ -1650,7 +1584,7 @@ w->a.x + w->shadow_dx, w->a.y + w->shadow_dy, w->shadow_width, w->shadow_height); break; - case CompClientShadows: + case ECM_SHADOWS_BLURRED: if (w->shadow) { XRenderComposite(dpy, PictOpOver, blackPicture, w->shadow, @@ -1695,6 +1629,7 @@ } XFixesDestroyRegion(dpy, region); + allDamage = None; } static void @@ -1764,27 +1699,57 @@ } static void -ECompMgrIdle(void) +ECompMgrDeskChanged(int desk) { - /* Do we get here on auto? */ - if (!allDamage /* || Conf_compmgr.mode == ECOMPMGR_MODE_AUTO */ ) - return; - - ECompMgrRepaint(disp, allDamage); - - XSync(disp, False); + D1printf("ECompMgrDeskChanged: desk=%d\n", desk); - allDamage = None; - clipChanged = False; + DeskBackgroundPictureFree(desk); } +#if ENABLE_SHADOWS static void -ECompMgrDeskChanged(int desk) +ECompMgrShadowsInit(int mode, int cleanup) { - D1printf("ECompMgrDeskChanged: desk=%d\n", desk); + if (mode == ECM_SHADOWS_BLURRED) + gaussianMap = make_gaussian_map(disp, Conf_compmgr.shadow_radius); + else + { + if (gaussianMap) + free(gaussianMap); + gaussianMap = NULL; + } - DeskBackgroundPictureFree(desk); + if (mode != ECM_SHADOWS_OFF) + blackPicture = EPictureCreateSolid(True, 1, 0, 0, 0); + else + { + if (blackPicture) + XRenderFreePicture(disp, blackPicture); + blackPicture = None; + } + + if (mode == ECM_SHADOWS_SHARP) + transBlackPicture = EPictureCreateSolid(True, 0.3, 0, 0, 0); + else + { + if (transBlackPicture) + XRenderFreePicture(disp, transBlackPicture); + transBlackPicture = None; + } + + if (cleanup) + { + EObj *const *lst; + int i, num; + + lst = EobjListStackGet(&num); + for (i = 0; i < num; i++) + ECompMgrWinInvalidate(lst[i], INV_SHADOW); + } } +#else +#define ECompMgrShadowsInit(mode, cleanup) +#endif static void ECompMgrStart(void) @@ -1792,48 +1757,42 @@ XRenderPictFormat *pictfmt; XRenderPictureAttributes pa; - if (Conf_compmgr.mode == ECOMPMGR_MODE_OFF || Mode_compmgr.active) + if (Conf_compmgr.mode == ECM_MODE_OFF || Mode_compmgr.active) return; Mode_compmgr.active = 1; -#if ENABLE_SHADOWS - if (Conf_compmgr.shadow == CompClientShadows) - gaussianMap = make_gaussian_map(disp, shadowRadius); -#endif - pa.subwindow_mode = IncludeInferiors; pictfmt = XRenderFindVisualFormat(disp, VRoot.vis); rootPicture = XRenderCreatePicture(disp, VRoot.win, pictfmt, CPSubwindowMode, &pa); -#if ENABLE_SHADOWS - blackPicture = EPictureCreateSolid(True, 1, 0, 0, 0); - if (Conf_compmgr.shadow == CompServerShadows) - transBlackPicture = EPictureCreateSolid(True, 0.3, 0, 0, 0); -#endif - - allDamage = None; - clipChanged = True; + ECompMgrShadowsInit(Conf_compmgr.shadow, 0); switch (Conf_compmgr.mode) { - case ECOMPMGR_MODE_AUTO: - XCompositeRedirectSubwindows(disp, VRoot.win, - CompositeRedirectAutomatic); - break; - case ECOMPMGR_MODE_ROOT: + case ECM_MODE_ROOT: XCompositeRedirectSubwindows(disp, VRoot.win, CompositeRedirectManual); ESelectInputAdd(disp, VRoot.win, SubstructureNotifyMask | ExposureMask | StructureNotifyMask | PropertyChangeMask); break; - case ECOMPMGR_MODE_WINDOW: + case ECM_MODE_AUTO: + XCompositeRedirectSubwindows(disp, VRoot.win, + CompositeRedirectAutomatic); + break; + case ECM_MODE_WINDOW: break; } - if (Conf_compmgr.mode != ECOMPMGR_MODE_AUTO) - ECompMgrRepaint(disp, ERegionCreate(0, 0, VRoot.w, VRoot.h)); + allDamage = None; + if (Conf_compmgr.mode != ECM_MODE_AUTO) + { + ECompMgrDamageAll(); + ECompMgrRepaint(); + } + + EventCallbackRegister(VRoot.win, 0, ECompMgrHandleRootEvent, NULL); } static void @@ -1856,14 +1815,53 @@ DeskBackgroundPictureFree(0); - lst = EobjListStackGet(&num); + ECompMgrShadowsInit(ECM_SHADOWS_OFF, 0); + lst = EobjListStackGet(&num); for (i = 0; i < num; i++) ECompMgrWinDel(lst[i], False, False); XCompositeUnredirectSubwindows(disp, VRoot.win, CompositeRedirectManual); + + EventCallbackUnregister(VRoot.win, 0, ECompMgrHandleRootEvent, NULL); +} + +void +ECompMgrConfigGet(cfg_composite * cfg) +{ + cfg->enable = Mode_compmgr.active; + cfg->shadow = Conf_compmgr.shadow; } +void +ECompMgrConfigSet(const cfg_composite * cfg) +{ + if (cfg->enable != Mode_compmgr.active) + { + Conf_compmgr.shadow = cfg->shadow; + if (cfg->enable) + ECompMgrStart(); + else + ECompMgrStop(); + } + else + { + if (cfg->shadow != Conf_compmgr.shadow) + { + Conf_compmgr.shadow = cfg->shadow; + if (Mode_compmgr.active) + { + ECompMgrShadowsInit(Conf_compmgr.shadow, 1); + ECompMgrDamageAll(); + } + } + } +} + +/* + * Event handlers + */ + static void ECompMgrHandleWindowEvent(XEvent * ev, void *prm) { @@ -1888,12 +1886,6 @@ break; #endif -#if 0 /* FIXME - Remove */ - case PropertyNotify: - ECompMgrWinProperty(eo, ev); - break; -#endif - case EX_EVENT_DAMAGE_NOTIFY: ECompMgrWinDamage(eo, ev); break; @@ -1976,9 +1968,13 @@ void ECompMgrParseArgs(const char *args) { - Conf_compmgr.args = Estrdup(args); + Mode_compmgr.args = Estrdup(args); } +/* + * Module functions + */ + static void ECompMgrInit(void) { @@ -1986,37 +1982,37 @@ if (!XDamageQueryExtension(disp, &events, &errors)) { - Conf_compmgr.mode = ECOMPMGR_MODE_OFF; + Conf_compmgr.mode = ECM_MODE_OFF; goto done; } if (!XDamageQueryExtension(disp, &major, &minor)) { - Conf_compmgr.mode = ECOMPMGR_MODE_OFF; + Conf_compmgr.mode = ECM_MODE_OFF; goto done; } #if HAS_NAME_WINDOW_PIXMAP Mode_compmgr.have_name_pixmap = (major > 0 || minor >= 2); #endif - if (Conf_compmgr.args) + if (Mode_compmgr.args) { - switch (Conf_compmgr.args[0]) + switch (Mode_compmgr.args[0]) { case '0': - Conf_compmgr.mode = ECOMPMGR_MODE_OFF; + Conf_compmgr.mode = ECM_MODE_OFF; break; case '1': - Conf_compmgr.mode = ECOMPMGR_MODE_ROOT; + Conf_compmgr.mode = ECM_MODE_ROOT; break; case '2': - Conf_compmgr.mode = ECOMPMGR_MODE_WINDOW; + Conf_compmgr.mode = ECM_MODE_WINDOW; break; case '3': - Conf_compmgr.mode = ECOMPMGR_MODE_AUTO; + Conf_compmgr.mode = ECM_MODE_AUTO; break; } - _EFREE(Conf_compmgr.args); + _EFREE(Mode_compmgr.args); } done: @@ -2026,17 +2022,19 @@ static void ECompMgrSighan(int sig, void *prm) { - if (sig != ESIGNAL_INIT && Conf_compmgr.mode == ECOMPMGR_MODE_OFF) + if (sig != ESIGNAL_INIT && Conf_compmgr.mode == ECM_MODE_OFF) return; switch (sig) { case ESIGNAL_INIT: ECompMgrInit(); - if (Conf_compmgr.mode == ECOMPMGR_MODE_OFF) + if (Conf_compmgr.mode == ECM_MODE_OFF) break; ECompMgrStart(); +#if 0 EventCallbackRegister(VRoot.win, 0, ECompMgrHandleRootEvent, NULL); +#endif break; case ESIGNAL_BACKGROUND_CHANGE: @@ -2044,7 +2042,11 @@ break; case ESIGNAL_IDLE: - ECompMgrIdle(); + /* Do we get here on auto? */ + if (!allDamage /* || Conf_compmgr.mode == ECM_MODE_AUTO */ ) + return; + ECompMgrRepaint(); + XSync(disp, False); break; } } @@ -2069,6 +2071,10 @@ { IpcPrintf("CompMgr - on=%d\n", Mode_compmgr.active); } + else if (!strcmp(cmd, "cfg")) + { + SettingsComposite(); + } else if (!strcmp(cmd, "start")) { ECompMgrStart(); @@ -2088,7 +2094,10 @@ CompMgrIpc, "compmgr", "cm", "Composite manager functions", - " cm ? Show info\n"} + " cm ? Show info\n" + " cm cfg Configure\n" + " cm start Start composite manager\n" + " cm stop Stop composite manager\n"} , }; #define N_IPC_FUNCS (sizeof(CompMgrIpcArray)/sizeof(IpcItem)) @@ -2096,6 +2105,7 @@ static const CfgItem CompMgrCfgItems[] = { CFG_ITEM_INT(Conf_compmgr, mode, 0), CFG_ITEM_INT(Conf_compmgr, shadow, 0), + CFG_ITEM_INT(Conf_compmgr, shadow_radius, 12), CFG_ITEM_BOOL(Conf_compmgr, resize_fix_enable, 0), }; #define N_CFG_ITEMS (sizeof(CompMgrCfgItems)/sizeof(CfgItem)) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ecompmgr.h,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -3 -r1.1.2.5 -r1.1.2.6 --- ecompmgr.h 24 Dec 2004 00:59:55 -0000 1.1.2.5 +++ ecompmgr.h 26 Dec 2004 15:58:16 -0000 1.1.2.6 @@ -1,21 +1,32 @@ #ifndef _ECOMPMGR_H #define _ECOMPMGR_H +#if USE_COMPOSITE + +typedef struct +{ + char enable; + int shadow; +} cfg_composite; + void ECompMgrParseArgs(const char *args); -#if USE_COMPOSITE +void ECompMgrWinNew(EObj * eo); +void ECompMgrWinDel(EObj * eo, Bool gone, Bool do_fade); void ECompMgrWinChangeOpacity(EObj * eo, unsigned int opacity); Pixmap ECompMgrWinGetPixmap(const EObj * eo); -#else -#define ECompMgrWinChangeOpacity(eo, opacity) -#endif +void ECompMgrConfigGet(cfg_composite * cfg); +void ECompMgrConfigSet(const cfg_composite * cfg); -#if USE_COMPOSITE void ECompMgrMoveResizeFix(EObj * eo, int x, int y, int w, int h); #define ExMoveResizeWindow ECompMgrMoveResizeFix + #else + +#define ECompMgrWinDel(eo, gone, do_fade) #define ExMoveResizeWindow(eo, x, y, w, h) EMoveResizeWindow(disp, (eo)->win, x, y, w, h) + #endif #endif /* _ECOMPMGR_H */ =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/Attic/eobj.c,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -3 -r1.1.2.6 -r1.1.2.7 --- eobj.c 15 Dec 2004 22:17:09 -0000 1.1.2.6 +++ eobj.c 26 Dec 2004 15:58:16 -0000 1.1.2.7 @@ -85,10 +85,17 @@ * 60: Above ewins * 75: Above buttons * 80: Ontop ewins - * 95: Floating ewins * 200: E-Menus - * 800: Override redirect + * 500: Floating ewins + * TBD: Override redirect */ + + if (eo->floating) + { + eo->ilayer = 500; + return; + } + switch (eo->type) { case EOBJ_TYPE_EWIN: @@ -113,6 +120,20 @@ } } +void +EobjInit(EObj * eo, int type, int x, int y, int w, int h) +{ + eo->type = type; + eo->x = x; + eo->y = y; + eo->w = w; + eo->h = h; +#if USE_COMPOSITE + eo->opacity = 0xFFFFFFFF; + eo->shadow = 1; +#endif +} + #if USE_COMPOSITE EObj * EobjCreate(Window win) @@ -129,14 +150,7 @@ eo->win = win; - eo->type = EOBJ_TYPE_OVERR; - eo->x = attr.x; - eo->x = attr.y; - eo->w = attr.width; - eo->h = attr.height; -#if USE_COMPOSITE - eo->opacity = 0xFFFFFFFF; -#endif + EobjInit(eo, EOBJ_TYPE_OVERR, attr.x, attr.y, attr.width, attr.height); return eo; } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ewin-ops.c,v retrieving revision 1.1.2.25 retrieving revision 1.1.2.26 diff -u -3 -r1.1.2.25 -r1.1.2.26 --- ewin-ops.c 24 Dec 2004 00:59:55 -0000 1.1.2.25 +++ ewin-ops.c 26 Dec 2004 15:58:16 -0000 1.1.2.26 @@ -1282,10 +1282,17 @@ EoSetFloating(ewin, 0); +#if 0 + Eprintf("MoveEwinToDesktopAt: %#lx %d->%d\n", ewin->client.win, + EoGetDesk(ewin), desk); +#endif + pdesk = EoGetDesk(ewin); desk = desk % Conf.desks.num; if (desk != pdesk && !EoIsSticky(ewin)) { + DeskSetViewable(desk, 1); + RefreshDesktop(desk); EoSetDesk(ewin, desk); ModulesSignal(ESIGNAL_DESK_CHANGE, (void *)pdesk); } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ewins.c,v retrieving revision 1.1.2.37 retrieving revision 1.1.2.38 diff -u -3 -r1.1.2.37 -r1.1.2.38 --- ewins.c 24 Dec 2004 01:24:23 -0000 1.1.2.37 +++ ewins.c 26 Dec 2004 15:58:16 -0000 1.1.2.38 @@ -22,6 +22,7 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "E.h" +#include "ecompmgr.h" #include <sys/time.h> #define EWIN_TOP_EVENT_MASK \ @@ -102,14 +103,9 @@ ewin->area_x = -1; ewin->area_y = -1; - EoSetType(ewin, EOBJ_TYPE_EWIN); - EoSetX(ewin, -1); - EoSetY(ewin, -1); - EoSetW(ewin, -1); - EoSetH(ewin, -1); + EobjInit(&ewin->o, EOBJ_TYPE_EWIN, -1, -1, -1, -1); EoSetDesk(ewin, DesksGetCurrent()); EoSetLayer(ewin, 4); - EoSetOpacity(ewin, 0xFFFFFFFF); ewin->props.opacity = 0xFFFFFFFF; att.event_mask = EWIN_CONTAINER_EVENT_MASK; @@ -167,6 +163,9 @@ if (EventDebug(EDBUG_TYPE_EWINS)) Eprintf("EwinDestroy %#lx state=%d\n", ewin->client.win, ewin->state); + /* FIXME - Fading */ + ECompMgrWinDel(&ewin->o, True, False); + RemoveItem(NULL, ewin->client.win, LIST_FINDBY_ID, LIST_TYPE_EWIN); EventCallbackUnregister(ewin->client.win, 0, EwinHandleEventsClient, ewin); if (!EwinIsInternal(ewin)) @@ -640,7 +639,7 @@ { EWin *ewin, *ewin2; EWin **lst; - int i, k, num, speed, fx, fy, x, y; + int i, k, num, speed, fx, fy, x, y, desk; char doslide, manplace; EDBUG(3, "AddToFamily"); @@ -674,14 +673,17 @@ /* grab that server */ ecore_x_grab(); + speed = Conf.slidespeedmap; doslide = Conf.mapslide && !Mode.wm.startup; manplace = 0; + /* adopt the new baby */ ewin = Adopt(win); /* if it hasn't been planted on a desktop - assign it the current desktop */ - EoSetDesk(ewin, EoGetDesk(ewin)); + desk = EoGetDesk(ewin); + EoSetDesk(ewin, 0); /* if is an afterstep/windowmaker dock app - dock it */ if (Conf.dock.enable && ewin->docked) @@ -766,7 +768,7 @@ if (ewin2) { - EoSetDesk(ewin, EoGetDesk(ewin2)); + desk = EoGetDesk(ewin2); if (!Mode.wm.startup && Conf.focus.switchfortransientmap && !ewin->iconified) GotoDesktopByEwin(ewin2); @@ -811,7 +813,7 @@ /* if the loser has manual placement on and the app asks to be on */ /* a desktop, then send E to that desktop so the user can place */ /* the window there */ - GotoDesktop(EoGetDesk(ewin)); + GotoDesktop(desk); XQueryPointer(disp, VRoot.win, &root_return, &junk, &rx, &ry, &wx, &wy, &mask); @@ -848,7 +850,7 @@ if (ewin->client.start_iconified) { EwinBorderDraw(ewin, 1, 0); - MoveEwinToDesktopAt(ewin, EoGetDesk(ewin), x, y); + MoveEwinToDesktopAt(ewin, desk, x, y); ecore_x_ungrab(); ewin->state = EWIN_STATE_MAPPED; EwinIconify(ewin); @@ -866,7 +868,7 @@ /* if the loser has manual placement on and the app asks to be on */ /* a desktop, then send E to that desktop so the user can place */ /* the window there */ - GotoDesktop(EoGetDesk(ewin)); + GotoDesktop(desk); XQueryPointer(disp, VRoot.win, &root_return, &junk, &rx, &ry, &wx, &wy, &mask); @@ -876,7 +878,7 @@ x = Mode.x + 1; y = Mode.y + 1; EwinBorderDraw(ewin, 1, 0); - MoveEwinToDesktop(ewin, EoGetDesk(ewin)); + MoveEwinToDesktop(ewin, desk); RaiseEwin(ewin); MoveEwin(ewin, x, y); RaiseEwin(ewin); @@ -914,17 +916,17 @@ fy = (rand() % (VRoot.h)) - EoGetH(ewin); } EwinBorderDraw(ewin, 1, 0); - MoveEwinToDesktop(ewin, EoGetDesk(ewin)); + MoveEwinToDesktop(ewin, desk); RaiseEwin(ewin); MoveEwin(ewin, fx, fy); ShowEwin(ewin); SlideEwinTo(ewin, fx, fy, x, y, speed); - MoveEwinToDesktopAt(ewin, EoGetDesk(ewin), x, y); + MoveEwinToDesktopAt(ewin, desk, x, y); } else { EwinBorderDraw(ewin, 1, 0); - MoveEwinToDesktopAt(ewin, EoGetDesk(ewin), x, y); + MoveEwinToDesktopAt(ewin, desk, x, y); RaiseEwin(ewin); ShowEwin(ewin); } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v retrieving revision 1.81.2.12 retrieving revision 1.81.2.13 diff -u -3 -r1.81.2.12 -r1.81.2.13 --- focus.c 28 Nov 2004 17:51:34 -0000 1.81.2.12 +++ focus.c 26 Dec 2004 15:58:16 -0000 1.81.2.13 @@ -156,7 +156,8 @@ FocusEwinSetGrabs(EWin * ewin) { if ((Conf.focus.mode != MODE_FOCUS_CLICK && - ewin->active && Conf.focus.clickraises) || + ewin->active && Conf.focus.clickraises && + ewin != EwinListStackGetTop()) || (Conf.focus.mode == MODE_FOCUS_CLICK && !ewin->active)) { GrabButtonSet(AnyButton, AnyModifier, ewin->win_container, @@ -471,6 +472,9 @@ RaiseEwin(ewin); FocusToEWin(ewin, FOCUS_CLICK); + /* Remove grabs if on top of stacking list */ + FocusEwinSetGrabs(ewin); + /* allow click to pass thorugh */ if (EventDebug(EDBUG_TYPE_GRABS)) Eprintf("FocusHandleClick %#lx %#lx\n", win, ewin->win_container); @@ -487,25 +491,6 @@ } } -#if 0 /* FIXME - Move elsewhere */ -/* Focus actions */ - -static int -doFocusSet(EWin * ewin, const char *params __UNUSED__) -{ - GotoDesktopByEwin(ewin); - - if (ewin->iconified) - EwinDeIconify(ewin); - if (ewin->shaded) - EwinUnShade(ewin); - RaiseEwin(ewin); - FocusToEWin(ewin, FOCUS_SET); - - return 0; -} -#endif - static void FocusIpc(const char *params, Client * c __UNUSED__) { =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v retrieving revision 1.116.2.29 retrieving revision 1.116.2.30 diff -u -3 -r1.116.2.29 -r1.116.2.30 --- iconify.c 24 Dec 2004 14:03:53 -0000 1.116.2.29 +++ iconify.c 26 Dec 2004 15:58:16 -0000 1.116.2.30 @@ -555,7 +555,8 @@ else { EwinStick(ewin); - MoveResizeEwin(ewin, VRoot.w - 160, VRoot.h - h, 160, h); + ResizeEwin(ewin, w, h); + MoveEwin(ewin, VRoot.w - EoGetW(ewin), VRoot.h - EoGetH(ewin)); } ShowEwin(ewin); @@ -2279,6 +2280,14 @@ IconboxShow(ibl[i]); Efree(ibl); } + else if (Conf.startup.firsttime) + { + Iconbox *ib; + + ib = IconboxCreate("_IB_0"); + IconboxShow(ib); + IconboxesConfigSave(); + } } static void @@ -3053,8 +3062,6 @@ Iconbox **iblist; iblist = IconboxesList(&num); - if (!iblist) - return; Esnprintf(s, sizeof(s), "%s.ibox", EGetSavePrefix()); fs = fopen(s, "w"); @@ -3081,9 +3088,11 @@ fprintf(fs, "2012 %i\n", iblist[i]->animate); fprintf(fs, "1000\n"); } - Efree(iblist); fclose(fs); + + if (iblist) + Efree(iblist); } /* =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/main.c,v retrieving revision 1.99.2.32 retrieving revision 1.99.2.33 diff -u -3 -r1.99.2.32 -r1.99.2.33 --- main.c 22 Dec 2004 23:39:10 -0000 1.99.2.32 +++ main.c 26 Dec 2004 15:58:17 -0000 1.99.2.33 @@ -276,9 +276,6 @@ ecore_x_sync(); Mode.queue_up = DRAW_QUEUE_ENABLE; - Mode.wm.save_ok = 1; - autosave(); - /* let's make sure we set this up and go to our desk anyways */ GotoDesktop(DesksGetCurrent()); ecore_x_sync(); @@ -292,7 +289,10 @@ SpawnSnappedCmds(); + Conf.startup.firsttime = 0; + Mode.wm.save_ok = 1; Mode.wm.startup = 0; + autosave(); /* The primary event loop */ for (;;) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/Attic/mod-desks.c,v retrieving revision 1.1.2.13 retrieving revision 1.1.2.14 diff -u -3 -r1.1.2.13 -r1.1.2.14 --- mod-desks.c 24 Dec 2004 14:03:54 -0000 1.1.2.13 +++ mod-desks.c 26 Dec 2004 15:58:17 -0000 1.1.2.14 @@ -36,13 +36,13 @@ case ESIGNAL_INIT: DesktopsInit(); break; + case ESIGNAL_CONFIGURE: SetAreaSize(Conf.areas.nx, Conf.areas.ny); DeskSetViewable(0, 1); RefreshDesktop(0); -#if !USE_COMPOSITE /* FIXME - Disable for now */ /* toss down the dragbar and related */ InitDesktopControls(); @@ -50,7 +50,6 @@ ShowDesktopButtons(); ShowDesktopControls(); -#endif break; } } =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/Attic/mod-misc.c,v retrieving revision 1.1.2.23 retrieving revision 1.1.2.24 diff -u -3 -r1.1.2.23 -r1.1.2.24 --- mod-misc.c 22 Dec 2004 23:39:10 -0000 1.1.2.23 +++ mod-misc.c 26 Dec 2004 15:58:17 -0000 1.1.2.24 @@ -81,13 +81,6 @@ }; int n_modules = sizeof(p_modules) / sizeof(EModule *); -static struct -{ - char firsttime; -} Conf_misc = -{ -0}; - static void runDocBrowser(void) { @@ -117,9 +110,8 @@ char file[FILEPATH_LEN_MAX]; - if (!Conf_misc.firsttime) + if (!Conf.startup.firsttime) return; - Conf_misc.firsttime = 0; if (!Mode.wm.master) return; @@ -149,8 +141,6 @@ } static const CfgItem cfg_items[] = { - CFG_ITEM_BOOL(Conf_misc, firsttime, 1), - CFG_ITEM_INT(Conf, backgrounds.hiquality, 1), CFG_ITEM_INT(Conf, backgrounds.timeout, 240), CFG_ITEM_BOOL(Conf, backgrounds.user, 1), @@ -188,6 +178,9 @@ CFG_ITEM_INT(Conf, snap.edge_snap_dist, 8), CFG_ITEM_INT(Conf, snap.screen_snap_dist, 32), + CFG_ITEM_BOOL(Conf, startup.firsttime, 1), + CFG_ITEM_BOOL(Conf, startup.animate, 1), + CFG_ITEM_INT(Conf, deskmode, MODE_NONE), CFG_ITEM_INT(Conf, slidemode, 0), CFG_ITEM_BOOL(Conf, cleanupslide, 1), =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/settings.c,v retrieving revision 1.120.2.13 retrieving revision 1.120.2.14 diff -u -3 -r1.120.2.13 -r1.120.2.14 --- settings.c 24 Dec 2004 14:03:55 -0000 1.120.2.13 +++ settings.c 26 Dec 2004 15:58:17 -0000 1.120.2.14 @@ -1652,27 +1652,32 @@ } #if USE_COMPOSITE +#include "ecompmgr.h" + /* * Composite dialog */ -static struct -{ - char enable; - int shadow; -} Conf_comp; static void -CB_ConfigureComposite(Dialog * d __UNUSED__, int val, void *data __UNUSED__) +CB_ConfigureComposite(Dialog * d, int val, void *data __UNUSED__) { + cfg_composite *cfg; + if (val >= 2) return; + /* Configure and read back */ + cfg = DialogGetData(d); + ECompMgrConfigSet(cfg); + ECompMgrConfigGet(cfg); + autosave(); } void SettingsComposite(void) { + static cfg_composite Cfg_composite; Dialog *d; DItem *table, *di, *radio; @@ -1685,11 +1690,13 @@ } SoundPlay("SOUND_SETTINGS_COMPOSITE"); - /* FIXME - get settings */ - d = DialogCreate("CONFIGURE_COMPOSITE"); DialogSetTitle(d, _("Composite Settings")); + /* Get current settings */ + ECompMgrConfigGet(&Cfg_composite); + DialogSetData(d, &Cfg_composite); + table = DialogInitItem(d); DialogItemTableSetOptions(table, 2, 0, 0, 0); @@ -1720,8 +1727,8 @@ DialogItemSetFill(di, 1, 0); DialogItemSetColSpan(di, 2); DialogItemCheckButtonSetText(di, _("Enable Composite")); - DialogItemCheckButtonSetState(di, Conf_comp.enable); - DialogItemCheckButtonSetPtr(di, &Conf_comp.enable); + DialogItemCheckButtonSetState(di, Cfg_composite.enable); + DialogItemCheckButtonSetPtr(di, &Cfg_composite.enable); di = DialogAddItem(table, DITEM_SEPARATOR); DialogItemSetColSpan(di, 2); @@ -1752,7 +1759,7 @@ DialogItemRadioButtonSetText(di, _("Shadows Blurred")); DialogItemRadioButtonSetFirst(di, radio); DialogItemRadioButtonGroupSetVal(di, 2); - DialogItemRadioButtonGroupSetValPtr(radio, &Conf_comp.shadow); + DialogItemRadioButtonGroupSetValPtr(radio, &Cfg_composite.shadow); #if 0 di = DialogAddItem(table, DITEM_TEXT); =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/stacking.c,v retrieving revision 1.12.2.5 retrieving revision 1.12.2.6 diff -u -3 -r1.12.2.5 -r1.12.2.6 --- stacking.c 5 Dec 2004 12:27:33 -0000 1.12.2.5 +++ stacking.c 26 Dec 2004 15:58:18 -0000 1.12.2.6 @@ -391,3 +391,22 @@ *num = j; return lst; } + +EWin * +EwinListStackGetTop(void) +{ + const EobjList *ewl; + int i; + EObj *eo; + + ewl = &EwinListStack; + + for (i = 0; i < ewl->nwins; i++) + { + eo = ewl->list[i]; + if (eo->type == EOBJ_TYPE_EWIN) + return (EWin *) eo; + } + + return NULL; +} =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/startup.c,v retrieving revision 1.44.2.9 retrieving revision 1.44.2.10 diff -u -3 -r1.44.2.9 -r1.44.2.10 --- startup.c 22 Dec 2004 23:39:11 -0000 1.44.2.9 +++ startup.c 26 Dec 2004 15:58:18 -0000 1.44.2.10 @@ -35,7 +35,7 @@ static ImageClass *ic = NULL; char pq; - if (!Conf.theme.use_startup_background) + if (!Conf.startup.animate) return; if (start) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/theme.c,v retrieving revision 1.37.2.11 retrieving revision 1.37.2.12 diff -u -3 -r1.37.2.11 -r1.37.2.12 --- theme.c 22 Dec 2004 23:39:11 -0000 1.37.2.11 +++ theme.c 26 Dec 2004 15:58:18 -0000 1.37.2.12 @@ -491,7 +491,6 @@ static const CfgItem ThemeCfgItems[] = { CFG_ITEM_STR(Conf.theme, name), - CFG_ITEM_BOOL(Conf.theme, use_startup_background, 1), }; #define N_CFG_ITEMS (sizeof(ThemeCfgItems)/sizeof(CfgItem)) ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs