ewmh_modify_state: Prevent using uninitialized state; simplify code.
git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@1224 423420c4-83ab-492f-b58f-81f9feb106b5
This commit is contained in:
parent
9e3dd0b7ab
commit
6e285f3440
@ -240,7 +240,7 @@ ewmh_modify_state(Window wnd, int add, Atom atom1, Atom atom2)
|
|||||||
int result;
|
int result;
|
||||||
unsigned long nitems;
|
unsigned long nitems;
|
||||||
unsigned char *props;
|
unsigned char *props;
|
||||||
uint32 state;
|
uint32 state = WithdrawnState;
|
||||||
|
|
||||||
/* The spec states that the window manager must respect any
|
/* The spec states that the window manager must respect any
|
||||||
_NET_WM_STATE attributes on a withdrawn window. In order words, we
|
_NET_WM_STATE attributes on a withdrawn window. In order words, we
|
||||||
@ -253,7 +253,7 @@ ewmh_modify_state(Window wnd, int add, Atom atom1, Atom atom2)
|
|||||||
XFree(props);
|
XFree(props);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((result < 0) || !nitems || (state == WithdrawnState))
|
if (state == WithdrawnState)
|
||||||
{
|
{
|
||||||
if (add)
|
if (add)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user