Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
KWin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
19
Issues
19
List
Boards
Labels
Service Desk
Milestones
Merge Requests
58
Merge Requests
58
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
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
Plasma
KWin
Commits
d194f743
Commit
d194f743
authored
Apr 03, 2001
by
Luboš Luňák
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce wallpaper repaints during desktop switching.
svn path=/trunk/kdebase/kwin/; revision=90111
parent
67f1c999
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
1 deletion
+69
-1
workspace.cpp
workspace.cpp
+69
-1
No files found.
workspace.cpp
View file @
d194f743
...
...
@@ -2032,6 +2032,71 @@ void Workspace::refresh() {
XFlush
(
qt_xdisplay
());
}
/*!
During virt. desktop switching, desktop areas covered by windows that are
going to be hidden are first obscured by new windows with no background
( i.e. transparent ) placed right below the windows. These invisible windows
are removed after the switch is complete.
Reduces desktop ( wallpaper ) repaints during desktop switching
*/
class
ObscuringWindows
{
public:
~
ObscuringWindows
();
void
create
(
Client
*
c
);
private:
QValueList
<
Window
>
obscuring_windows
;
static
QValueList
<
Window
>*
cached
;
static
unsigned
int
max_cache_size
;
};
QValueList
<
Window
>*
ObscuringWindows
::
cached
=
NULL
;
unsigned
int
ObscuringWindows
::
max_cache_size
=
0
;
void
ObscuringWindows
::
create
(
Client
*
c
)
{
if
(
cached
==
NULL
)
cached
=
new
QValueList
<
Window
>
;
Window
obs_win
;
XWindowChanges
chngs
;
int
mask
=
CWSibling
|
CWStackMode
;
if
(
cached
->
count
()
>
0
)
{
cached
->
remove
(
obs_win
=
cached
->
first
());
chngs
.
x
=
c
->
x
();
chngs
.
y
=
c
->
y
();
chngs
.
width
=
c
->
width
();
chngs
.
height
=
c
->
height
();
mask
|=
CWX
|
CWY
|
CWWidth
|
CWHeight
;
}
else
{
XSetWindowAttributes
a
;
a
.
background_pixmap
=
None
;
a
.
override_redirect
=
True
;
obs_win
=
XCreateWindow
(
qt_xdisplay
(),
qt_xrootwin
(),
c
->
x
(),
c
->
y
(),
c
->
width
(),
c
->
height
(),
0
,
CopyFromParent
,
InputOutput
,
CopyFromParent
,
CWBackPixmap
|
CWOverrideRedirect
,
&
a
);
}
chngs
.
sibling
=
c
->
winId
();
chngs
.
stack_mode
=
Below
;
XConfigureWindow
(
qt_xdisplay
(),
obs_win
,
mask
,
&
chngs
);
XMapWindow
(
qt_xdisplay
(),
obs_win
);
obscuring_windows
.
append
(
obs_win
);
}
ObscuringWindows
::~
ObscuringWindows
()
{
max_cache_size
=
QMAX
(
max_cache_size
,
obscuring_windows
.
count
()
+
4
)
-
1
;
for
(
QValueList
<
Window
>::
ConstIterator
it
=
obscuring_windows
.
begin
();
it
!=
obscuring_windows
.
end
();
++
it
)
{
XUnmapWindow
(
qt_xdisplay
(),
*
it
);
if
(
cached
->
count
()
<
max_cache_size
)
cached
->
prepend
(
*
it
);
else
XDestroyWindow
(
qt_xdisplay
(),
*
it
);
}
}
/*!
Sets the current desktop to \a new_desktop
...
...
@@ -2056,9 +2121,12 @@ void Workspace::setCurrentDesktop( int new_desktop ){
mapping done from front to back => less exposure events
*/
Events
::
raise
((
Events
::
Event
)
(
Events
::
DesktopChange
+
new_desktop
));
ObscuringWindows
obs_wins
;
for
(
ClientList
::
ConstIterator
it
=
stacking_order
.
begin
();
it
!=
stacking_order
.
end
();
++
it
)
{
if
(
(
*
it
)
->
isVisible
()
&&
!
(
*
it
)
->
isOnDesktop
(
new_desktop
)
)
{
obs_wins
.
create
(
*
it
);
(
*
it
)
->
hide
();
unmapList
+=
(
*
it
);
}
...
...
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