Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
ba77b612
Commit
ba77b612
authored
May 18, 2013
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Qt: Seek/SoundSlider: handle hijacked released mouse state (fix #8583)
parent
0708cb56
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
13 deletions
+39
-13
modules/gui/qt4/util/input_slider.cpp
modules/gui/qt4/util/input_slider.cpp
+36
-13
modules/gui/qt4/util/input_slider.hpp
modules/gui/qt4/util/input_slider.hpp
+3
-0
No files found.
modules/gui/qt4/util/input_slider.cpp
View file @
ba77b612
...
...
@@ -199,9 +199,9 @@ void SeekSlider::updateBuffering( float f_buffering_ )
repaint
();
}
void
SeekSlider
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
void
SeekSlider
::
processReleasedButton
(
)
{
event
->
accept
()
;
if
(
!
isSliding
&&
!
isJumping
)
return
;
isSliding
=
false
;
bool
b_seekPending
=
seekLimitTimer
->
isActive
();
seekLimitTimer
->
stop
();
/* We're not sliding anymore: only last seek on release */
...
...
@@ -210,11 +210,21 @@ void SeekSlider::mouseReleaseEvent( QMouseEvent *event )
isJumping
=
false
;
return
;
}
QSlider
::
mouseReleaseEvent
(
event
);
if
(
b_seekPending
&&
isEnabled
()
)
updatePos
();
}
void
SeekSlider
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
{
if
(
event
->
button
()
!=
Qt
::
LeftButton
&&
event
->
button
()
!=
Qt
::
MidButton
)
{
QSlider
::
mouseReleaseEvent
(
event
);
return
;
}
event
->
accept
();
processReleasedButton
();
}
void
SeekSlider
::
mousePressEvent
(
QMouseEvent
*
event
)
{
/* Right-click */
...
...
@@ -273,6 +283,12 @@ void SeekSlider::mousePressEvent( QMouseEvent* event )
void
SeekSlider
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
if
(
!
(
event
->
buttons
()
&
(
Qt
::
LeftButton
|
Qt
::
MidButton
)
)
)
{
/* Handle button release when mouserelease has been hijacked by popup */
processReleasedButton
();
}
if
(
!
isEnabled
()
)
return
event
->
accept
();
if
(
isSliding
)
...
...
@@ -546,23 +562,30 @@ void SoundSlider::mousePressEvent( QMouseEvent *event )
}
}
void
SoundSlider
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
void
SoundSlider
::
processReleasedButton
(
)
{
if
(
event
->
button
()
!=
Qt
::
RightButton
)
if
(
!
b_mouseOutside
&&
value
()
!=
i_oldvalue
)
{
if
(
!
b_mouseOutside
&&
value
()
!=
i_oldvalue
)
{
emit
sliderReleased
();
setValue
(
value
()
);
emit
sliderMoved
(
value
()
);
}
isSliding
=
false
;
b_mouseOutside
=
false
;
emit
sliderReleased
();
setValue
(
value
()
);
emit
sliderMoved
(
value
()
);
}
isSliding
=
false
;
b_mouseOutside
=
false
;
}
void
SoundSlider
::
mouseReleaseEvent
(
QMouseEvent
*
event
)
{
if
(
event
->
button
()
!=
Qt
::
RightButton
)
processReleasedButton
();
}
void
SoundSlider
::
mouseMoveEvent
(
QMouseEvent
*
event
)
{
/* handle mouserelease hijacking */
if
(
isSliding
&&
(
event
->
buttons
()
&
~
Qt
::
RightButton
)
==
Qt
::
NoButton
)
processReleasedButton
();
if
(
isSliding
)
{
QRect
rect
(
paddingL
-
15
,
-
1
,
...
...
modules/gui/qt4/util/input_slider.hpp
View file @
ba77b612
...
...
@@ -71,6 +71,7 @@ protected:
virtual
QSize
sizeHint
()
const
;
void
processReleasedButton
();
bool
isAnimationRunning
()
const
;
qreal
handleOpacity
()
const
;
void
setHandleOpacity
(
qreal
opacity
);
...
...
@@ -143,6 +144,8 @@ protected:
virtual
void
mouseMoveEvent
(
QMouseEvent
*
);
virtual
void
mouseReleaseEvent
(
QMouseEvent
*
);
void
processReleasedButton
();
private:
bool
isSliding
;
/* Whether we are currently sliding by user action */
bool
b_mouseOutside
;
/* Whether the mouse is outside or inside the Widget */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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