Rewrap stuff related to WM_NAME/CLASS.
SVN revision: 27211
This commit is contained in:
parent
4a7de05d41
commit
a2594a1e81
|
@ -217,7 +217,7 @@ ButtonDestroy(Button * b)
|
|||
static int
|
||||
_ButtonMatchName(const void *data, const void *match)
|
||||
{
|
||||
return strcmp(((const Button *)data)->o.name, match);
|
||||
return strcmp(EoGetName((const Button *)data), match);
|
||||
}
|
||||
|
||||
Button *
|
||||
|
|
|
@ -769,6 +769,40 @@ ecore_x_icccm_title_get(Ecore_X_Window win)
|
|||
return ecore_x_window_prop_string_get(win, ECORE_X_ATOM_WM_NAME);
|
||||
}
|
||||
|
||||
void
|
||||
ecore_x_icccm_name_class_set(Ecore_X_Window win, const char *name,
|
||||
const char *clss)
|
||||
{
|
||||
XClassHint *xch;
|
||||
|
||||
xch = XAllocClassHint();
|
||||
if (!xch)
|
||||
return;
|
||||
xch->res_name = (char *)name;
|
||||
xch->res_class = (char *)clss;
|
||||
XSetClassHint(_ecore_x_disp, win, xch);
|
||||
XFree(xch);
|
||||
}
|
||||
|
||||
void
|
||||
ecore_x_icccm_name_class_get(Ecore_X_Window win, char **name, char **clss)
|
||||
{
|
||||
XClassHint xch;
|
||||
|
||||
*name = *clss = NULL;
|
||||
xch.res_name = NULL;
|
||||
xch.res_class = NULL;
|
||||
if (XGetClassHint(_ecore_x_disp, win, &xch))
|
||||
{
|
||||
if (name && xch.res_name)
|
||||
*name = strdup(xch.res_name);
|
||||
if (clss && xch.res_class)
|
||||
*clss = strdup(xch.res_class);
|
||||
XFree(xch.res_name);
|
||||
XFree(xch.res_class);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* USE_ECORE_X */
|
||||
|
||||
#ifndef USE_ECORE_X
|
||||
|
|
|
@ -141,6 +141,11 @@ void ecore_x_icccm_take_focus_send(Ecore_X_Window win,
|
|||
void ecore_x_icccm_title_set(Ecore_X_Window win,
|
||||
const char *title);
|
||||
char *ecore_x_icccm_title_get(Ecore_X_Window win);
|
||||
void ecore_x_icccm_name_class_set(Ecore_X_Window win,
|
||||
const char *name,
|
||||
const char *clss);
|
||||
void ecore_x_icccm_name_class_get(Ecore_X_Window win,
|
||||
char **name, char **clss);
|
||||
|
||||
/* NETWM (EWMH) */
|
||||
extern Ecore_X_Atom ECORE_X_ATOM_NET_SUPPORTED;
|
||||
|
|
|
@ -1722,7 +1722,8 @@ ECompMgrWinDumpInfo(const char *txt, EObj * eo, XserverRegion rgn, int force)
|
|||
ECmWinInfo *cw = eo->cmhook;
|
||||
|
||||
Eprintf("%s %#lx: %d,%d %dx%d: %s\n", txt, EobjGetXwin(eo),
|
||||
EobjGetX(eo), EobjGetY(eo), EobjGetW(eo), EobjGetH(eo), eo->name);
|
||||
EobjGetX(eo), EobjGetY(eo), EobjGetW(eo), EobjGetH(eo),
|
||||
EobjGetName(eo));
|
||||
if (!cw)
|
||||
{
|
||||
Eprintf("Not managed\n");
|
||||
|
@ -1877,7 +1878,7 @@ ECompMgrDetermineOrder(EObj * const *lst, int num, EObj ** first,
|
|||
case WINDOW_SOLID:
|
||||
D4printf("- clip %#lx %#lx %d,%d %dx%d: %s\n", EobjGetXwin(eo),
|
||||
cw->clip, EobjGetX(eo), EobjGetY(eo), EobjGetW(eo),
|
||||
EobjGetH(eo), eo->name);
|
||||
EobjGetH(eo), EobjGetName(eo));
|
||||
#if USE_CLIP_RELATIVE_TO_DESK
|
||||
ERegionUnionOffset(clip, 0, 0, cw->shape);
|
||||
#else
|
||||
|
@ -1888,7 +1889,7 @@ ECompMgrDetermineOrder(EObj * const *lst, int num, EObj ** first,
|
|||
default:
|
||||
D4printf("- noclip %#lx %#lx %d,%d %dx%d: %s\n", EobjGetXwin(eo),
|
||||
cw->clip, EobjGetX(eo), EobjGetY(eo), EobjGetW(eo),
|
||||
EobjGetH(eo), eo->name);
|
||||
EobjGetH(eo), EobjGetName(eo));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
11
src/eobj.c
11
src/eobj.c
|
@ -210,14 +210,14 @@ EobjInit(EObj * eo, int type, Win win, int x, int y, int w, int h,
|
|||
EobjListStackAdd(eo, 1);
|
||||
|
||||
if (EDebug(EDBUG_TYPE_EWINS))
|
||||
Eprintf("EobjInit: %#lx %s\n", EobjGetXwin(eo), eo->name);
|
||||
Eprintf("EobjInit: %#lx %s\n", EobjGetXwin(eo), EobjGetName(eo));
|
||||
}
|
||||
|
||||
void
|
||||
EobjFini(EObj * eo)
|
||||
{
|
||||
if (EDebug(EDBUG_TYPE_EWINS))
|
||||
Eprintf("EobjFini: %#lx %s\n", EobjGetXwin(eo), eo->name);
|
||||
Eprintf("EobjFini: %#lx %s\n", EobjGetXwin(eo), EobjGetName(eo));
|
||||
|
||||
EobjListStackDel(eo);
|
||||
|
||||
|
@ -242,7 +242,7 @@ void
|
|||
EobjDestroy(EObj * eo)
|
||||
{
|
||||
if (EDebug(EDBUG_TYPE_EWINS))
|
||||
Eprintf("EobjDestroy: %#lx %s\n", EobjGetXwin(eo), eo->name);
|
||||
Eprintf("EobjDestroy: %#lx %s\n", EobjGetXwin(eo), EobjGetName(eo));
|
||||
|
||||
EobjFini(eo);
|
||||
|
||||
|
@ -316,7 +316,7 @@ EobjRegister(Window xwin, int type)
|
|||
#endif
|
||||
#if 0
|
||||
Eprintf("EobjRegister: %#lx type=%d or=%d: %s\n", xwin, type,
|
||||
attr.override_redirect, eo->name);
|
||||
attr.override_redirect, EobjGetName(eo));
|
||||
#endif
|
||||
|
||||
return eo;
|
||||
|
@ -326,7 +326,8 @@ void
|
|||
EobjUnregister(EObj * eo)
|
||||
{
|
||||
#if 0
|
||||
Eprintf("EobjUnregister: %#lx type=%d: %s\n", eo->win, eo->type, eo->name);
|
||||
Eprintf("EobjUnregister: %#lx type=%d: %s\n", eo->win, eo->type,
|
||||
EobjGetName(eo));
|
||||
#endif
|
||||
EobjDestroy(eo);
|
||||
}
|
||||
|
|
|
@ -168,18 +168,12 @@ HintsSetWindowName(Win win, const char *name)
|
|||
void
|
||||
HintsSetWindowClass(Win win, const char *name, const char *clss)
|
||||
{
|
||||
XClassHint *xch;
|
||||
|
||||
if (!name)
|
||||
name = "NoName";
|
||||
if (!clss)
|
||||
clss = "NoClass";
|
||||
|
||||
xch = XAllocClassHint();
|
||||
xch->res_name = (char *)name;
|
||||
xch->res_class = (char *)clss;
|
||||
XSetClassHint(disp, WinGetXwin(win), xch);
|
||||
XFree(xch);
|
||||
ecore_x_icccm_name_class_set(WinGetXwin(win), name, clss);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
17
src/icccm.c
17
src/icccm.c
|
@ -537,19 +537,16 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
{
|
||||
if (atom_change == 0 || atom_change == ECORE_X_ATOM_WM_CLASS)
|
||||
{
|
||||
XClassHint hint;
|
||||
|
||||
_EFREE(ewin->icccm.wm_res_name);
|
||||
_EFREE(ewin->icccm.wm_res_class);
|
||||
|
||||
if (XGetClassHint(disp, EwinGetClientXwin(ewin), &hint) ||
|
||||
(TryGroup(ewin) && XGetClassHint(disp, ewin->icccm.group, &hint)))
|
||||
{
|
||||
ewin->icccm.wm_res_name = Estrdup(hint.res_name);
|
||||
ewin->icccm.wm_res_class = Estrdup(hint.res_class);
|
||||
XFree(hint.res_name);
|
||||
XFree(hint.res_class);
|
||||
}
|
||||
ecore_x_icccm_name_class_get(EwinGetClientXwin(ewin),
|
||||
&ewin->icccm.wm_res_name,
|
||||
&ewin->icccm.wm_res_class);
|
||||
if (!ewin->icccm.wm_res_name && TryGroup(ewin))
|
||||
ecore_x_icccm_name_class_get(ewin->icccm.group,
|
||||
&ewin->icccm.wm_res_name,
|
||||
&ewin->icccm.wm_res_class);
|
||||
}
|
||||
|
||||
if (atom_change == 0 || atom_change == ECORE_X_ATOM_WM_COMMAND)
|
||||
|
|
|
@ -573,10 +573,7 @@ IpcWinop(const WinOp * wop, EWin * ewin, const char *prm)
|
|||
IpcPrintf("title: %s", ewin->icccm.wm_name);
|
||||
goto done;
|
||||
}
|
||||
_EFREE(ewin->icccm.wm_name);
|
||||
ewin->icccm.wm_name = Estrdup(prm);
|
||||
XStoreName(disp, EwinGetClientXwin(ewin), ewin->icccm.wm_name);
|
||||
EwinBorderUpdateInfo(ewin);
|
||||
HintsSetWindowName(EwinGetClientWin(ewin), prm);
|
||||
break;
|
||||
|
||||
case EWIN_OP_CLOSE:
|
||||
|
@ -1275,7 +1272,7 @@ IPC_ObjInfo(const char *params __UNUSED__, Client * c __UNUSED__)
|
|||
#else
|
||||
0, 0
|
||||
#endif
|
||||
, eo->name);
|
||||
, EobjGetName(eo));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -204,7 +204,7 @@ ProgressbarShow(Progressbar * p)
|
|||
EobjMap(p->p_win, 0);
|
||||
|
||||
pad = ImageclassGetPadding(p->inc);
|
||||
TextDraw(p->tc, p->win->win, None, 0, 0, STATE_NORMAL, p->win->name,
|
||||
TextDraw(p->tc, p->win->win, None, 0, 0, STATE_NORMAL, EobjGetName(p->win),
|
||||
pad->left, pad->top, p->w - (p->h * 5) - (pad->left + pad->right),
|
||||
p->h - (pad->top + pad->bottom), p->h - (pad->top + pad->bottom),
|
||||
TextclassGetJustification(p->tnc));
|
||||
|
|
|
@ -59,7 +59,7 @@ EobjListShow(const char *txt, EobjList * ewl)
|
|||
{
|
||||
eo = ewl->list[i];
|
||||
Eprintf(" %2d: %#10lx %#10lx %d %d %s\n", i, EobjGetXwin(eo),
|
||||
EobjGetCwin(eo), eo->desk->num, eo->ilayer, eo->name);
|
||||
EobjGetCwin(eo), eo->desk->num, eo->ilayer, EobjGetName(eo));
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue