parent
8ea2d33434
commit
bd85fc492e
|
@ -54,7 +54,7 @@ CommsFindCommsWindow()
|
|||
if (s)
|
||||
{
|
||||
comms_win = 0;
|
||||
sscanf((char *)s, "%*s %x", (unsigned int *)&comms_win);
|
||||
sscanf((char *)s, "%*s %lx", &comms_win);
|
||||
XFree(s);
|
||||
}
|
||||
else
|
||||
|
@ -140,7 +140,7 @@ CommsGet(Client ** c, XEvent * ev)
|
|||
s2[i] = ev->xclient.data.b[i];
|
||||
for (i = 0; i < 12; i++)
|
||||
s[i] = ev->xclient.data.b[i + 8];
|
||||
sscanf(s2, "%x", (int *)&win);
|
||||
sscanf(s2, "%lx", &win);
|
||||
cl = (Client *) FindItem(NULL, win, LIST_FINDBY_ID, LIST_TYPE_CLIENT);
|
||||
if (!cl)
|
||||
{
|
||||
|
|
|
@ -332,7 +332,7 @@ cpp_lex(pfile)
|
|||
unsigned width = MAX_CHAR_TYPE_SIZE;
|
||||
int wide_flag = 0;
|
||||
int max_chars;
|
||||
unsigned char *ptr = tok_start;
|
||||
char *ptr = (char*)tok_start;
|
||||
|
||||
#ifdef MULTIBYTE_CHARS
|
||||
char token_buffer[MAX_LONG_TYPE_SIZE /
|
||||
|
@ -360,12 +360,12 @@ cpp_lex(pfile)
|
|||
|
||||
while (1)
|
||||
{
|
||||
if (ptr >= CPP_PWRITTEN(pfile) || (c = *ptr++) == '\'')
|
||||
if (ptr >= (char*)CPP_PWRITTEN(pfile) || (c = *ptr++) == '\'')
|
||||
break;
|
||||
|
||||
if (c == '\\')
|
||||
{
|
||||
c = cpp_parse_escape(pfile, (char **)&ptr);
|
||||
c = cpp_parse_escape(pfile, &ptr);
|
||||
if (width < HOST_BITS_PER_INT
|
||||
&& (unsigned)c >= (unsigned)(1 << width))
|
||||
cpp_pedwarn(pfile,
|
||||
|
|
|
@ -2875,7 +2875,7 @@ doFocusSet(void *params)
|
|||
|
||||
if (!params)
|
||||
EDBUG_RETURN(0);
|
||||
sscanf((char *)params, "%i", (int *)&win);
|
||||
sscanf((char *)params, "%li", &win);
|
||||
ewin = (EWin *) FindItem(NULL, win, LIST_FINDBY_ID, LIST_TYPE_EWIN);
|
||||
if (ewin)
|
||||
{
|
||||
|
|
|
@ -94,7 +94,7 @@ long *
|
|||
getSimpleHint(Window win, Atom atom)
|
||||
{
|
||||
|
||||
long *data = 0;
|
||||
unsigned char *data = NULL;
|
||||
Atom type_ret;
|
||||
int fmt_ret;
|
||||
unsigned long nitems_ret;
|
||||
|
@ -107,7 +107,7 @@ getSimpleHint(Window win, Atom atom)
|
|||
|
||||
if (XGetWindowProperty
|
||||
(disp, win, atom, 0, 1, False, atom, &type_ret, &fmt_ret, &nitems_ret,
|
||||
&bytes_after_ret, (unsigned char **)&data) != Success || !data)
|
||||
&bytes_after_ret, &data) != Success || !data)
|
||||
{
|
||||
if (data)
|
||||
XFree(data);
|
||||
|
|
|
@ -67,7 +67,7 @@ CommsFindCommsWindow(void)
|
|||
if (s)
|
||||
{
|
||||
comms_win = 0;
|
||||
sscanf((char *)s, "%*s %x", (unsigned int *)&comms_win);
|
||||
sscanf((char *)s, "%*s %lx", &comms_win);
|
||||
XFree(s);
|
||||
}
|
||||
else
|
||||
|
@ -207,7 +207,7 @@ CommsGet(Client ** c, XClientMessageEvent * ev)
|
|||
s2[i] = ev->data.b[i];
|
||||
for (i = 0; i < 12; i++)
|
||||
s[i] = ev->data.b[i + 8];
|
||||
sscanf(s2, "%x", (int *)&win);
|
||||
sscanf(s2, "%lx", &win);
|
||||
cl = (Client *) FindItem(NULL, win, LIST_FINDBY_ID, LIST_TYPE_CLIENT);
|
||||
if (!cl)
|
||||
{
|
||||
|
@ -1172,7 +1172,7 @@ HandleComms(XClientMessageEvent * ev)
|
|||
Window win = 0;
|
||||
Background *bg;
|
||||
|
||||
sscanf(s, "%*s %x %1000s", (unsigned int *)&win, w);
|
||||
sscanf(s, "%*s %lx %1000s", &win, w);
|
||||
bg = (Background *) FindItem(w, 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_BACKGROUND);
|
||||
if (bg)
|
||||
|
|
57
src/icccm.c
57
src/icccm.c
|
@ -156,6 +156,7 @@ ICCCM_Delete(EWin * ewin)
|
|||
Atom a3, *prop;
|
||||
unsigned long lnum, ldummy;
|
||||
int num, i, del, dummy;
|
||||
unsigned char *puc;
|
||||
|
||||
EDBUG(6, "ICCCM_Delete");
|
||||
if (ewin->internal)
|
||||
|
@ -190,8 +191,10 @@ ICCCM_Delete(EWin * ewin)
|
|||
del = 0;
|
||||
if (!XGetWMProtocols(disp, ewin->client.win, &prop, &num))
|
||||
{
|
||||
puc = NULL;
|
||||
XGetWindowProperty(disp, ewin->client.win, a2, 0, 10, False, a2, &a3,
|
||||
&dummy, &lnum, &ldummy, (unsigned char **)&prop);
|
||||
&dummy, &lnum, &ldummy, &puc);
|
||||
prop = (Atom *) puc;
|
||||
num = (int)lnum;
|
||||
}
|
||||
if (prop)
|
||||
|
@ -507,6 +510,7 @@ ICCCM_Focus(EWin * ewin)
|
|||
Atom a3, *prop;
|
||||
unsigned long lnum, ldummy;
|
||||
int num, i, foc, dummy;
|
||||
unsigned char *puc;
|
||||
|
||||
EDBUG(6, "ICCCM_Focus");
|
||||
if (!a1)
|
||||
|
@ -533,8 +537,10 @@ ICCCM_Focus(EWin * ewin)
|
|||
}
|
||||
if (!XGetWMProtocols(disp, ewin->client.win, &prop, &num))
|
||||
{
|
||||
puc = NULL;
|
||||
XGetWindowProperty(disp, ewin->client.win, a2, 0, 10, False, a2, &a3,
|
||||
&dummy, &lnum, &ldummy, (unsigned char **)&prop);
|
||||
&dummy, &lnum, &ldummy, &puc);
|
||||
prop = (Atom *) puc;
|
||||
num = (int)lnum;
|
||||
}
|
||||
if (prop)
|
||||
|
@ -746,6 +752,7 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
unsigned long lnum, ldummy;
|
||||
int num, dummy;
|
||||
char ok = 1;
|
||||
unsigned char *puc;
|
||||
|
||||
EDBUG(6, "ICCCM_GetInfo");
|
||||
if (atom_change)
|
||||
|
@ -987,11 +994,12 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
if (ok)
|
||||
{
|
||||
num = 0;
|
||||
s = NULL;
|
||||
puc = NULL;
|
||||
if (!a2)
|
||||
a2 = XInternAtom(disp, "WM_WINDOW_ROLE", False);
|
||||
XGetWindowProperty(disp, ewin->client.win, a2, 0, 10, False, XA_STRING,
|
||||
&a3, &dummy, &lnum, &ldummy, (unsigned char **)&s);
|
||||
&a3, &dummy, &lnum, &ldummy, &puc);
|
||||
s = (char *)puc;
|
||||
num = (int)lnum;
|
||||
if (s)
|
||||
{
|
||||
|
@ -1013,11 +1021,12 @@ ICCCM_GetHints(EWin * ewin, Atom atom_change)
|
|||
Window w;
|
||||
static Atom a = 0;
|
||||
Atom a2, *prop;
|
||||
Window *cleader = NULL;
|
||||
Window *cleader;
|
||||
unsigned long lnum, ldummy;
|
||||
int i, num, dummy;
|
||||
static Atom a3 = 0;
|
||||
char ok = 1;
|
||||
unsigned char *puc;
|
||||
|
||||
EDBUG(6, "ICCCM_GetHints");
|
||||
if (ewin->internal)
|
||||
|
@ -1172,9 +1181,10 @@ ICCCM_GetHints(EWin * ewin, Atom atom_change)
|
|||
{
|
||||
if (!a)
|
||||
a = XInternAtom(disp, "WM_CLIENT_LEADER", False);
|
||||
puc = NULL;
|
||||
XGetWindowProperty(disp, ewin->client.win, a, 0, 0x7fffffff, False,
|
||||
XA_WINDOW, &a2, &dummy, &lnum, &ldummy,
|
||||
(unsigned char **)&cleader);
|
||||
XA_WINDOW, &a2, &dummy, &lnum, &ldummy, &puc);
|
||||
cleader = (Window *) puc;
|
||||
if (cleader)
|
||||
{
|
||||
ewin->client.client_leader = *cleader;
|
||||
|
@ -1306,13 +1316,16 @@ void
|
|||
ICCCM_GetMainEInfo(void)
|
||||
{
|
||||
Atom a, a2;
|
||||
CARD32 *c = NULL;
|
||||
CARD32 *c;
|
||||
unsigned long lnum, ldummy;
|
||||
int num, dummy, i;
|
||||
unsigned char *puc;
|
||||
|
||||
a = XInternAtom(disp, "ENL_INTERNAL_AREA_DATA", False);
|
||||
puc = NULL;
|
||||
XGetWindowProperty(disp, root.win, a, 0, 10, False, XA_CARDINAL, &a2,
|
||||
&dummy, &lnum, &ldummy, (unsigned char **)&c);
|
||||
&dummy, &lnum, &ldummy, &puc);
|
||||
c = (CARD32 *) puc;
|
||||
num = (int)lnum;
|
||||
if ((num > 0) && (c))
|
||||
{
|
||||
|
@ -1326,12 +1339,12 @@ ICCCM_GetMainEInfo(void)
|
|||
}
|
||||
XFree(c);
|
||||
}
|
||||
num = 0;
|
||||
c = NULL;
|
||||
|
||||
a = XInternAtom(disp, "ENL_INTERNAL_DESK_DATA", False);
|
||||
puc = NULL;
|
||||
XGetWindowProperty(disp, root.win, a, 0, 10, False, XA_CARDINAL, &a2,
|
||||
&dummy, &lnum, &ldummy, (unsigned char **)&c);
|
||||
&dummy, &lnum, &ldummy, &puc);
|
||||
c = (CARD32 *) puc;
|
||||
num = (int)lnum;
|
||||
if ((num > 0) && (c))
|
||||
{
|
||||
|
@ -1345,20 +1358,25 @@ ICCCM_GetEInfo(EWin * ewin)
|
|||
{
|
||||
static Atom a = 0, aa = 0;
|
||||
Atom a2;
|
||||
CARD32 *c = NULL;
|
||||
char *str = NULL;
|
||||
CARD32 *c;
|
||||
char *str;
|
||||
unsigned long lnum, ldummy;
|
||||
int num, dummy;
|
||||
unsigned char *puc;
|
||||
|
||||
EDBUG(6, "ICCCM_GetEInfo");
|
||||
if (ewin->internal)
|
||||
EDBUG_RETURN(0);
|
||||
|
||||
if (!a)
|
||||
a = XInternAtom(disp, "ENL_INTERNAL_DATA", False);
|
||||
if (!aa)
|
||||
aa = XInternAtom(disp, "ENL_INTERNAL_DATA_BORDER", False);
|
||||
|
||||
puc = NULL;
|
||||
XGetWindowProperty(disp, ewin->client.win, a, 0, 10, True, XA_CARDINAL, &a2,
|
||||
&dummy, &lnum, &ldummy, (unsigned char **)&c);
|
||||
&dummy, &lnum, &ldummy, &puc);
|
||||
c = (CARD32 *) puc;
|
||||
num = (int)lnum;
|
||||
if ((num >= 8) && (c))
|
||||
{
|
||||
|
@ -1383,11 +1401,12 @@ ICCCM_GetEInfo(EWin * ewin)
|
|||
ewin->client.w = c[6];
|
||||
ewin->client.h = c[7];
|
||||
}
|
||||
XGetWindowProperty(disp, ewin->client.win, aa, 0, 0xffff, True,
|
||||
XA_STRING, &a2, &dummy, &lnum, &ldummy,
|
||||
(unsigned char **)&str);
|
||||
num = (int)lnum;
|
||||
|
||||
puc = NULL;
|
||||
XGetWindowProperty(disp, ewin->client.win, aa, 0, 0xffff, True,
|
||||
XA_STRING, &a2, &dummy, &lnum, &ldummy, &puc);
|
||||
str = (char *)puc;
|
||||
num = (int)lnum;
|
||||
if ((num > 0) && (str))
|
||||
{
|
||||
Border *b = NULL;
|
||||
|
|
|
@ -691,7 +691,7 @@ IPC_Remember(char *params, Client * c)
|
|||
Window win = 0;
|
||||
EWin *ewin;
|
||||
|
||||
sscanf(params, "%x", (int *)&win);
|
||||
sscanf(params, "%lx", &win);
|
||||
ewin = FindItem(NULL, (int)win, LIST_FINDBY_ID, LIST_TYPE_EWIN);
|
||||
if (ewin)
|
||||
{
|
||||
|
|
|
@ -71,6 +71,7 @@ MWM_GetHints(EWin * ewin, Atom atom_change)
|
|||
Atom a1, a2;
|
||||
unsigned long num, end;
|
||||
MWMHints *mwmhints;
|
||||
unsigned char *puc;
|
||||
|
||||
EDBUG(6, "MWM_GetHints");
|
||||
if (ewin->internal)
|
||||
|
@ -96,9 +97,10 @@ MWM_GetHints(EWin * ewin, Atom atom_change)
|
|||
ewin->client.mwm_func_maximize = 1;
|
||||
ewin->client.mwm_func_close = 1;
|
||||
a1 = XInternAtom(disp, "_MOTIF_WM_HINTS", False);
|
||||
mwmhints = NULL;
|
||||
puc = NULL;
|
||||
XGetWindowProperty(disp, ewin->client.win, a1, 0, 20, False, a1, &a2, &fmt,
|
||||
&num, &end, (unsigned char **)&mwmhints);
|
||||
&num, &end, &puc);
|
||||
mwmhints = (MWMHints *) puc;
|
||||
if (mwmhints)
|
||||
{
|
||||
if (num < PROP_MWM_HINTS_ELEMENTS)
|
||||
|
|
|
@ -690,11 +690,13 @@ MakeExtInitWin(void)
|
|||
Atom aa;
|
||||
int format_ret;
|
||||
unsigned long bytes_after, num_ret;
|
||||
unsigned char *puc;
|
||||
|
||||
retval = NULL;
|
||||
puc = NULL;
|
||||
XGetWindowProperty(disp, root.win, a, 0, 0x7fffffff, True,
|
||||
XA_CARDINAL, &aa, &format_ret, &num_ret,
|
||||
&bytes_after, (unsigned char **)(&retval));
|
||||
&bytes_after, &puc);
|
||||
retval = (Window *) puc;
|
||||
XSync(disp, False);
|
||||
if (retval)
|
||||
break;
|
||||
|
|
9
src/x.c
9
src/x.c
|
@ -76,12 +76,15 @@ AddXID(EXID * xid)
|
|||
static EXID *
|
||||
FindXID(Window win)
|
||||
{
|
||||
EXID *xid = NULL;
|
||||
EXID *xid;
|
||||
XPointer xp;
|
||||
|
||||
if (xid_context == 0)
|
||||
xid_context = XUniqueContext();
|
||||
if (XFindContext(disp, win, xid_context, (XPointer *) & xid) == XCNOENT)
|
||||
xid = NULL;
|
||||
xp = NULL;
|
||||
if (XFindContext(disp, win, xid_context, &xp) == XCNOENT)
|
||||
xp = NULL;
|
||||
xid = (EXID *) xp;
|
||||
return xid;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue