mirror of
https://github.com/libretro/RetroArch
synced 2025-03-02 19:13:34 +00:00
(x11_common.c) Cleanups
This commit is contained in:
parent
098e62067e
commit
6bf35ab6e8
@ -753,22 +753,21 @@ bool x11_has_net_wm_fullscreen(Display *dpy)
|
||||
|
||||
char *x11_get_wm_name(Display *dpy)
|
||||
{
|
||||
Atom type;
|
||||
int format;
|
||||
Window window;
|
||||
Atom XA_NET_SUPPORTING_WM_CHECK = XInternAtom(g_x11_dpy, "_NET_SUPPORTING_WM_CHECK", False);
|
||||
Atom XA_NET_WM_NAME = XInternAtom(g_x11_dpy, "_NET_WM_NAME", False);
|
||||
Atom XA_UTF8_STRING = XInternAtom(g_x11_dpy, "UTF8_STRING", False);
|
||||
int status;
|
||||
Atom type;
|
||||
int format;
|
||||
unsigned long nitems;
|
||||
unsigned long bytes_after;
|
||||
unsigned char *propdata;
|
||||
char *title;
|
||||
Window window;
|
||||
unsigned long nitems = 0;
|
||||
unsigned long bytes_after = 0;
|
||||
char *title = NULL;
|
||||
unsigned char *propdata = NULL;
|
||||
|
||||
if (!XA_NET_SUPPORTING_WM_CHECK || !XA_NET_WM_NAME)
|
||||
return NULL;
|
||||
|
||||
status = XGetWindowProperty(dpy,
|
||||
if (!(XGetWindowProperty(dpy,
|
||||
DefaultRootWindow(dpy),
|
||||
XA_NET_SUPPORTING_WM_CHECK,
|
||||
0,
|
||||
@ -779,16 +778,15 @@ char *x11_get_wm_name(Display *dpy)
|
||||
&format,
|
||||
&nitems,
|
||||
&bytes_after,
|
||||
&propdata);
|
||||
&propdata) == Success &&
|
||||
propdata))
|
||||
return NULL;
|
||||
|
||||
if (status == Success && propdata)
|
||||
window = ((Window *) propdata)[0];
|
||||
else
|
||||
return NULL;
|
||||
window = ((Window *) propdata)[0];
|
||||
|
||||
XFree(propdata);
|
||||
|
||||
status = XGetWindowProperty(dpy,
|
||||
if (!(XGetWindowProperty(dpy,
|
||||
window,
|
||||
XA_NET_WM_NAME,
|
||||
0,
|
||||
@ -799,13 +797,11 @@ char *x11_get_wm_name(Display *dpy)
|
||||
&format,
|
||||
&nitems,
|
||||
&bytes_after,
|
||||
&propdata);
|
||||
|
||||
if (status == Success && propdata)
|
||||
title = strdup((char *) propdata);
|
||||
else
|
||||
return NULL;
|
||||
&propdata) == Success
|
||||
&& propdata))
|
||||
return NULL;
|
||||
|
||||
title = strdup((char *) propdata);
|
||||
XFree(propdata);
|
||||
|
||||
return title;
|
||||
|
Loading…
x
Reference in New Issue
Block a user