# HG changeset patch # User John W. Eaton # Date 1368439092 14400 # Node ID d446e99f89f73d062a104ad5dfaac9d18bf842ed # Parent 025bc6b5080e6b7c0531f893e61c611d053b5b9a disallow setting selection with right mouse button in windows terminal * QWinTerminalImpl.cpp (QConsolePrivate::m_settingSelection): New member variable. (QConsolePrivate::QConsolePrivate): Initialize it. (QWinTerminalImpl::mousePressEvent, QWinTerminalImpl::mouseReleaseEvent): Set d->m_settingSelection. (QWinTerminalImpl::mouseMoveEvent): Don't do anything unless d->m_settingSelection is true. diff -r 025bc6b5080e -r d446e99f89f7 libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp --- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp Sun May 12 22:21:46 2013 -0400 +++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp Mon May 13 05:58:12 2013 -0400 @@ -171,6 +171,7 @@ QPoint m_beginSelection; QPoint m_endSelection; + bool m_settingSelection; QColor m_selectionColor; QColor m_cursorColor; @@ -202,7 +203,8 @@ QConsolePrivate::QConsolePrivate (QWinTerminalImpl* parent, const QString& cmd) : q (parent), m_command (cmd), m_hasBlinkingCursor (true), m_cursorType (BlockCursor), m_beginSelection (0, 0), - m_endSelection (0, 0), m_process (NULL), m_inWheelEvent (false) + m_endSelection (0, 0), m_settingSelection (false), + m_process (NULL), m_inWheelEvent (false) { log (NULL); @@ -1177,15 +1179,22 @@ void QWinTerminalImpl::mouseMoveEvent (QMouseEvent *event) { - d->m_endSelection = d->posToCell (event->pos ()); + if (d->m_settingSelection) + { + d->m_endSelection = d->posToCell (event->pos ()); - updateSelection (); + updateSelection (); + } } void QWinTerminalImpl::mousePressEvent (QMouseEvent *event) { if (event->button () == Qt::LeftButton) - d->m_beginSelection = d->posToCell (event->pos ()); + { + d->m_settingSelection = true; + + d->m_beginSelection = d->posToCell (event->pos ()); + } } void QWinTerminalImpl::mouseReleaseEvent (QMouseEvent *event) @@ -1195,6 +1204,8 @@ d->m_endSelection = d->posToCell (event->pos ()); updateSelection (); + + d->m_settingSelection = false; } }