Fix several issues around setting internal window title/class.
SVN revision: 30022
This commit is contained in:
parent
9474487a7f
commit
9d9e4686e7
|
@ -242,6 +242,11 @@ ContainerReconfigure(Container * ct)
|
|||
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;
|
||||
|
@ -302,9 +307,6 @@ ContainerShow(Container * ct)
|
|||
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);
|
||||
ct->ewin = ewin;
|
||||
|
|
17
src/dialog.c
17
src/dialog.c
|
@ -190,6 +190,7 @@ struct _dialog
|
|||
char update;
|
||||
char resize;
|
||||
char close;
|
||||
char set_title;
|
||||
int xu1, yu1, xu2, yu2;
|
||||
};
|
||||
|
||||
|
@ -309,7 +310,7 @@ DialogSetTitle(Dialog * d, const char *title)
|
|||
if (d->title)
|
||||
Efree(d->title);
|
||||
d->title = Estrdup(title);
|
||||
HintsSetWindowName(d->win, d->title);
|
||||
d->set_title = 1;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -507,6 +508,12 @@ DialogRedraw(Dialog * d)
|
|||
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 @@ DialogArrange(Dialog * d, int resize)
|
|||
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);
|
||||
|
||||
|
@ -578,8 +591,6 @@ DialogShowArranged(Dialog * d, int center)
|
|||
|
||||
DialogItemsRealize(d);
|
||||
|
||||
HintsSetWindowClass(d->win, d->name, "Enlightenment_Dialog");
|
||||
|
||||
ewin = AddInternalToFamily(d->win, "DIALOG", EWIN_TYPE_DIALOG,
|
||||
&_DialogEwinOps, d);
|
||||
d->ewin = ewin;
|
||||
|
|
|
@ -224,8 +224,8 @@ ecore_x_window_prop_string_list_set(Ecore_X_Window win, Ecore_X_Atom atom,
|
|||
{
|
||||
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);
|
||||
|
|
45
src/ewins.c
45
src/ewins.c
|
@ -183,20 +183,12 @@ EwinGetHints(EWin * ewin)
|
|||
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 @@ AddInternalToFamily(Win win, const char *bname, int type,
|
|||
goto done;
|
||||
|
||||
EwinGetAttributes(ewin, win, None);
|
||||
EwinGetHints(ewin);
|
||||
EwinManage(ewin);
|
||||
|
||||
ewin->data = ptr;
|
||||
|
@ -1324,6 +1315,9 @@ EwinEventCirculateRequest(EWin * ewin, XEvent * ev)
|
|||
static void
|
||||
EwinEventPropertyNotify(EWin * ewin, XEvent * ev)
|
||||
{
|
||||
if (EwinIsInternal(ewin))
|
||||
return;
|
||||
|
||||
EGrabServer();
|
||||
EwinChangesStart(ewin);
|
||||
|
||||
|
@ -1479,6 +1473,9 @@ EwinHide(EWin * ewin)
|
|||
if (ewin->ops && ewin->ops->Close)
|
||||
ewin->ops->Close(ewin);
|
||||
|
||||
ESelectInput(EwinGetClientWin(ewin), NoEventMask);
|
||||
XShapeSelectInput(disp, EwinGetClientXwin(ewin), NoEventMask);
|
||||
|
||||
EwinDestroy(ewin);
|
||||
}
|
||||
|
||||
|
@ -1499,6 +1496,24 @@ EwinKill(EWin * 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 *
|
||||
EwinGetTitle(const EWin * ewin)
|
||||
{
|
||||
|
|
|
@ -369,6 +369,9 @@ void AddToFamily(EWin * ewin, Window win);
|
|||
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);
|
||||
|
|
|
@ -159,7 +159,7 @@ void
|
|||
HintsSetWindowName(Win win, const char *name)
|
||||
{
|
||||
if (!name)
|
||||
name = "NoTitle";
|
||||
return;
|
||||
|
||||
ecore_x_icccm_title_set(WinGetXwin(win), name);
|
||||
|
||||
|
|
|
@ -1028,6 +1028,7 @@ EwinShowInfo(const EWin * ewin)
|
|||
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 @@ EwinShowInfo(const EWin * ewin)
|
|||
#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),
|
||||
|
|
10
src/magwin.c
10
src/magwin.c
|
@ -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 @@ MagwinEvent(Win win __UNUSED__, XEvent * ev, void *prm)
|
|||
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 @@ MagwinCreate(const char *title, int width, int height)
|
|||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -199,6 +199,9 @@ _MenuEwinInit(EWin * ewin)
|
|||
{
|
||||
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 @@ MenuRealize(Menu * m)
|
|||
{
|
||||
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;
|
||||
|
|
16
src/pager.c
16
src/pager.c
|
@ -644,6 +644,14 @@ PagerUpdateBg(Pager * p)
|
|||
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 const EWinOps _PagerEwinOps = {
|
|||
static void
|
||||
PagerShow(Pager * p)
|
||||
{
|
||||
EWin *ewin = NULL;
|
||||
char s[128];
|
||||
EWin *ewin;
|
||||
int w, h;
|
||||
|
||||
if (!Conf_pagers.enable)
|
||||
|
@ -729,11 +736,6 @@ PagerShow(Pager * p)
|
|||
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);
|
||||
p->ewin = ewin;
|
||||
|
|
|
@ -547,8 +547,6 @@ _DlgFillComposite(Dialog * d __UNUSED__, DItem * table, void *data __UNUSED__)
|
|||
static cfg_composite Cfg_composite;
|
||||
DItem *di, *radio;
|
||||
|
||||
DialogSetTitle(d, _("Composite Settings"));
|
||||
|
||||
/* Get current settings */
|
||||
ECompMgrConfigGet(&Cfg_composite);
|
||||
DialogSetData(d, &Cfg_composite);
|
||||
|
|
Loading…
Reference in New Issue