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

Tom Dzmelyk <tddzm...@mtu.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tddzm...@mtu.edu

--- Comment #31 from Tom Dzmelyk <tddzm...@mtu.edu> ---
Operating System: Arch 
KDE Plasma Version: 6.0.0
KDE Frameworks Version: 6.0.0
Qt Version: 6
Kernel Version: 6.6.19
Session: wayland

Since this has been 100% reproducible for me with Discord on Plasma 6  I
finally decided to look into this. 

I was mucking around in sniproxy.cpp and it seems like this is actually needs
attention both in SNIproxy and systemtray/statusnotifier.

There is no mechanism to for SNIproxy to know where it "should" be until it
receives an event from StatusNotifierItemJob::performJob(), so it can't occupy
the correct position and it just exists at (0,0) until a click/scroll action
goes through and tells it where it needs to be.

The constructor in sniproxy.cpp just dumps it at (0,0) since it needs to be
"somewhere"

148 >    // move window we're embedding
149 >    const uint32_t windowMoveConfigVals[2] = {0, 0};
150 > 
151 >    xcb_configure_window(c, wid, XCB_CONFIG_WINDOW_X |
XCB_CONFIG_WINDOW_Y, windowMoveConfigVals);

and it doesn't get moved until SNIProxy::sendClick() is triggered by the
Activate, SecondaryActivate, ContextMenu, or Scroll functions.

522 >    // move our window so the mouse is within its geometry
523 >    uint32_t configVals[2] = {0, 0};
524 >    const QPoint clickPoint = calculateClickPoint();
525 >    if (mouseButton >= XCB_BUTTON_INDEX_4) {
526 >        // scroll event, take pointer position
527 >        auto cookie = xcb_query_pointer(c, m_windowId);
528 >        UniqueCPointer<xcb_query_pointer_reply_t>
pointer(xcb_query_pointer_reply(c, cookie, nullptr));
529 >        configVals[0] = pointer->root_x;
530 >        configVals[1] = pointer->root_y;
531 >    } else {
532 >        configVals[0] = static_cast<uint32_t>(x - clickPoint.x());
533 >        configVals[1] = static_cast<uint32_t>(y - clickPoint.y());
534 >    }
535 >    xcb_configure_window(c, m_containerWid, XCB_CONFIG_WINDOW_X |
XCB_CONFIG_WINDOW_Y, configVals);

Once this code block in executes the bug fixes itself.

So systemtray/statusnotifier needs to be able to query it's position when
initialized and needs to pass that to SNIProxy to properly initialize it's own
position.

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

Reply via email to