Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: container.c dialog.c e16-ecore_hints.c ewins.c ewins.h hints.c ipc.c magwin.c menus.c pager.c settings.c Log Message: Fix several issues around setting internal window title/class. =================================================================== RCS file: /cvs/e/e16/e/src/container.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- container.c 18 May 2007 08:25:02 -0000 1.12 +++ container.c 18 May 2007 21:18:24 -0000 1.13 @@ -242,6 +242,11 @@ static void _ContainerEwinInit(EWin * ewin) { + Container *ct = (Container *) ewin->data; + + EwinSetTitle(ewin, ct->wm_name); + EwinSetClass(ewin, ct->name, "Enlightenment_IconBox"); + ewin->props.skip_ext_task = 1; ewin->props.skip_ext_pager = 1; ewin->props.skip_focuslist = 1; @@ -301,9 +306,6 @@ if (!ct) return; - - HintsSetWindowName(ct->win, ct->wm_name); - HintsSetWindowClass(ct->win, ct->name, "Enlightenment_IconBox"); ewin = AddInternalToFamily(ct->win, "ICONBOX", EWIN_TYPE_ICONBOX, &_ContainerEwinOps, ct); =================================================================== RCS file: /cvs/e/e16/e/src/dialog.c,v retrieving revision 1.184 retrieving revision 1.185 diff -u -3 -r1.184 -r1.185 --- dialog.c 7 Apr 2007 16:18:53 -0000 1.184 +++ dialog.c 18 May 2007 21:18:24 -0000 1.185 @@ -190,6 +190,7 @@ char update; char resize; char close; + char set_title; int xu1, yu1, xu2, yu2; }; @@ -309,7 +310,7 @@ if (d->title) Efree(d->title); d->title = Estrdup(title); - HintsSetWindowName(d->win, d->title); + d->set_title = 1; } void @@ -507,6 +508,12 @@ static void _DialogEwinInit(EWin * ewin) { + Dialog *d = (Dialog *) ewin->data; + + EwinSetTitle(ewin, d->title); + EwinSetClass(ewin, d->name, "Enlightenment_Dialog"); + d->set_title = 0; + ewin->props.focus_when_mapped = 1; EoSetLayer(ewin, 10); @@ -545,6 +552,12 @@ if (resize) DialogItemsRealize(d); + if (d->set_title) + { + EwinSetTitle(d->ewin, d->title); + d->set_title = 0; + } + ICCCM_SetSizeConstraints(d->ewin, d->w, d->h, d->w, d->h, 0, 0, 1, 1, 0.0, 65535.0); @@ -577,8 +590,6 @@ } DialogItemsRealize(d); - - HintsSetWindowClass(d->win, d->name, "Enlightenment_Dialog"); ewin = AddInternalToFamily(d->win, "DIALOG", EWIN_TYPE_DIALOG, &_DialogEwinOps, d); =================================================================== RCS file: /cvs/e/e16/e/src/e16-ecore_hints.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -3 -r1.9 -r1.10 --- e16-ecore_hints.c 17 Apr 2007 21:20:34 -0000 1.9 +++ e16-ecore_hints.c 18 May 2007 21:18:24 -0000 1.10 @@ -224,8 +224,8 @@ { XTextProperty xtp; - if (XmbTextListToTextProperty(_ecore_x_disp, (char **)lst, num, - XStringStyle, &xtp) != Success) + if (XmbTextListToTextProperty(_ecore_x_disp, lst, num, + XStdICCTextStyle, &xtp) != Success) return; XSetTextProperty(_ecore_x_disp, win, &xtp, atom); XFree(xtp.value); =================================================================== RCS file: /cvs/e/e16/e/src/ewins.c,v retrieving revision 1.196 retrieving revision 1.197 diff -u -3 -r1.196 -r1.197 --- ewins.c 16 Apr 2007 20:31:33 -0000 1.196 +++ ewins.c 18 May 2007 21:18:24 -0000 1.197 @@ -183,20 +183,12 @@ Eprintf("EwinGetHints %#lx\n", EwinGetClientXwin(ewin)); ICCCM_GetTitle(ewin); - if (EwinIsInternal(ewin)) - { - /* FIXME - This should not be needed */ - ICCCM_GetInfo(ewin); - } - else - { - ICCCM_GetHints(ewin); - ICCCM_GetGeoms(ewin); - MWM_GetHints(ewin, 0); - ICCCM_GetInfo(ewin); /* NB! Need group info first */ - HintsGetWindowHints(ewin); - SessionGetInfo(ewin); - } + ICCCM_GetHints(ewin); + ICCCM_GetGeoms(ewin); + MWM_GetHints(ewin, 0); + ICCCM_GetInfo(ewin); /* NB! Need group info first */ + HintsGetWindowHints(ewin); + SessionGetInfo(ewin); } static void @@ -968,7 +960,6 @@ goto done; EwinGetAttributes(ewin, win, None); - EwinGetHints(ewin); EwinManage(ewin); ewin->data = ptr; @@ -1324,6 +1315,9 @@ static void EwinEventPropertyNotify(EWin * ewin, XEvent * ev) { + if (EwinIsInternal(ewin)) + return; + EGrabServer(); EwinChangesStart(ewin); @@ -1479,6 +1473,9 @@ if (ewin->ops && ewin->ops->Close) ewin->ops->Close(ewin); + ESelectInput(EwinGetClientWin(ewin), NoEventMask); + XShapeSelectInput(disp, EwinGetClientXwin(ewin), NoEventMask); + EwinDestroy(ewin); } @@ -1497,6 +1494,24 @@ EwinDestroy(ewin); #endif +} + +void +EwinSetTitle(EWin * ewin, const char *title) +{ + HintsSetWindowName(EwinGetClientWin(ewin), title); + + _EFDUP(ewin->o.icccm.wm_name, title); + _EFDUP(ewin->ewmh.wm_name, title); +} + +void +EwinSetClass(EWin * ewin, const char *name, const char *clss) +{ + HintsSetWindowClass(EwinGetClientWin(ewin), name, clss); + + _EFDUP(ewin->o.icccm.wm_res_name, name); + _EFDUP(ewin->o.icccm.wm_res_class, clss); } const char * =================================================================== RCS file: /cvs/e/e16/e/src/ewins.h,v retrieving revision 1.73 retrieving revision 1.74 diff -u -3 -r1.73 -r1.74 --- ewins.h 17 Apr 2007 21:20:34 -0000 1.73 +++ ewins.h 18 May 2007 21:18:24 -0000 1.74 @@ -369,6 +369,9 @@ EWin *AddInternalToFamily(Win win, const char *bname, int type, const EWinOps * ops, void *ptr); void EwinReparent(EWin * ewin, Win parent); +void EwinSetTitle(EWin * ewin, const char *title); +void EwinSetClass(EWin * ewin, const char *name, + const char *clss); const char *EwinGetTitle(const EWin * ewin); const char *EwinGetIconName(const EWin * ewin); const char *EwinBorderGetName(const EWin * ewin); =================================================================== RCS file: /cvs/e/e16/e/src/hints.c,v retrieving revision 1.83 retrieving revision 1.84 diff -u -3 -r1.83 -r1.84 --- hints.c 16 Apr 2007 16:48:46 -0000 1.83 +++ hints.c 18 May 2007 21:18:24 -0000 1.84 @@ -159,7 +159,7 @@ HintsSetWindowName(Win win, const char *name) { if (!name) - name = "NoTitle"; + return; ecore_x_icccm_title_set(WinGetXwin(win), name); =================================================================== RCS file: /cvs/e/e16/e/src/ipc.c,v retrieving revision 1.300 retrieving revision 1.301 diff -u -3 -r1.300 -r1.301 --- ipc.c 18 May 2007 08:25:02 -0000 1.300 +++ ipc.c 18 May 2007 21:18:24 -0000 1.301 @@ -1028,6 +1028,7 @@ EwinBorderGetSize(ewin, &bl, &br, &bt, &bb); IpcPrintf("WM_NAME %s\n" + "_NET_WM_NAME %s\n" "WM_ICON_NAME %s\n" "WM_CLASS name.class %s.%s\n" "WM_WINDOW_ROLE %s\n" @@ -1062,6 +1063,7 @@ #endif , SS(EwinGetIcccmName(ewin)), + SS(ewin->ewmh.wm_name), SS(ewin->icccm.wm_icon_name), SS(EwinGetIcccmCName(ewin)), SS(EwinGetIcccmClass(ewin)), SS(ewin->icccm.wm_role), =================================================================== RCS file: /cvs/e/e16/e/src/magwin.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- magwin.c 18 May 2007 08:25:02 -0000 1.3 +++ magwin.c 18 May 2007 21:18:24 -0000 1.4 @@ -46,6 +46,7 @@ typedef struct { EWin *ewin; + const char *title; EImage *im; int cx, cy; /* Center */ int scale; /* Zoom level */ @@ -345,6 +346,11 @@ static void _MagEwinInit(EWin * ewin) { + MagWindow *mw = (MagWindow *) ewin->data; + + EwinSetTitle(ewin, mw->title); + EwinSetClass(ewin, "Magnifier", "Enlightenment_Magnifier"); + EoSetSticky(ewin, 1); EoSetShadow(ewin, 0); } @@ -384,9 +390,7 @@ win = ECreateClientWindow(VRoot.win, x, y, w, h); - HintsSetWindowName(win, title); - HintsSetWindowClass(win, "Magnifier", "Enlightenment_Magnifier"); - + mw->title = title; mw->ewin = AddInternalToFamily(win, NULL, EWIN_TYPE_MISC, &_MagEwinOps, mw); if (!mw->ewin) { =================================================================== RCS file: /cvs/e/e16/e/src/menus.c,v retrieving revision 1.274 retrieving revision 1.275 diff -u -3 -r1.274 -r1.275 --- menus.c 18 May 2007 08:25:05 -0000 1.274 +++ menus.c 18 May 2007 21:18:24 -0000 1.275 @@ -199,6 +199,9 @@ { Menu *m = (Menu *) ewin->data; + EwinSetTitle(ewin, _(m->title)); + EwinSetClass(ewin, m->name, "Enlightenment_Menu"); + ewin->props.skip_ext_task = 1; ewin->props.skip_ext_pager = 1; ewin->props.no_actions = 1; @@ -663,9 +666,6 @@ { m->win = ECreateClientWindow(VRoot.win, 0, 0, 1, 1); EventCallbackRegister(m->win, 0, MenuHandleEvents, m); - if (m->title) - HintsSetWindowName(m->win, _(m->title)); - HintsSetWindowClass(m->win, m->name, "Enlightenment_Menu"); } maxh = maxw = 0; =================================================================== RCS file: /cvs/e/e16/e/src/pager.c,v retrieving revision 1.241 retrieving revision 1.242 diff -u -3 -r1.241 -r1.242 --- pager.c 18 May 2007 08:25:05 -0000 1.241 +++ pager.c 18 May 2007 21:18:24 -0000 1.242 @@ -644,6 +644,14 @@ static void _PagerEwinInit(EWin * ewin) { + Pager *p = (Pager *) ewin->data; + char s[128]; + + Esnprintf(s, sizeof(s), "Pager-%i", p->dsk->num); + EwinSetTitle(ewin, s); + Esnprintf(s, sizeof(s), "%i", p->dsk->num); + EwinSetClass(ewin, s, "Enlightenment_Menu"); + ewin->props.skip_ext_task = 1; ewin->props.skip_ext_pager = 1; ewin->props.skip_focuslist = 1; @@ -716,8 +724,7 @@ static void PagerShow(Pager * p) { - EWin *ewin = NULL; - char s[128]; + EWin *ewin; int w, h; if (!Conf_pagers.enable) @@ -728,11 +735,6 @@ EwinShow(p->ewin); return; } - - Esnprintf(s, sizeof(s), "Pager-%i", p->dsk->num); - HintsSetWindowName(p->win, s); - Esnprintf(s, sizeof(s), "%i", p->dsk->num); - HintsSetWindowClass(p->win, s, "Enlightenment_Pager"); ewin = AddInternalToFamily(p->win, "PAGER", EWIN_TYPE_PAGER, &_PagerEwinOps, p); =================================================================== RCS file: /cvs/e/e16/e/src/settings.c,v retrieving revision 1.166 retrieving revision 1.167 diff -u -3 -r1.166 -r1.167 --- settings.c 15 Feb 2007 01:00:09 -0000 1.166 +++ settings.c 18 May 2007 21:18:24 -0000 1.167 @@ -547,8 +547,6 @@ static cfg_composite Cfg_composite; DItem *di, *radio; - DialogSetTitle(d, _("Composite Settings")); - /* Get current settings */ ECompMgrConfigGet(&Cfg_composite); DialogSetData(d, &Cfg_composite); ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs