Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h borders.c desktops.c dialog.c evhandlers.c focus.c
iconify.c menus.c pager.c
Log Message:
Fix update of E-internal windows after move when theme transparency is on.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.215
retrieving revision 1.216
diff -u -3 -r1.215 -r1.216
--- E.h 29 Feb 2004 01:30:16 -0000 1.215
+++ E.h 1 Mar 2004 21:03:53 -0000 1.216
@@ -576,6 +576,7 @@
* Types
*/
+typedef struct _ewin EWin;
typedef struct _menu Menu;
typedef struct _menuitem MenuItem;
typedef struct _menustyle MenuStyle;
@@ -901,7 +902,7 @@
#define EWIN_TYPE_ICONBOX 0x04
#define EWIN_TYPE_PAGER 0x08
-typedef struct _ewin
+struct _ewin
{
Window win;
int x, y, w, h, reqx, reqy;
@@ -976,8 +977,9 @@
char *wm_name;
char *wm_icon_name;
} ewmh;
-}
-EWin;
+ void (*MoveResize) (EWin * ewin, int resize);
+ void (*Refresh) (EWin * ewin);
+};
typedef struct _groupconfig
{
@@ -1650,6 +1652,7 @@
#define EWIN_CHANGE_LAYER (1<<4)
void KillEwin(EWin * ewin, int nogroup);
+void EwinRefresh(EWin * ewin);
void EwinUpdateAfterMoveResize(EWin * ewin, int resize);
void ResizeEwin(EWin * ewin, int w, int h);
void MoveEwin(EWin * ewin, int x, int y);
@@ -1869,7 +1872,6 @@
void (*func) (int val, void *data),
int val, void *data);
void DialogRedraw(Dialog * d);
-void DialogMove(Dialog * d);
void ShowDialog(Dialog * d);
void DialogClose(Dialog * d);
@@ -1948,6 +1950,10 @@
int DialogEventMouseIn(XEvent * ev);
int DialogEventMouseOut(XEvent * ev);
+/* dock.c */
+void DockIt(EWin * ewin);
+void DockDestroy(EWin * ewin);
+
/* draw.c */
void HandleDrawQueue(void);
char IsPropagateEwinOnQueue(EWin * ewin);
@@ -2254,8 +2260,6 @@
void IconifyEwin(EWin * ewin);
void DeIconifyEwin(EWin * ewin);
void RemoveMiniIcon(EWin * ewin);
-void DockIt(EWin * ewin);
-void DockDestroy(EWin * ewin);
Iconbox *IconboxCreate(char *name);
void IconboxDestroy(Iconbox * ib);
Window IconboxGetWin(Iconbox * ib);
@@ -2264,8 +2268,6 @@
void IconboxIconifyEwin(Iconbox * ib, EWin * ewin);
void IconboxAddEwin(Iconbox * ib, EWin * ewin);
void IconboxDelEwin(Iconbox * ib, EWin * ewin);
-void IconboxRedraw(Iconbox * ib);
-void IconboxResize(Iconbox * ib, int w, int h);
void IconboxUpdateEwinIcon(Iconbox * ib, EWin * ewin,
int icon_mode);
void IconboxesUpdateEwinIcon(EWin * ewin, int icon_mode);
@@ -2310,7 +2312,6 @@
void MenuShow(Menu * m, char noshow);
void MenuRepack(Menu * m);
void MenuEmpty(Menu * m);
-void MenuMove(Menu * m);
MenuItem *MenuItemCreate(const char *text, ImageClass * iclass,
int action_id, char *action_params,
Menu * child);
@@ -2383,7 +2384,6 @@
/* pager.c */
Pager *PagerCreate(void);
void PagerDestroy(Pager * p);
-void PagerResize(Pager * p, int w, int h);
void PagerShow(Pager * p);
void PagerHide(Pager * p);
Pager **PagersForDesktop(int d, int *num);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -3 -r1.141 -r1.142
--- borders.c 29 Feb 2004 01:30:16 -0000 1.141
+++ borders.c 1 Mar 2004 21:03:53 -0000 1.142
@@ -1645,215 +1645,30 @@
}
void
-EwinUpdateAfterMoveResize(EWin * ewin, int resize)
+EwinRefresh(EWin * ewin)
{
if (!ewin)
return;
- DetermineEwinArea(ewin);
-
- if (ewin->dialog)
- DialogMove(ewin->dialog);
- else if (ewin->menu)
- MenuMove(ewin->menu);
- else if (resize && ewin->pager)
- PagerResize(ewin->pager, ewin->client.w, ewin->client.h);
- else if (resize && ewin->ibox)
- IconboxResize(ewin->ibox, ewin->client.w, ewin->client.h);
-
- PagerEwinOutsideAreaUpdate(ewin);
- ForceUpdatePagersForDesktop(ewin->desktop);
-}
-
-#if 0
-
-void
-ResizeEwin(EWin * ewin, int w, int h)
-{
- char resize = 0;
-
- EDBUG(3, "ResizeEwin");
- if ((ewin->client.w != w) || (ewin->client.h != h))
- resize = 1;
- ewin->client.w = w;
- ewin->client.h = h;
- ICCCM_MatchSize(ewin);
- if (!ewin->shaded)
- {
- ewin->w =
- ewin->client.w + ewin->border->border.left +
- ewin->border->border.right;
- ewin->h =
- ewin->client.h + ewin->border->border.top +
- ewin->border->border.bottom;
- }
- EResizeWindow(disp, ewin->win, ewin->w, ewin->h);
- ICCCM_Configure(ewin);
- CalcEwinSizes(ewin);
- if ((mode.mode == MODE_NONE) && (resize))
- {
- PagerEwinOutsideAreaUpdate(ewin);
- ForceUpdatePagersForDesktop(ewin->desktop);
- }
- if (ewin->pager)
- PagerResize(ewin->pager, ewin->client.w, ewin->client.h);
- else if (ewin->ibox)
- IconboxResize(ewin->ibox, ewin->client.w, ewin->client.h);
- EDBUG_RETURN_;
-}
-
-void
-MoveEwin(EWin * ewin, int x, int y)
-{
- int dx, dy;
- char move = 0;
- static int call_depth = 0;
-
- EDBUG(3, "MoveEwin");
- if (call_depth > 256)
- EDBUG_RETURN_;
- call_depth++;
-
- dx = x - ewin->x;
- dy = y - ewin->y;
- if ((dx != 0) || (dy != 0))
- move = 1;
- ewin->x = x;
- ewin->y = y;
- ewin->reqx = x;
- ewin->reqy = y;
- EMoveWindow(disp, ewin->win, ewin->x, ewin->y);
-
- if (mode.mode != MODE_MOVE_PENDING && mode.mode != MODE_MOVE)
- ICCCM_Configure(ewin);
-
- DetermineEwinArea(ewin);
-
- if (ewin->has_transients)
- {
- EWin **lst;
- int i, num;
-
- lst = ListTransientsFor(ewin->client.win, &num);
- if (lst)
- {
- for (i = 0; i < num; i++)
- {
- if (!((mode.flipp) && (lst[i]->floating))
- && (lst[i]->client.mwm_decor_border
- || lst[i]->client.mwm_decor_resizeh
- || lst[i]->client.mwm_decor_title
- || lst[i]->client.mwm_decor_menu
- || lst[i]->client.mwm_decor_minimize
- || lst[i]->client.mwm_decor_maximize))
- MoveEwin(lst[i], lst[i]->x + dx, lst[i]->y + dy);
- }
- Efree(lst);
- }
- }
-
- if ((mode.mode == MODE_NONE) && (move))
- {
- if (ewin->dialog)
- DialogMove(ewin->dialog);
- else if (ewin->menu)
- MenuMove(ewin->menu);
-
- PagerEwinOutsideAreaUpdate(ewin);
- ForceUpdatePagersForDesktop(ewin->desktop);
- }
-
- call_depth--;
- EDBUG_RETURN_;
+ if (ewin->Refresh)
+ ewin->Refresh(ewin);
}
void
-MoveResizeEwin(EWin * ewin, int x, int y, int w, int h)
+EwinUpdateAfterMoveResize(EWin * ewin, int resize)
{
- int dx, dy;
- char change = 0;
- static int call_depth = 0;
-
- EDBUG(3, "MoveResizeEwin");
- if (call_depth > 256)
- EDBUG_RETURN_;
- call_depth++;
-
- dx = x - ewin->x;
- dy = y - ewin->y;
- if ((dx != 0) || (dy != 0) || (w != ewin->w) || (h != ewin->h))
- change = 1;
- ewin->x = x;
- ewin->y = y;
- ewin->reqx = x;
- ewin->reqy = y;
- ewin->client.w = w;
- ewin->client.h = h;
- ICCCM_MatchSize(ewin);
-
- if (!ewin->shaded)
- {
- ewin->w =
- ewin->client.w + ewin->border->border.left +
- ewin->border->border.right;
- ewin->h =
- ewin->client.h + ewin->border->border.top +
- ewin->border->border.bottom;
- }
-
- EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h);
+ if (!ewin)
+ return;
DetermineEwinArea(ewin);
- if ((mode.mode != MODE_MOVE_PENDING && mode.mode != MODE_MOVE)
- || (mode.have_place_grab))
- ICCCM_Configure(ewin);
-
- CalcEwinSizes(ewin);
- if (ewin->has_transients)
- {
- EWin **lst;
- int i, num;
-
- lst = ListTransientsFor(ewin->client.win, &num);
- if (lst)
- {
- for (i = 0; i < num; i++)
- {
- if (!((mode.flipp) && (lst[i]->floating))
- && (lst[i]->client.mwm_decor_border
- || lst[i]->client.mwm_decor_resizeh
- || lst[i]->client.mwm_decor_title
- || lst[i]->client.mwm_decor_menu
- || lst[i]->client.mwm_decor_minimize
- || lst[i]->client.mwm_decor_maximize))
- MoveEwin(lst[i], lst[i]->x + dx, lst[i]->y + dy);
- }
- Efree(lst);
- }
- }
-
- if ((mode.mode == MODE_NONE) && (change))
- {
- if (ewin->dialog)
- DialogMove(ewin->dialog);
- else if (ewin->menu)
- MenuMove(ewin->menu);
-
- PagerEwinOutsideAreaUpdate(ewin);
- ForceUpdatePagersForDesktop(ewin->desktop);
- }
- if (ewin->pager)
- PagerResize(ewin->pager, ewin->client.w, ewin->client.h);
- else if (ewin->ibox)
- IconboxResize(ewin->ibox, ewin->client.w, ewin->client.h);
+ if (ewin->MoveResize)
+ ewin->MoveResize(ewin, resize);
- call_depth--;
- EDBUG_RETURN_;
+ PagerEwinOutsideAreaUpdate(ewin);
+ ForceUpdatePagersForDesktop(ewin->desktop);
}
-#else
-
#define MR_FLAGS_MOVE 1
#define MR_FLAGS_RESIZE 2
@@ -1991,8 +1806,6 @@
doMoveResizeEwin(ewin, x, y, w, h, MR_FLAGS_MOVE | MR_FLAGS_RESIZE);
}
-#endif
-
#if 0 /* Unused */
void
FloatEwin(EWin * ewin)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -3 -r1.66 -r1.67
--- desktops.c 28 Feb 2004 15:13:59 -0000 1.66
+++ desktops.c 1 Mar 2004 21:03:53 -0000 1.67
@@ -1306,11 +1306,11 @@
}
ActionsResume();
+ FocusNewDesk();
if (mode.mode == MODE_DESKSWITCH)
mode.mode = MODE_NONE;
- FocusNewDesk();
RedrawPagersForDesktop(pdesk, 0);
RedrawPagersForDesktop(num, 3);
ForceUpdatePagersForDesktop(num);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/dialog.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -3 -r1.77 -r1.78
--- dialog.c 28 Feb 2004 15:13:59 -0000 1.77
+++ dialog.c 1 Mar 2004 21:03:53 -0000 1.78
@@ -565,13 +565,24 @@
DialogDraw(d);
}
-void
-DialogMove(Dialog * d)
+static void
+DialogMoveResize(EWin * ewin, int resize)
{
+ Dialog *d = ewin->dialog;
+
+ if (!d)
+ return;
+
if (conf.theme.transparency || IclassIsTransparent(d->iclass))
DialogRedraw(d);
}
+static void
+DialogRefresh(EWin * ewin)
+{
+ DialogMoveResize(ewin, 0);
+}
+
void
ShowDialog(Dialog * d)
{
@@ -595,6 +606,7 @@
XSetClassHint(disp, d->win, xch);
XFree(xch);
}
+
ewin = FindEwinByDialog(d);
if (ewin)
{
@@ -604,6 +616,7 @@
ShowEwin(ewin);
return;
}
+
if (d->item)
DialogItemsRealize(d);
@@ -678,9 +691,13 @@
RestackEwin(ewin);
ShowEwin(ewin);
ewin->dialog = d;
+ ewin->MoveResize = DialogMoveResize;
+ ewin->Refresh = DialogRefresh;
}
+
if (!FindDialog(d->win))
AddItem(d, d->name, d->win, LIST_TYPE_DIALOG);
+
XSync(disp, False);
DialogRedraw(d);
queue_up = pq;
@@ -2267,18 +2284,18 @@
DItem *di;
int x, y, w, h;
- d = FindDialogButton(win, &bnum);
+ d = FindDialog(win);
if (d)
{
- DialogDrawButton(d, bnum);
+ DialogDrawArea(d, ev->xexpose.x, ev->xexpose.y,
+ ev->xexpose.width, ev->xexpose.height);
goto exit;
}
- d = FindDialog(win);
+ d = FindDialogButton(win, &bnum);
if (d)
{
- DialogDrawArea(d, ev->xexpose.x, ev->xexpose.y,
- ev->xexpose.width, ev->xexpose.height);
+ DialogDrawButton(d, bnum);
goto exit;
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/evhandlers.c,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -3 -r1.152 -r1.153
--- evhandlers.c 29 Feb 2004 01:30:17 -0000 1.152
+++ evhandlers.c 1 Mar 2004 21:03:53 -0000 1.153
@@ -672,14 +672,12 @@
void
HandleExpose(XEvent * ev)
{
- Window win;
+ Window win = ev->xexpose.window;
EWin **ewin;
int i, j, num;
EDBUG(5, "HandleExpose");
- win = ev->xexpose.window;
-
ewin = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
for (i = 0; i < num; i++)
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- focus.c 29 Feb 2004 01:30:17 -0000 1.52
+++ focus.c 1 Mar 2004 21:03:53 -0000 1.53
@@ -339,10 +339,12 @@
for (i = 0; i < num; i++)
{
ewin = lst[i];
+
XSelectInput(disp, ewin->win,
FocusChangeMask | SubstructureNotifyMask |
SubstructureRedirectMask | PropertyChangeMask |
ResizeRedirectMask);
+
if (ewin->pager)
{
#if 0
@@ -363,6 +365,7 @@
PropertyChangeMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask);
+
for (j = 0; j < ewin->border->num_winparts; j++)
{
if (ewin->border->part[j].flags & FLAG_TITLE)
@@ -401,12 +404,14 @@
for (i = 0; i < num; i++)
{
ewin = lst[i];
+
XSelectInput(disp, ewin->win,
FocusChangeMask | SubstructureNotifyMask |
SubstructureRedirectMask | EnterWindowMask |
LeaveWindowMask | PointerMotionMask |
PropertyChangeMask | ResizeRedirectMask |
ButtonPressMask | ButtonReleaseMask);
+
if (ewin->pager)
XSelectInput(disp, ewin->client.win,
PropertyChangeMask | EnterWindowMask |
@@ -426,6 +431,7 @@
LeaveWindowMask | FocusChangeMask |
ResizeRedirectMask | StructureNotifyMask |
ColormapChangeMask);
+
for (j = 0; j < ewin->border->num_winparts; j++)
{
if (ewin->border->part[j].flags & FLAG_TITLE)
@@ -441,6 +447,9 @@
EnterWindowMask | LeaveWindowMask |
PointerMotionMask);
}
+
+ if (mode.mode == MODE_DESKSWITCH)
+ EwinRefresh(ewin);
}
Efree(lst);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -3 -r1.89 -r1.90
--- iconify.c 29 Feb 2004 01:30:17 -0000 1.89
+++ iconify.c 1 Mar 2004 21:03:53 -0000 1.90
@@ -24,7 +24,7 @@
#include "E.h"
#include <math.h>
-static void IcondefChecker(int val, void *data);
+static void IconboxRedraw(Iconbox * ib);
#define IB_ANIM_TIME 0.25
@@ -522,6 +522,42 @@
ICCCM_MatchSize(ewin);
}
+static void
+IconboxMoveResize(EWin * ewin, int resize)
+{
+ static int call_depth = 0; /* Ugly! */
+ Iconbox *ib = ewin->ibox;
+
+ if (!ib || call_depth > 0)
+ return;
+ call_depth++;
+
+ if (!conf.theme.transparency &&
+ ib->w == ewin->client.w && ib->h == ewin->client.h)
+ return;
+
+ ib->w = ewin->client.w;
+ ib->h = ewin->client.h;
+ ib->force_update = 1;
+ IconboxRedraw(ib);
+ call_depth--;
+}
+
+static void
+IconboxRefresh(EWin * ewin)
+{
+ Iconbox *ib = ewin->ibox;
+
+ if (!ib)
+ return;
+
+ if (!conf.theme.transparency)
+ return;
+
+ ib->force_update = 1;
+ IconboxRedraw(ib);
+}
+
void
IconboxShow(Iconbox * ib)
{
@@ -551,6 +587,9 @@
ib->ewin = ewin;
ewin->ibox = ib;
+ ewin->MoveResize = IconboxMoveResize;
+ ewin->Refresh = IconboxRefresh;
+
IB_Reconfigure(ib);
sn = FindSnapshot(ewin);
ConformEwinToDesktop(ewin);
@@ -1897,7 +1936,7 @@
}
-void
+static void
IconboxRedraw(Iconbox * ib)
{
Pixmap m = 0;
@@ -2157,18 +2196,6 @@
queue_up = pq;
}
-void
-IconboxResize(Iconbox * ib, int w, int h)
-{
- if ((ib->w == w) && (ib->h == h))
- return;
-
- ib->w = w;
- ib->h = h;
- ib->force_update = 1;
- IconboxRedraw(ib);
-}
-
static void
IB_Scroll(Iconbox * ib, int dir)
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -3 -r1.105 -r1.106
--- menus.c 29 Feb 2004 01:30:17 -0000 1.105
+++ menus.c 1 Mar 2004 21:03:53 -0000 1.106
@@ -134,6 +134,24 @@
EDBUG_RETURN_;
}
+static void
+MenuMoveResize(EWin * ewin, int resize)
+{
+ Menu *m = ewin->menu;
+
+ if (!m)
+ return;
+
+ if (conf.theme.transparency || IclassIsTransparent(m->style->bg_iclass))
+ MenuRealize(m);
+}
+
+static void
+MenuRefresh(EWin * ewin)
+{
+ MenuMoveResize(ewin, 0);
+}
+
void
MenuShow(Menu * m, char noshow)
{
@@ -304,6 +322,8 @@
UnShadeEwin(ewin);
}
ewin->menu = m;
+ ewin->MoveResize = MenuMoveResize;
+ ewin->Refresh = MenuRefresh;
}
m->stuck = 0;
@@ -552,13 +572,6 @@
}
void
-MenuMove(Menu * m)
-{
- if (conf.theme.transparency || IclassIsTransparent(m->style->bg_iclass))
- MenuRealize(m);
-}
-
-void
MenuAddItem(Menu * menu, MenuItem * item)
{
EDBUG(5, "MenuAddItem");
@@ -1768,7 +1781,7 @@
MenuItem *mi;
- EDBUG(5, "MenuCreateFromEWins");
+ EDBUG(5, "MenuCreateFromDesktopEWins");
m = MenuCreate(name);
m->style = ms;
@@ -1805,7 +1818,7 @@
MenuItem *mi;
- EDBUG(5, "MenuCreateFromEWins");
+ EDBUG(5, "MenuCreateFromDesktops");
m = MenuCreate(name);
m->style = ms;
lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/pager.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -3 -r1.70 -r1.71
--- pager.c 29 Feb 2004 01:30:17 -0000 1.70
+++ pager.c 1 Mar 2004 21:03:54 -0000 1.71
@@ -217,15 +217,20 @@
return p;
}
-void
-PagerResize(Pager * p, int w, int h)
+static void
+PagerMoveResize(EWin * ewin, int resize)
{
+ Pager *p = ewin->pager;
+ int w, h;
int ax, ay, i, cx, cy;
char pq;
ImageClass *ic;
- if (!conf.pagers.enable)
+ if (!conf.pagers.enable || !p)
return;
+
+ w = ewin->client.w;
+ h = ewin->client.h;
if ((w == p->w) && (h == p->h))
return;
@@ -270,6 +275,11 @@
PagerEwinUpdateMini(p, desks.desk[p->desktop].list[i]);
}
+static void
+PagerRefresh(EWin * ewin)
+{
+}
+
void
PagerShow(Pager * p)
{
@@ -317,6 +327,9 @@
ewin->client.width.max = 320 * ax;
ewin->client.height.max = 240 * ay;
ewin->pager = p;
+ ewin->MoveResize = PagerMoveResize;
+ ewin->Refresh = PagerRefresh;
+
p->ewin = ewin;
p->visible = 1;
sn = FindSnapshot(ewin);
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs