Thanks hvitual. But windowsless mode did not work. The QWebView will not show the plugin in this mode
I found another solution to "steal" the mouse events.
First I find the widget which holds the plugin in an QWebView. Then I register a slot to the signal "clientIsEmbedded()" (Because we have to wait for the plugin to embed).
void WebView::page_loaded(bool ok)
{
QList<QX11EmbedContainer*> l
= this->findChildren<QX11EmbedContainer*>();
connect(x11cont, SIGNAL(clientIsEmbedded()), this,
SLOT(client_embedded()));
}
} // WebView::page_loaded(...)
void WebView::page_loaded(bool ok)
{
QList<QX11EmbedContainer*> l
= this->findChildren<QX11EmbedContainer*>();
foreach(QX11EmbedContainer* x11cont, l) {
connect(x11cont, SIGNAL(clientIsEmbedded()), this,
SLOT(client_embedded()));
}
} // WebView::page_loaded(...)
To copy to clipboard, switch view to plain text mode
In the slot "client_embedded()" I will use the XLib function "XGrabButton" to steal mouse button 3 (right button). All right click events will now be processed by my qt application. Flash will not show the context menu anymore
void WebView::client_embedded()
{
XGrabButton
(QX11Info::display(),
3, AnyModifier,
x11cont->clientWinId(),
false, ButtonPressMask, GrabModeAsync, GrabModeAsync,
0L, 0L);
}
void WebView::client_embedded()
{
QX11EmbedContainer* x11cont = static_cast<QX11EmbedContainer*>(sender());
XGrabButton(QX11Info::display(), 3, AnyModifier,
x11cont->clientWinId(),
false, ButtonPressMask, GrabModeAsync, GrabModeAsync,
0L, 0L);
}
To copy to clipboard, switch view to plain text mode
The next question is: How to do so under Windows?
Bookmarks