Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Graphics
Okular
Commits
1f00898a
Commit
1f00898a
authored
Nov 08, 2021
by
Albert Astals Cid
Browse files
Presentation: Don't hide toolbar if we're not really leaving the window
BUGS: 444427
parent
975bf990
Pipeline
#101121
skipped
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
part/presentationwidget.cpp
View file @
1f00898a
...
...
@@ -906,11 +906,43 @@ void PresentationWidget::resizeEvent(QResizeEvent *re)
// END Content area
}
void
PresentationWidget
::
enterEvent
(
QEvent
*
e
)
{
if
(
!
m_topBar
->
isHidden
())
{
QEnterEvent
*
ee
=
static_cast
<
QEnterEvent
*>
(
e
);
// This can happen when we exited the widget via a "tooltip" and the tooltip disappears
if
(
ee
->
y
()
>
(
m_topBar
->
height
()
+
1
))
{
showTopBar
(
false
);
}
}
QWidget
::
enterEvent
(
e
);
}
void
PresentationWidget
::
leaveEvent
(
QEvent
*
e
)
{
Q_UNUSED
(
e
)
if
(
!
m_topBar
->
isHidden
())
{
if
(
QToolTip
::
isVisible
())
{
// make sure we're not hovering over the tooltip
// because the world is sad, this works differently on Wayland and X11
// on X11 the widget under the cursor is the tooltip window
// on wayland it's the button generating the tooltip (why? no idea)
const
QWidget
*
widgetUnderCursor
=
qApp
->
widgetAt
(
QCursor
::
pos
());
if
(
widgetUnderCursor
)
{
const
QWidget
*
widgetUnderCursorWindow
=
widgetUnderCursor
->
window
();
if
(
widgetUnderCursorWindow
==
this
)
{
qDebug
()
<<
"Wayland"
;
return
;
}
else
{
const
QWidget
*
widgetUnderCursorParentWindow
=
widgetUnderCursorWindow
->
parentWidget
()
?
widgetUnderCursorWindow
->
parentWidget
()
->
window
()
:
nullptr
;
if
(
widgetUnderCursorParentWindow
==
this
)
{
qDebug
()
<<
"X11"
;
return
;
}
}
}
}
showTopBar
(
false
);
}
}
...
...
part/presentationwidget.h
View file @
1f00898a
...
...
@@ -75,6 +75,7 @@ protected:
void
mouseMoveEvent
(
QMouseEvent
*
e
)
override
;
void
paintEvent
(
QPaintEvent
*
e
)
override
;
void
resizeEvent
(
QResizeEvent
*
e
)
override
;
void
enterEvent
(
QEvent
*
e
)
override
;
void
leaveEvent
(
QEvent
*
e
)
override
;
bool
gestureEvent
(
QGestureEvent
*
e
);
...
...
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