export QWS_DISPLAY="Multi:VNC:LinuxFb:/dev/fb0:0 LinuxFB:/dev/fb1:1offset:800,0"
我使用 多屏显示时 鼠标移除范围 会造成鼠标指针产生多个,虽然能正常使用 屏幕鼠标越来越多
研究发现是因为 Multi 这个参数造成的,我要使用多屏还必须使用,查询资料国外用户也遇到过
qt官方也把这段代码注释了 xxx: this is a mess! 只是没有解决
按照下面这个改动也是可以,只是鼠标靠近边缘时会跳
void QMultiScreenCursor::move(int x, int y)
{
// Get subscreen indexes
const int oldIndex = qt_screen->subScreenIndexAt(pos);
const int newIndex = qt_screen->subScreenIndexAt(QPoint(x, y));
QScreenCursor *oldCursor, *newCursor;
const QScreen *oldScreen, *newScreen;
// Old screen operations
if (oldIndex != -1)
{
// Get the old screen from the subscreens
oldScreen = qt_screen->subScreens().at(oldIndex);
// Get the old screen cursor
oldCursor = cursors.at(oldIndex);
// Set the current cursor
if (!currentCursor)
setCurrentCursor(oldCursor);
// is new position valid ?
if (oldScreen->region().contains(QPoint(x, y)))
{
// Update the mouse cursor position
QScreenCursor::move(x, y);
// Move the old cursor
oldCursor->move(x, y);
return;
}//if
}//if
else
{
oldCursor = currentCursor;
}//else
// New screen operations
if (newIndex != -1)
{
// Get the new screen from the subscreens
newScreen = qt_screen->subScreens().at(newIndex);
// Get the new screen cursor
newCursor = cursors.at(newIndex);
// Set the new cursor
newCursor->set(cursor, hotspot.x(), hotspot.y());
// Make sure the old cursor is invisible
if (oldCursor)
{
if (oldCursor->isVisible())
newCursor->show();
oldCursor->hide();
}//if
// is new position valid ?
if (newScreen->region().contains(QPoint(x, y)))
{
// Update the mouse cursor position
QScreenCursor::move(x, y);
// Move the new cursor
newCursor->move(x, y);
}//if
// Set the current cursor
setCurrentCursor(newCursor);
}//if
经研究发现 加入宏定义 隐藏 多屏时的鼠标 也能解决
#define QT_NO_QWS_CURSOR
这样编译qt的时候 就不会 编译 这段代码 替换 原有的 qtgui.so 文件