https://bugs.kde.org/show_bug.cgi?id=380836

            Bug ID: 380836
           Summary: Horizontal and Vertical maximized states are reversed
                    in signal parameters
           Product: kwin
           Version: 5.9.5
          Platform: Other
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: scripting
          Assignee: kwin-bugs-n...@kde.org
          Reporter: zrenf...@gmail.com
  Target Milestone: ---

Created attachment 105916
  --> https://bugs.kde.org/attachment.cgi?id=105916&action=edit
kwin console log output

I only noticed this when I was skimming the code. Going to write something

https://github.com/KDE/kde-workspace/blob/master/kwin/netinfo.cpp#L259

    if ((mask & NET::Max) == NET::Max)
        m_client->setMaximize(state & NET::MaxVert, state & NET::MaxHoriz);
    else if (mask & NET::MaxVert)
        m_client->setMaximize(state & NET::MaxVert, m_client->maximizeMode() &
Client::MaximizeHorizontal);
    else if (mask & NET::MaxHoriz)
        m_client->setMaximize(m_client->maximizeMode() &
Client::MaximizeVertical, state & NET::MaxHoriz);

https://github.com/KDE/kwin/blob/master/geometry.cpp#L2163

    void AbstractClient::setMaximize(bool vertically, bool horizontally) {
        ...
        emit clientMaximizedStateChanged(this, newMode);
        emit clientMaximizedStateChanged(this, vertically, horizontally);

^---
Note how vertically is passed first, while the function is defined with
horizontal coming first.
Reversing the variables will probably fix things, though I've no idea what is
depending on this code.

https://github.com/KDE/kwin/blob/master/scripting/workspace_wrapper.cpp#L258

    connect(client, static_cast<void (Client::*)(KWin::AbstractClient*, bool,
bool)>(&Client::clientMaximizedStateChanged),
            this, &WorkspaceWrapper::clientMaximizeSet);

https://github.com/KDE/kwin/blob/master/scripting/workspace_wrapper.h#L100

    void clientMaximizeSet(KWin::AbstractClient *client, bool h, bool v);

(KDE 4)
https://github.com/KDE/kde-workspace/blob/master/kwin/scripting/workspace_wrapper.h#L98

    void clientMaximizeSet(KWin::Client *client, bool h, bool v);


https://techbase.kde.org/Development/Tutorials/KWin/Scripting/API_4.9#KWin::WorkspaceWrapper

    clientMaximizedStateChanged(KWin::Client *c, bool h, bool v)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to