mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +00:00
Assign correct values to XButtonEvent::[xy]_root
The signature is: QPoint QWidget::mapToGlobal(const QPoint &) const;
This commit is contained in:
parent
307fe2ba16
commit
6dc74a7c7b
|
@ -3050,15 +3050,14 @@ void MainWindow::toggleMainWindow( bool onlyShow )
|
||||||
XGetInputFocus( QX11Info::display(), &wh, &rev );
|
XGetInputFocus( QX11Info::display(), &wh, &rev );
|
||||||
if( wh != translateLine->internalWinId() && !byIconClick )
|
if( wh != translateLine->internalWinId() && !byIconClick )
|
||||||
{
|
{
|
||||||
QPoint p( 1, 1 );
|
QPoint const pointRelativeToRoot = mapToGlobal( QPoint( 1, 1 ) );
|
||||||
mapToGlobal( p );
|
|
||||||
XEvent event;
|
XEvent event;
|
||||||
memset( &event, 0, sizeof( event) );
|
memset( &event, 0, sizeof( event) );
|
||||||
event.type = ButtonPress;
|
event.type = ButtonPress;
|
||||||
event.xbutton.x = 1;
|
event.xbutton.x = 1;
|
||||||
event.xbutton.y = 1;
|
event.xbutton.y = 1;
|
||||||
event.xbutton.x_root = p.x();
|
event.xbutton.x_root = pointRelativeToRoot.x();
|
||||||
event.xbutton.y_root = p.y();
|
event.xbutton.y_root = pointRelativeToRoot.y();
|
||||||
event.xbutton.window = internalWinId();
|
event.xbutton.window = internalWinId();
|
||||||
event.xbutton.root = QX11Info::appRootWindow( QX11Info::appScreen() );
|
event.xbutton.root = QX11Info::appRootWindow( QX11Info::appScreen() );
|
||||||
event.xbutton.state = Button1Mask;
|
event.xbutton.state = Button1Mask;
|
||||||
|
|
Loading…
Reference in a new issue