fix: apply scroll lock setting on initialization

Co-authored-by: Nick Bolton <nick@symless.com>
This commit is contained in:
pika 2025-10-14 21:07:45 -05:00 committed by Chris Rizzitello
parent c11a1caf59
commit 78e394a210
2 changed files with 14 additions and 10 deletions

View file

@ -334,14 +334,18 @@ void PortalInputCapture::handleZonesChanged(XdpInputCaptureSession *session, con
list = g_list_append(list, b); list = g_list_append(list, b);
} }
xdp_input_capture_session_set_pointer_barriers( if (list != nullptr) {
m_session, list, xdp_input_capture_session_set_pointer_barriers(
nullptr, // cancellable m_session, list,
[](GObject *obj, GAsyncResult *res, gpointer data) { nullptr, // cancellable
static_cast<PortalInputCapture *>(data)->handleSetPointerBarriers(obj, res); [](GObject *obj, GAsyncResult *res, gpointer data) {
}, static_cast<PortalInputCapture *>(data)->handleSetPointerBarriers(obj, res);
this },
); this
);
} else {
LOG_WARN("no input capture pointer barriers found");
}
} }
void PortalInputCapture::glibThread(void *) void PortalInputCapture::glibThread(void *)

View file

@ -134,8 +134,8 @@ Server::Server(ServerConfig &config, PrimaryClient *primaryClient, deskflow::Scr
m_inputFilter->setPrimaryClient(m_primaryClient); m_inputFilter->setPrimaryClient(m_primaryClient);
// Determine if scroll lock is already set. If so, lock the cursor to the // Determine if scroll lock is already set. If so, lock the cursor to the
// primary screen // primary screen (unless the user has disabled lock to screen in config)
if (m_primaryClient->getToggleMask() & KeyModifierScrollLock) { if (!m_disableLockToScreen && (m_primaryClient->getToggleMask() & KeyModifierScrollLock)) {
LOG_NOTE("scroll lock is on, locking cursor to screen"); LOG_NOTE("scroll lock is on, locking cursor to screen");
m_lockedToScreen = true; m_lockedToScreen = true;
} }