Merge pull request #3177 from Cacodemon345/qt-wacom-serial
qt: Multimonitor and absolute mouse input fixes
This commit is contained in:
@@ -138,7 +138,11 @@ main_thread_fn()
|
||||
}
|
||||
|
||||
is_quit = 1;
|
||||
QTimer::singleShot(0, QApplication::instance(), []() { QApplication::instance()->quit(); });
|
||||
if (gfxcard[1]) {
|
||||
ui_deinit_monitor(1);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
}
|
||||
QTimer::singleShot(0, QApplication::instance(), []() { QApplication::processEvents(); QApplication::instance()->quit(); });
|
||||
}
|
||||
|
||||
static std::thread *main_thread;
|
||||
|
@@ -733,7 +733,9 @@ MainWindow::initRendererMonitorSlot(int monitor_index)
|
||||
secondaryRenderer->showMaximized();
|
||||
}
|
||||
secondaryRenderer->switchRenderer((RendererStack::Renderer) vid_api);
|
||||
secondaryRenderer->setMouseTracking(true);
|
||||
}
|
||||
connect(this, &MainWindow::pollMouse, secondaryRenderer.get(), &RendererStack::mousePoll, Qt::DirectConnection);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -127,7 +127,7 @@ qt_mouse_capture(int on)
|
||||
{
|
||||
if (!on) {
|
||||
mouse_capture = 0;
|
||||
QApplication::setOverrideCursor(Qt::ArrowCursor);
|
||||
if (QApplication::overrideCursor()) QApplication::restoreOverrideCursor();
|
||||
#ifdef __APPLE__
|
||||
CGAssociateMouseAndMouseCursorPosition(true);
|
||||
#endif
|
||||
@@ -144,6 +144,20 @@ qt_mouse_capture(int on)
|
||||
void
|
||||
RendererStack::mousePoll()
|
||||
{
|
||||
if (m_monitor_index >= 1) {
|
||||
if (mouse_mode >= 1) {
|
||||
mouse_x_abs = mousedata.x_abs;
|
||||
mouse_y_abs = mousedata.y_abs;
|
||||
if (!mouse_tablet_in_proximity) {
|
||||
mouse_tablet_in_proximity = mousedata.mouse_tablet_in_proximity;
|
||||
}
|
||||
if (mousedata.mouse_tablet_in_proximity) {
|
||||
mouse_buttons = mousedata.mousebuttons;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
if (mouse_mode == 0) {
|
||||
mouse_x_abs = mousedata.x_abs;
|
||||
@@ -151,6 +165,7 @@ RendererStack::mousePoll()
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef __APPLE__
|
||||
mouse_x = mousedata.deltax;
|
||||
mouse_y = mousedata.deltay;
|
||||
@@ -270,8 +285,9 @@ void
|
||||
RendererStack::leaveEvent(QEvent *event)
|
||||
{
|
||||
mousedata.mouse_tablet_in_proximity = 0;
|
||||
if (mouse_mode == 1)
|
||||
QApplication::setOverrideCursor(Qt::ArrowCursor);
|
||||
|
||||
if (mouse_mode == 1 && QApplication::overrideCursor())
|
||||
QApplication::restoreOverrideCursor();
|
||||
if (QApplication::platformName().contains("wayland")) {
|
||||
event->accept();
|
||||
return;
|
||||
|
Reference in New Issue
Block a user