Skip to content

Commit 3e91477

Browse files
redstrateWaqar144
authored andcommitted
Don't allow interacting or panning an unavailable remote view
Even if the remote view was unavailable for whatever reason, it was possible to pan it. This results in a *very* confused user (me, usually) when the remote view comes back online.
1 parent d876855 commit 3e91477

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ui/remoteviewwidget.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,12 @@ void RemoteViewWidget::resizeEvent(QResizeEvent *event)
962962

963963
void RemoteViewWidget::mousePressEvent(QMouseEvent *event)
964964
{
965+
// Don't allow panning or interacting with an unavailable remote view.
966+
if (!m_frame.isValid()) {
967+
QWidget::mousePressEvent(event);
968+
return;
969+
}
970+
965971
m_currentMousePosition = mapToSource(QPointF(event->pos()));
966972

967973
auto pan = [this, event]() {
@@ -1074,6 +1080,11 @@ void RemoteViewWidget::pickColor() const
10741080

10751081
void RemoteViewWidget::mouseMoveEvent(QMouseEvent *event)
10761082
{
1083+
// Don't allow panning or interacting with an unavailable remote view.
1084+
if (!m_frame.isValid()) {
1085+
return;
1086+
}
1087+
10771088
m_currentMousePosition = mapToSource(QPointF(event->pos()));
10781089

10791090
auto pan = [this, event]() {

0 commit comments

Comments
 (0)