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
Games
Amor
Commits
758ee761
Commit
758ee761
authored
Dec 25, 2019
by
Stefan Yohansson Areeira Pinto
Browse files
Prevent choose another window when change active window.
- Prevent animations on drag
parent
969220a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/amor.cpp
View file @
758ee761
...
...
@@ -640,14 +640,18 @@ void Amor::slotOffsetChanged(int off)
void
Amor
::
slotWidgetDragged
(
const
QPoint
&
delta
,
bool
release
)
{
mTimer
->
stop
();
if
(
mCurrAnim
->
frame
()
)
{
int
newPosition
=
mPosition
+
delta
.
x
();
if
(
mCurrAnim
->
totalMovement
()
+
newPosition
>
mTargetRect
.
width
()
)
{
newPosition
=
mTargetRect
.
width
()
-
mCurrAnim
->
totalMovement
();
}
else
if
(
mCurrAnim
->
totalMovement
()
+
newPosition
<
0
)
{
newPosition
=
-
mCurrAnim
->
totalMovement
();
}
mPosition
=
newPosition
;
mAmor
->
move
(
mTargetRect
.
x
()
+
mPosition
-
mCurrAnim
->
hotspot
().
x
(),
mAmor
->
y
()
);
...
...
@@ -661,29 +665,16 @@ void Amor::slotWidgetDragged(const QPoint &delta, bool release)
mConfig
.
write
();
}
}
if
(
release
)
{
mTimer
->
setSingleShot
(
true
);
mTimer
->
start
(
0
);
}
}
void
Amor
::
slotWindowActivate
(
WId
win
)
{
// We don't fit on top of this window, see if we can find another one
KWindowInfo
windowInfo
(
win
,
NET
::
WMFrameExtents
);
const
QRect
desktopArea
=
mWin
->
workArea
(
KWindowSystem
::
currentDesktop
());
if
(
windowInfo
.
frameGeometry
().
y
()
-
mCurrAnim
->
hotspot
().
y
()
+
mConfig
.
mOffset
<
desktopArea
.
y
()
)
{
for
(
const
WId
windowId
:
KWindowSystem
::
windows
())
{
windowInfo
=
KWindowInfo
(
windowId
,
NET
::
WMFrameExtents
|
NET
::
WMGeometry
);
if
(
windowInfo
.
frameGeometry
().
y
()
-
mCurrAnim
->
hotspot
().
y
()
+
mConfig
.
mOffset
<
desktopArea
.
y
()
)
{
continue
;
}
win
=
windowId
;
break
;
}
}
mTimer
->
stop
();
mNextTarget
=
win
;
...
...
Martin Tobias Holmedahl Sandsmark
@sandsmark
mentioned in merge request
!1
·
Jul 04, 2020
mentioned in merge request
!1
mentioned in merge request !1
Toggle commit list
Write
Preview
Supports
Markdown
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