Summary: A certain toolkit doesn't register for mouse press release events because it now uses XI2 only. Injecting those directly to the window is too difficult, fortunately in the GTK3 case we can use XTest to send an event. Something I had previously chosen against using because it didn't work with something else (can't remember what). I now have a bit of code choosing which method to use, which will hopefully cover all cases. Code is a bit convuluted because the xcb version of xtest doesn't have the high-level method I want to use in it's API, so I just used Xlib version. CCBUG: 375017 CCBUG: 362941 Test Plan: Ran my usual bunch of test apps: - xchat - a GTK3 systray demo I made - skype (A Qt4 app without SNI patches) All worked as before Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5156wilder-5.14
parent
3dc5886e62
commit
9df815e843
5 changed files with 96 additions and 5 deletions
@ -0,0 +1,32 @@ |
||||
/* Wrap XLIB code in a new file as it defines keywords that conflict with Qt
|
||||
* |
||||
* Copyright (C) 2017 <davidedmundson@kde.org> David Edmundson |
||||
* |
||||
* This library is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU Lesser General Public |
||||
* License as published by the Free Software Foundation; either |
||||
* version 2.1 of the License, or (at your option) any later version. |
||||
* |
||||
* This library is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with this library; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
* |
||||
*/ |
||||
|
||||
#include <X11/extensions/XTest.h> |
||||
#include "xtestsender.h" |
||||
|
||||
void sendXTestPressed(Display *display, int button) |
||||
{ |
||||
XTestFakeButtonEvent(display, button, true, 0); |
||||
} |
||||
|
||||
void sendXTestReleased(Display *display, int button) |
||||
{ |
||||
XTestFakeButtonEvent(display, button, false, 0); |
||||
} |
||||
@ -0,0 +1,28 @@ |
||||
/* Wrap XLIB code in a new file as it defines keywords that conflict with Qt
|
||||
* |
||||
* Copyright (C) 2017 <davidedmundson@kde.org> David Edmundson |
||||
* |
||||
* This library is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU Lesser General Public |
||||
* License as published by the Free Software Foundation; either |
||||
* version 2.1 of the License, or (at your option) any later version. |
||||
* |
||||
* This library is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||||
* Lesser General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with this library; if not, write to the Free Software |
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
||||
* |
||||
*/ |
||||
#ifndef XTEST_SENDER_H |
||||
#define XTEST_SENDER_H |
||||
|
||||
typedef _XDisplay Display; |
||||
|
||||
void sendXTestPressed(Display *display, int button); |
||||
void sendXTestReleased(Display *display, int button); |
||||
|
||||
#endif |
||||
Loading…
Reference in new issue