Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
a123872f
Commit
a123872f
authored
Oct 14, 2011
by
Jekyll Wu
Browse files
Process the double-click event triggered by successive middle buttons
BUG: 280332
FIXED-IN: 4.9.0
parent
6fa0121b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/TerminalDisplay.cpp
View file @
a123872f
...
...
@@ -1784,20 +1784,7 @@ void TerminalDisplay::mousePressEvent(QMouseEvent* ev)
}
}
}
else
if
(
ev
->
button
()
==
Qt
::
MidButton
)
{
if
(
_mouseMarks
||
(
ev
->
modifiers
()
&
Qt
::
ShiftModifier
))
{
const
bool
appendEnter
=
ev
->
modifiers
()
&
Qt
::
ControlModifier
;
if
(
_middleClickPasteMode
==
Enum
::
PasteFromX11Selection
)
{
pasteFromX11Selection
(
appendEnter
);
}
else
if
(
_middleClickPasteMode
==
Enum
::
PasteFromClipboard
)
{
pasteFromClipboard
(
appendEnter
);
}
else
{
Q_ASSERT
(
false
);
}
}
else
{
emit
mouseSignal
(
1
,
charColumn
+
1
,
charLine
+
1
+
_scrollBar
->
value
()
-
_scrollBar
->
maximum
()
,
0
);
}
processMidButtonClick
(
ev
);
}
else
if
(
ev
->
button
()
==
Qt
::
RightButton
)
{
if
(
_mouseMarks
||
(
ev
->
modifiers
()
&
Qt
::
ShiftModifier
))
emit
configureRequest
(
ev
->
pos
());
...
...
@@ -2190,8 +2177,35 @@ void TerminalDisplay::updateLineProperties()
_lineProperties
=
_screenWindow
->
getLineProperties
();
}
void
TerminalDisplay
::
processMidButtonClick
(
QMouseEvent
*
ev
)
{
if
(
_mouseMarks
||
(
ev
->
modifiers
()
&
Qt
::
ShiftModifier
))
{
const
bool
appendEnter
=
ev
->
modifiers
()
&
Qt
::
ControlModifier
;
if
(
_middleClickPasteMode
==
Enum
::
PasteFromX11Selection
)
{
pasteFromX11Selection
(
appendEnter
);
}
else
if
(
_middleClickPasteMode
==
Enum
::
PasteFromClipboard
)
{
pasteFromClipboard
(
appendEnter
);
}
else
{
Q_ASSERT
(
false
);
}
}
else
{
int
charLine
=
0
;
int
charColumn
=
0
;
getCharacterPosition
(
ev
->
pos
(),
charLine
,
charColumn
);
emit
mouseSignal
(
1
,
charColumn
+
1
,
charLine
+
1
+
_scrollBar
->
value
()
-
_scrollBar
->
maximum
()
,
0
);
}
}
void
TerminalDisplay
::
mouseDoubleClickEvent
(
QMouseEvent
*
ev
)
{
// Yes, successive middle click can trigger this event
if
(
ev
->
button
()
==
Qt
::
MidButton
)
{
processMidButtonClick
(
ev
);
return
;
}
if
(
ev
->
button
()
!=
Qt
::
LeftButton
)
return
;
if
(
!
_screenWindow
)
return
;
...
...
src/TerminalDisplay.h
View file @
a123872f
...
...
@@ -692,6 +692,8 @@ private:
void
doPaste
(
QString
text
,
bool
appendReturn
);
void
processMidButtonClick
(
QMouseEvent
*
event
);
// the window onto the terminal screen which this display
// is currently showing.
QPointer
<
ScreenWindow
>
_screenWindow
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment