Bug in kwin (kde2)



I discovered this while playing with CLX and at first thought that
this is caused by lack of CLX skills.  But I have just verified this
with a C program.  I have just submitted this as a bug via
bugs.kde.org wizard.

Programmatically maximizing the window by

    cmd.xclient.display      = display;
    cmd.xclient.window       = window;
    cmd.xclient.type         = ClientMessage;
    cmd.xclient.message_type = _XA_NET_WM_STATE;
    cmd.xclient.format       = 32;
    cmd.xclient.data.l[0]    = how;     /* XXX */
    cmd.xclient.data.l[1]    = _XA_NET_WM_STATE_MAXIMIZED_VERT;
    cmd.xclient.data.l[2]    = 0;

    status = XSendEvent(awt_display, DefaultRootWindow(awt_display), False,
                        StructureNotifyMask|SubstructureNotifyMask, &cmd);

doesn't work as specified by wm-spec.

Passing how=0 doesn't change anything.
how=1 toggles maximization instead of setting it.
how=2 sets maximization instead of toggling it.

The problem seems to be in kwin/client.cpp (verified to exist in 1.192):

    WinInfo::changeState(unsigned long state, unsigned long mask)

checks for

    if ( state & NET::Max )

instead of mask & NET::Max

and if the request is to clear the flag (either with explicit clear by
toggling it off) the request is ignored since state do NOT have the
bit set (we are clearing it) - the mask has.

SY, Uwe
-- 
uwe ptc spbu ru                         |       Zu Grunde kommen
http://www.ptc.spbu.ru/~uwe/            |       Ist zu Grunde gehen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]