|
|
|
|
@ -32,6 +32,7 @@ |
|
|
|
|
#include "statusnotifieritemadaptor.h" |
|
|
|
|
#include "statusnotifierwatcher_interface.h" |
|
|
|
|
|
|
|
|
|
#include "../c_ptr.h" |
|
|
|
|
#include "xtestsender.h" |
|
|
|
|
|
|
|
|
|
//#define VISUAL_DEBUG
|
|
|
|
|
@ -169,7 +170,7 @@ SNIProxy::SNIProxy(xcb_window_t wid, QObject *parent) |
|
|
|
|
// we query if the client selected button presses in the event mask
|
|
|
|
|
// if the client does supports that we send directly, otherwise we'll use xtest
|
|
|
|
|
auto waCookie = xcb_get_window_attributes(c, wid); |
|
|
|
|
QScopedPointer<xcb_get_window_attributes_reply_t, QScopedPointerPodDeleter> windowAttributes(xcb_get_window_attributes_reply(c, waCookie, nullptr)); |
|
|
|
|
UniqueCPointer<xcb_get_window_attributes_reply_t> windowAttributes(xcb_get_window_attributes_reply(c, waCookie, nullptr)); |
|
|
|
|
if (windowAttributes && !(windowAttributes->all_event_masks & XCB_EVENT_MASK_BUTTON_PRESS)) { |
|
|
|
|
m_injectMode = XTest; |
|
|
|
|
} |
|
|
|
|
@ -234,7 +235,7 @@ QSize SNIProxy::calculateClientWindowSize() const |
|
|
|
|
auto c = QX11Info::connection(); |
|
|
|
|
|
|
|
|
|
auto cookie = xcb_get_geometry(c, m_windowId); |
|
|
|
|
QScopedPointer<xcb_get_geometry_reply_t, QScopedPointerPodDeleter> clientGeom(xcb_get_geometry_reply(c, cookie, nullptr)); |
|
|
|
|
UniqueCPointer<xcb_get_geometry_reply_t> clientGeom(xcb_get_geometry_reply(c, cookie, nullptr)); |
|
|
|
|
|
|
|
|
|
QSize clientWindowSize; |
|
|
|
|
if (clientGeom) { |
|
|
|
|
@ -391,8 +392,8 @@ QPoint SNIProxy::calculateClickPoint() const |
|
|
|
|
// at the same time make the request for rectangles (even if this request isn't needed)
|
|
|
|
|
xcb_shape_get_rectangles_cookie_t rectaglesCookie = xcb_shape_get_rectangles(c, m_windowId, XCB_SHAPE_SK_BOUNDING); |
|
|
|
|
|
|
|
|
|
QScopedPointer<xcb_shape_query_extents_reply_t, QScopedPointerPodDeleter> extentsReply(xcb_shape_query_extents_reply(c, extentsCookie, nullptr)); |
|
|
|
|
QScopedPointer<xcb_shape_get_rectangles_reply_t, QScopedPointerPodDeleter> rectanglesReply(xcb_shape_get_rectangles_reply(c, rectaglesCookie, nullptr)); |
|
|
|
|
UniqueCPointer<xcb_shape_query_extents_reply_t> extentsReply(xcb_shape_query_extents_reply(c, extentsCookie, nullptr)); |
|
|
|
|
UniqueCPointer<xcb_shape_get_rectangles_reply_t> rectanglesReply(xcb_shape_get_rectangles_reply(c, rectaglesCookie, nullptr)); |
|
|
|
|
|
|
|
|
|
if (!extentsReply || !rectanglesReply || !extentsReply->bounding_shaped) { |
|
|
|
|
return clickPoint; |
|
|
|
|
@ -512,14 +513,14 @@ void SNIProxy::sendClick(uint8_t mouseButton, int x, int y) |
|
|
|
|
auto c = QX11Info::connection(); |
|
|
|
|
|
|
|
|
|
auto cookieSize = xcb_get_geometry(c, m_windowId); |
|
|
|
|
QScopedPointer<xcb_get_geometry_reply_t, QScopedPointerPodDeleter> clientGeom(xcb_get_geometry_reply(c, cookieSize, nullptr)); |
|
|
|
|
UniqueCPointer<xcb_get_geometry_reply_t> clientGeom(xcb_get_geometry_reply(c, cookieSize, nullptr)); |
|
|
|
|
|
|
|
|
|
if (!clientGeom) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
auto cookie = xcb_query_pointer(c, m_windowId); |
|
|
|
|
QScopedPointer<xcb_query_pointer_reply_t, QScopedPointerPodDeleter> pointer(xcb_query_pointer_reply(c, cookie, nullptr)); |
|
|
|
|
UniqueCPointer<xcb_query_pointer_reply_t> pointer(xcb_query_pointer_reply(c, cookie, nullptr)); |
|
|
|
|
/*qCDebug(SNIPROXY) << "samescreen" << pointer->same_screen << endl
|
|
|
|
|
<< "root x*y" << pointer->root_x << pointer->root_y << endl |
|
|
|
|
<< "win x*y" << pointer->win_x << pointer->win_y;*/ |
|
|
|
|
|