mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +00:00
Windows switching under Ubuntu Unity (issue #204)
This commit is contained in:
parent
a46b17924d
commit
d992c81e93
|
@ -2408,7 +2408,29 @@ void MainWindow::toggleMainWindow( bool onlyShow )
|
|||
int rev = 0;
|
||||
XGetInputFocus( QX11Info::display(), &wh, &rev );
|
||||
if( wh != translateLine->internalWinId() )
|
||||
XSetInputFocus( QX11Info::display(), translateLine->internalWinId(), RevertToParent, CurrentTime );
|
||||
{
|
||||
QPoint p( 1, 1 );
|
||||
mapToGlobal( p );
|
||||
XEvent event;
|
||||
memset( &event, 0, sizeof( event) );
|
||||
event.type = ButtonPress;
|
||||
event.xbutton.x = 1;
|
||||
event.xbutton.y = 1;
|
||||
event.xbutton.x_root = p.x();
|
||||
event.xbutton.y_root = p.y();
|
||||
event.xbutton.window = internalWinId();
|
||||
event.xbutton.root = QX11Info::appRootWindow( QX11Info::appScreen() );
|
||||
event.xbutton.state = Button1Mask;
|
||||
event.xbutton.button = Button1;
|
||||
event.xbutton.same_screen = true;
|
||||
event.xbutton.time = CurrentTime;
|
||||
|
||||
XSendEvent( QX11Info::display(), internalWinId(), true, 0xfff, &event );
|
||||
XFlush( QX11Info::display() );
|
||||
event.type = ButtonRelease;
|
||||
XSendEvent( QX11Info::display(), internalWinId(), true, 0xfff, &event );
|
||||
XFlush( QX11Info::display() );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue