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
Plasma
KWin
Commits
fa92aef9
Commit
fa92aef9
authored
Jan 22, 2021
by
Xaver Hugl
Browse files
Move the geometry restore stuff for fullscreen into a new method
parent
3305089a
Changes
2
Hide whitespace changes
Inline
Side-by-side
abstract_client.cpp
View file @
fa92aef9
...
...
@@ -999,6 +999,9 @@ void AbstractClient::finishMoveResize(bool cancel)
}
checkScreen
();
// needs to be done because clientFinishUserMovedResized has not yet re-activated online alignment
if
(
screen
()
!=
moveResizeStartScreen
())
{
if
(
isFullScreen
())
{
updateGeometryRestoresForFullscreen
();
}
workspace
()
->
sendClientToScreen
(
this
,
screen
());
// checks rule validity
if
(
maximizeMode
()
!=
MaximizeRestore
)
{
checkWorkspacePosition
();
...
...
@@ -3109,23 +3112,7 @@ void AbstractClient::sendToScreen(int newScreen)
}
if
(
isFullScreen
())
{
QRect
newFullScreenGeometryRestore
=
screenArea
;
if
(
!
(
maximizeMode
()
&
MaximizeVertical
))
{
newFullScreenGeometryRestore
.
setHeight
(
geometryRestore
().
height
());
}
if
(
!
(
maximizeMode
()
&
MaximizeHorizontal
))
{
newFullScreenGeometryRestore
.
setWidth
(
geometryRestore
().
width
());
}
newFullScreenGeometryRestore
.
setSize
(
newFullScreenGeometryRestore
.
size
().
boundedTo
(
screenArea
.
size
()));
QSize
move
=
(
screenArea
.
size
()
-
newFullScreenGeometryRestore
.
size
())
/
2
;
newFullScreenGeometryRestore
.
translate
(
move
.
width
(),
move
.
height
());
QRect
newGeometryRestore
=
QRect
(
screenArea
.
topLeft
(),
geometryRestore
().
size
().
boundedTo
(
screenArea
.
size
()));
move
=
(
screenArea
.
size
()
-
newGeometryRestore
.
size
())
/
2
;
newGeometryRestore
.
translate
(
move
.
width
(),
move
.
height
());
setFullscreenGeometryRestore
(
newFullScreenGeometryRestore
);
setGeometryRestore
(
newGeometryRestore
);
updateGeometryRestoresForFullscreen
();
checkWorkspacePosition
(
oldGeom
);
}
else
{
// align geom_restore - checkWorkspacePosition operates on it
...
...
@@ -3149,6 +3136,28 @@ void AbstractClient::sendToScreen(int newScreen)
(
*
it
)
->
sendToScreen
(
newScreen
);
}
void
AbstractClient
::
updateGeometryRestoresForFullscreen
()
{
QRect
screenArea
=
workspace
()
->
clientArea
(
MaximizeArea
,
screen
(),
desktop
());
QRect
newFullScreenGeometryRestore
=
screenArea
;
if
(
!
(
maximizeMode
()
&
MaximizeVertical
))
{
newFullScreenGeometryRestore
.
setHeight
(
geometryRestore
().
height
());
}
if
(
!
(
maximizeMode
()
&
MaximizeHorizontal
))
{
newFullScreenGeometryRestore
.
setWidth
(
geometryRestore
().
width
());
}
newFullScreenGeometryRestore
.
setSize
(
newFullScreenGeometryRestore
.
size
().
boundedTo
(
screenArea
.
size
()));
QSize
move
=
(
screenArea
.
size
()
-
newFullScreenGeometryRestore
.
size
())
/
2
;
newFullScreenGeometryRestore
.
translate
(
move
.
width
(),
move
.
height
());
QRect
newGeometryRestore
=
QRect
(
screenArea
.
topLeft
(),
geometryRestore
().
size
().
boundedTo
(
screenArea
.
size
()));
move
=
(
screenArea
.
size
()
-
newGeometryRestore
.
size
())
/
2
;
newGeometryRestore
.
translate
(
move
.
width
(),
move
.
height
());
setFullscreenGeometryRestore
(
newFullScreenGeometryRestore
);
setGeometryRestore
(
newGeometryRestore
);
}
void
AbstractClient
::
checkWorkspacePosition
(
QRect
oldGeometry
,
int
oldDesktop
,
QRect
oldClientGeometry
)
{
if
(
isDock
()
||
isDesktop
()
||
!
isPlaceable
())
{
...
...
abstract_client.h
View file @
fa92aef9
...
...
@@ -453,6 +453,7 @@ public:
*/
bool
isSpecialWindow
()
const
;
void
sendToScreen
(
int
screen
);
void
updateGeometryRestoresForFullscreen
();
const
QKeySequence
&
shortcut
()
const
{
return
_shortcut
;
}
...
...
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