Skip to content

Commit bfeb745

Browse files
chirs241097BLumia
authored andcommitted
fix: workaround for QTBUG-76114.
(#40)
1 parent c2ed22c commit bfeb745

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/common/utility_x11.cpp

+11-4
Original file line numberDiff line numberDiff line change
@@ -175,17 +175,24 @@ void Utility::sendMoveResizeMessage(quint32 WId, uint32_t action, QPoint globalP
175175
qbutton == Qt::RightButton ? XCB_BUTTON_INDEX_3 :
176176
XCB_BUTTON_INDEX_ANY;
177177

178-
if (globalPos.isNull())
179-
globalPos = QCursor::pos();
178+
if (globalPos.isNull()) {
179+
//QTBUG-76114
180+
//globalPos = QCursor::pos();
181+
xcb_query_pointer_reply_t* p = xcb_query_pointer_reply(QX11Info::connection(),
182+
xcb_query_pointer(QX11Info::connection(),
183+
QX11Info::appRootWindow(QX11Info::appScreen())),
184+
nullptr);
185+
globalPos = QPoint(p->root_x, p->root_y);
186+
}
180187

181188
xcb_client_message_event_t xev;
182189

183190
xev.response_type = XCB_CLIENT_MESSAGE;
184191
xev.type = internAtom(XATOM_MOVE_RESIZE);
185192
xev.window = WId;
186193
xev.format = 32;
187-
xev.data.data32[0] = globalPos.x() * qApp->devicePixelRatio();
188-
xev.data.data32[1] = globalPos.y() * qApp->devicePixelRatio();
194+
xev.data.data32[0] = globalPos.x();
195+
xev.data.data32[1] = globalPos.y();
189196
xev.data.data32[2] = action;
190197
xev.data.data32[3] = xbtn;
191198
xev.data.data32[4] = 0;

0 commit comments

Comments
 (0)