Commit 38ce05ea authored by Martin Flöser's avatar Martin Flöser

Drop the ObscurringWindow functionality on desktop switching

Summary:
The ObscurringWindows are a hack to make it more unlikely that the
desktop wallpaper becomes visible while switching desktops. This was
introduced in 2001 with SVN revision 90111
(git d194f743).

In 2001 desktop switching was probably a costly action where it was not
possible to just reorder the desktop in one frame. Nowadays we use
mostly compositing and with compositing the ObscurringWindows are
already disabled. But even in the case that no compositing is used I
consider it as very unlikely that the desktop becomes visible during the
switching. Given that I think it's time to remove this legacy solution.

Test Plan: Compiles

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D7965
parent 475af42e
...@@ -843,60 +843,6 @@ void Workspace::slotReconfigure() ...@@ -843,60 +843,6 @@ void Workspace::slotReconfigure()
} }
} }
/**
* 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:
QList<xcb_window_t> obscuring_windows;
static QList<xcb_window_t>* cached;
static unsigned int max_cache_size;
};
QList<xcb_window_t>* ObscuringWindows::cached = nullptr;
unsigned int ObscuringWindows::max_cache_size = 0;
void ObscuringWindows::create(Client* c)
{
if (!cached)
cached = new QList<xcb_window_t>;
Xcb::Window obs_win(XCB_WINDOW_NONE, false);
if (cached->count() > 0) {
obs_win.reset(cached->first(), false);
cached->removeAll(obs_win);
obs_win.setGeometry(c->geometry());
} else {
uint32_t values[] = {XCB_PIXMAP_NONE, true};
obs_win.create(c->geometry(), XCB_WINDOW_CLASS_INPUT_OUTPUT, XCB_CW_BACK_PIXMAP | XCB_CW_OVERRIDE_REDIRECT, values);
}
uint32_t values[] = {c->frameId(), XCB_STACK_MODE_BELOW};
xcb_configure_window(connection(), obs_win, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);
obs_win.map();
obscuring_windows.append(obs_win);
}
ObscuringWindows::~ObscuringWindows()
{
max_cache_size = qMax(int(max_cache_size), obscuring_windows.count() + 4) - 1;
for (auto it = obscuring_windows.constBegin();
it != obscuring_windows.constEnd();
++it) {
xcb_unmap_window(connection(), *it);
if (cached->count() < int(max_cache_size))
cached->prepend(*it);
else
xcb_destroy_window(connection(), *it);
}
}
void Workspace::slotCurrentDesktopChanged(uint oldDesktop, uint newDesktop) void Workspace::slotCurrentDesktopChanged(uint oldDesktop, uint newDesktop)
{ {
closeActivePopup(); closeActivePopup();
...@@ -912,7 +858,6 @@ void Workspace::slotCurrentDesktopChanged(uint oldDesktop, uint newDesktop) ...@@ -912,7 +858,6 @@ void Workspace::slotCurrentDesktopChanged(uint oldDesktop, uint newDesktop)
void Workspace::updateClientVisibilityOnDesktopChange(uint oldDesktop, uint newDesktop) void Workspace::updateClientVisibilityOnDesktopChange(uint oldDesktop, uint newDesktop)
{ {
ObscuringWindows obs_wins;
for (ToplevelList::ConstIterator it = stacking_order.constBegin(); for (ToplevelList::ConstIterator it = stacking_order.constBegin();
it != stacking_order.constEnd(); it != stacking_order.constEnd();
++it) { ++it) {
...@@ -921,8 +866,6 @@ void Workspace::updateClientVisibilityOnDesktopChange(uint oldDesktop, uint newD ...@@ -921,8 +866,6 @@ void Workspace::updateClientVisibilityOnDesktopChange(uint oldDesktop, uint newD
continue; continue;
} }
if (!c->isOnDesktop(newDesktop) && c != movingClient && c->isOnCurrentActivity()) { if (!c->isOnDesktop(newDesktop) && c != movingClient && c->isOnCurrentActivity()) {
if (c->isShown(true) && c->isOnDesktop(oldDesktop) && !compositing())
obs_wins.create(c);
(c)->updateVisibility(); (c)->updateVisibility();
} }
} }
...@@ -1026,8 +969,6 @@ void Workspace::updateCurrentActivity(const QString &new_activity) ...@@ -1026,8 +969,6 @@ void Workspace::updateCurrentActivity(const QString &new_activity)
// mapping done from front to back => less exposure events // mapping done from front to back => less exposure events
//Notify::raise((Notify::Event) (Notify::DesktopChange+new_desktop)); //Notify::raise((Notify::Event) (Notify::DesktopChange+new_desktop));
ObscuringWindows obs_wins;
const QString &old_activity = Activities::self()->previous(); const QString &old_activity = Activities::self()->previous();
for (ToplevelList::ConstIterator it = stacking_order.constBegin(); for (ToplevelList::ConstIterator it = stacking_order.constBegin();
...@@ -1038,8 +979,6 @@ void Workspace::updateCurrentActivity(const QString &new_activity) ...@@ -1038,8 +979,6 @@ void Workspace::updateCurrentActivity(const QString &new_activity)
continue; continue;
} }
if (!c->isOnActivity(new_activity) && c != movingClient && c->isOnCurrentDesktop()) { if (!c->isOnActivity(new_activity) && c != movingClient && c->isOnCurrentDesktop()) {
if (c->isShown(true) && c->isOnActivity(old_activity) && !compositing())
obs_wins.create(c);
c->updateVisibility(); c->updateVisibility();
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment