From 2a6a4e9667c908586b8ebcfef45836179212c192 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Fri, 4 Feb 2011 21:44:50 +0100 Subject: [PATCH 01/15] kwin: Fix the glBlendFunc() in the shader case. The RGB values were being multiplied by the alpha value twice. --- scene_opengl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene_opengl.cpp b/scene_opengl.cpp index a4bd2fdb32..a9cb18bc04 100644 --- a/scene_opengl.cpp +++ b/scene_opengl.cpp @@ -723,7 +723,7 @@ void SceneOpenGL::Window::prepareShaderRenderStates(TextureType type, double opa if (!opaque) { glEnable(GL_BLEND); if (alpha) { - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); } else { glBlendColor((float)opacity, (float)opacity, (float)opacity, (float)opacity); glBlendFunc(GL_ONE, GL_ONE_MINUS_CONSTANT_ALPHA); From 42f4e65543e53d4dcbc52cb32d85a00ee0be7cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 5 Feb 2011 11:55:10 +0100 Subject: [PATCH 02/15] Fix a merge regression in Texture::release. Seems to be a lost change caused by rebasing moved code. --- scene_opengl_glx.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scene_opengl_glx.cpp b/scene_opengl_glx.cpp index 80759e9b30..fc7a52b1e7 100644 --- a/scene_opengl_glx.cpp +++ b/scene_opengl_glx.cpp @@ -640,7 +640,9 @@ void SceneOpenGL::Texture::init() void SceneOpenGL::Texture::release() { if (glxpixmap != None) { - glXReleaseTexImageEXT(display(), glxpixmap, GLX_FRONT_LEFT_EXT); + if (!options->glStrictBinding) { + glXReleaseTexImageEXT(display(), glxpixmap, GLX_FRONT_LEFT_EXT); + } glXDestroyPixmap(display(), glxpixmap); glxpixmap = None; } From e1ecce3da720f5334e9f146cb61a7a3cda63f025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 5 Feb 2011 11:56:48 +0100 Subject: [PATCH 03/15] Readd the hack for Xgl in findTarget. Apparently glXQueryDrawable does not work in NVIDIA blob for binding a texture from an icon. This fixes an abort, but the root cause should be found and fixed properly. --- scene_opengl_glx.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scene_opengl_glx.cpp b/scene_opengl_glx.cpp index fc7a52b1e7..4e89664f56 100644 --- a/scene_opengl_glx.cpp +++ b/scene_opengl_glx.cpp @@ -653,6 +653,17 @@ void SceneOpenGL::Texture::findTarget() unsigned int new_target = 0; if (glXQueryDrawable && glxpixmap != None) glXQueryDrawable(display(), glxpixmap, GLX_TEXTURE_TARGET_EXT, &new_target); + // HACK: this used to be a hack for Xgl. + // without this hack the NVIDIA blob aborts when trying to bind a texture from + // a pixmap icon + if (new_target == 0) { + if (NPOTTextureSupported() || + (isPowerOfTwo(mSize.width()) && isPowerOfTwo(mSize.height()))) { + new_target = GLX_TEXTURE_2D_EXT; + } else { + new_target = GLX_TEXTURE_RECTANGLE_EXT; + } + } switch(new_target) { case GLX_TEXTURE_2D_EXT: mTarget = GL_TEXTURE_2D; From 154e3e61b03d7f829a41ee4ea2c652443174b680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sat, 5 Feb 2011 12:06:32 +0100 Subject: [PATCH 04/15] Temporarily workaround regression with NVIDIA. KWin's new shaders fail with NVIDIA and present just a black screen for the ortho shader (generic shader seems to work). Temporarily disabling the shaders to force a fallback to old rendering code. Of course the bug in the shader needs to be fixed. --- lib/kwinglutils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index ff75932a39..49b94167a6 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -23,6 +23,7 @@ along with this program. If not, see . #ifdef KWIN_HAVE_OPENGL #include "kwinglobals.h" #include "kwineffects.h" +#include "kwinglplatform.h" #include "kdebug.h" #include @@ -1182,6 +1183,11 @@ GLShader *ShaderManager::loadShaderFromCode(const QByteArray &vertexSource, cons void ShaderManager::initShaders() { + // HACK: the generic shaders fail with NVIDIA's blob + // temporarily disable them to force kwin on GL 1.x profile + if (GLPlatform::instance()->driver() == Driver_NVidia) { + return; + } m_orthoShader = new GLShader(":/resources/scene-vertex.glsl", ":/resources/scene-fragment.glsl"); if (m_orthoShader->isValid()) { pushShader(SimpleShader, true); From 17dacb2290db7a6fc814cf3627f3aab723abc16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 6 Feb 2011 00:53:22 +0100 Subject: [PATCH 05/15] strip qhash::operator[] from boxswitch possibly prevents leaking ItemInfos secure some accesses (selected_window), not sure whether this caused the unreproducable crash when used as proxy in coverswitch manual fwd port of 84384efb52367e720ad82ace04ac8da668afc5ec CCBUG: 253079 --- effects/boxswitch/boxswitch.cpp | 144 ++++++++++++++++++-------------- 1 file changed, 79 insertions(+), 65 deletions(-) diff --git a/effects/boxswitch/boxswitch.cpp b/effects/boxswitch/boxswitch.cpp index 4b2a69d506..07c00b36d3 100644 --- a/effects/boxswitch/boxswitch.cpp +++ b/effects/boxswitch/boxswitch.cpp @@ -152,8 +152,10 @@ void BoxSwitchEffect::paintWindowsBox(const QRegion& region) { if ((mAnimateSwitch && !mProxyActivated) || (mProxyActivated && mProxyAnimateSwitch)) thumbnailFrame->setSelection(highlight_area); - else - thumbnailFrame->setSelection(windows[ selected_window ]->area); + else { + ItemInfo *info = windows.value(selected_window, 0); + thumbnailFrame->setSelection(info ? info->area : QRect()); + } thumbnailFrame->render(region); if ((mAnimateSwitch && !mProxyActivated) || (mProxyActivated && mProxyAnimateSwitch)) { @@ -271,8 +273,9 @@ void BoxSwitchEffect::windowGeometryShapeChanged(EffectWindow* w, const QRect& o { if (mActivated) { if (mMode == TabBoxWindowsMode || mMode == TabBoxWindowsAlternativeMode) { - if (windows.contains(w) && w->size() != old.size()) { - effects->addRepaint(windows[ w ]->area); + ItemInfo *info = windows.value( w, 0L ); + if (info && w->size() != old.size()) { + effects->addRepaint(info->area); } } else { if (w->isOnAllDesktops()) { @@ -357,24 +360,25 @@ void BoxSwitchEffect::tabBoxUpdated() } } } - if (windows.contains(selected_window)) - effects->addRepaint(windows.value(selected_window)->area); + if (ItemInfo *info = windows.value(selected_window, 0)) + effects->addRepaint(info->area); selected_window->addRepaintFull(); } setSelectedWindow(effects->currentTabBoxWindow()); - if (windows.contains(selected_window)) - effects->addRepaint(windows.value(selected_window)->area); - selected_window->addRepaintFull(); + if (ItemInfo *info = windows.value(selected_window, 0)) + effects->addRepaint(info->area); + if (selected_window) // @Martin can effects->currentTabBoxWindow() be NULL? + selected_window->addRepaintFull(); effects->addRepaint(text_area); } else if (mMode != TabBoxWindowsMode && mMode != TabBoxWindowsAlternativeMode) { // DesktopMode - if (desktops.contains(selected_desktop)) - effects->addRepaint(desktops.value(selected_desktop)->area); + if (ItemInfo *info = desktops.value(selected_desktop, 0)) + effects->addRepaint(info->area); selected_desktop = effects->currentTabBoxDesktop(); if (!mProxyActivated || mProxyShowText) thumbnailFrame->setText(effects->desktopName(selected_desktop)); - if (desktops.contains(selected_desktop)) - effects->addRepaint(desktops.value(selected_desktop)->area); + if (ItemInfo *info = desktops.value(selected_desktop, 0)) + effects->addRepaint(info->area); effects->addRepaint(text_area); if (effects->currentTabBoxDesktopList() == original_desktops) return; @@ -476,12 +480,13 @@ void BoxSwitchEffect::windowClosed(EffectWindow* w) if (w == selected_window) { setSelectedWindow(0); } - if (windows.contains(w)) { + QHash::iterator it = windows.find(w); + if (it != windows.end()) { w->refWindow(); referrencedWindows.append(w); original_windows.removeAll(w); - delete windows[ w ]; - windows.remove(w); + delete *it; *it = 0; + windows.erase( it ); effects->addRepaintFull(); } } @@ -595,11 +600,13 @@ void BoxSwitchEffect::calculateItemSizes() if (!ordered_windows.at(i)) continue; EffectWindow* w = ordered_windows.at(i); - windows[ w ] = new ItemInfo(); + ItemInfo *info = windows.value(w, 0); + if (!info) + windows[ w ] = info = new ItemInfo(); - windows[ w ]->iconFrame = effects->effectFrame(EffectFrameUnstyled, false); - windows[ w ]->iconFrame->setAlignment(Qt::AlignTop | Qt::AlignLeft); - windows[ w ]->iconFrame->setIcon(w->icon()); + info->iconFrame = effects->effectFrame(EffectFrameUnstyled, false); + info->iconFrame->setAlignment(Qt::AlignTop | Qt::AlignLeft); + info->iconFrame->setIcon(w->icon()); float moveIndex = i; if (animation && timeLine.value() < 0.5) { @@ -610,16 +617,17 @@ void BoxSwitchEffect::calculateItemSizes() } if (ordered_windows.count() % 2 == 0) moveIndex += 0.5; - windows[ w ]->area = QRect(frame_area.x() + moveIndex * item_max_size.width() + offset, - frame_area.y(), - item_max_size.width(), item_max_size.height()); - windows[ w ]->clickable = windows[ w ]->area; + info->area = QRect(frame_area.x() + moveIndex * item_max_size.width() + offset, + frame_area.y(), + item_max_size.width(), item_max_size.height()); + info->clickable = info->area; } if (ordered_windows.count() % 2 == 0) { right_window = ordered_windows.last(); } if (!highlight_is_set) { - highlight_area = windows[ selected_window ]->area; + ItemInfo *info = windows.value(selected_window, 0); + highlight_area = info ? info->area : QRect(); highlight_is_set = true; } } else { @@ -627,41 +635,46 @@ void BoxSwitchEffect::calculateItemSizes() if (!original_windows.at(i)) continue; EffectWindow* w = original_windows.at(i); - windows[ w ] = new ItemInfo(); + ItemInfo *info = windows.value(w, 0); + if (!info) + windows[ w ] = info = new ItemInfo(); - windows[ w ]->iconFrame = effects->effectFrame(EffectFrameUnstyled, false); - windows[ w ]->iconFrame->setAlignment(Qt::AlignTop | Qt::AlignLeft); - windows[ w ]->iconFrame->setIcon(w->icon()); + info->iconFrame = effects->effectFrame(EffectFrameUnstyled, false); + info->iconFrame->setAlignment(Qt::AlignTop | Qt::AlignLeft); + info->iconFrame->setIcon(w->icon()); - windows[ w ]->area = QRect(frame_area.x() + i * item_max_size.width(), - frame_area.y(), - item_max_size.width(), item_max_size.height()); - windows[ w ]->clickable = windows[ w ]->area; + info->area = QRect(frame_area.x() + i * item_max_size.width(), + frame_area.y(), + item_max_size.width(), item_max_size.height()); + info->clickable = info->area; } } } else { desktops.clear(); for (int i = 0; i < original_desktops.count(); i++) { int it = original_desktops.at(i); - desktops[ it ] = new ItemInfo(); + ItemInfo *info = desktops.value( it, 0 ); + if (!info) + desktops[ it ] = info = new ItemInfo(); - desktops[ it ]->area = QRect(frame_area.x() + i * item_max_size.width(), - frame_area.y(), - item_max_size.width(), item_max_size.height()); - desktops[ it ]->clickable = desktops[ it ]->area; + info->area = QRect(frame_area.x() + i * item_max_size.width(), + frame_area.y(), + item_max_size.width(), item_max_size.height()); + info->clickable = info->area; } } } void BoxSwitchEffect::paintWindowThumbnail(EffectWindow* w) { - if (!windows.contains(w)) + ItemInfo *info = windows.value(w, 0); + if (!info) return; WindowPaintData data(w); setPositionTransformations(data, - windows[ w ]->thumbnail, w, - windows[ w ]->area.adjusted(highlight_margin, highlight_margin, -highlight_margin, -highlight_margin), + info->thumbnail, w, + info->area.adjusted(highlight_margin, highlight_margin, -highlight_margin, -highlight_margin), Qt::KeepAspectRatio); if (animation && (w == edge_window) && (windows.size() % 2 == 1)) { @@ -698,7 +711,7 @@ void BoxSwitchEffect::paintWindowThumbnail(EffectWindow* w) // paint one part of the thumbnail effects->paintWindow(w, PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSFORMED | PAINT_WINDOW_LANCZOS, - windows[ w ]->thumbnail, data); + info->thumbnail, data); QRect secondThumbnail; @@ -733,12 +746,12 @@ void BoxSwitchEffect::paintWindowThumbnail(EffectWindow* w) } } setPositionTransformations(data, - windows[ w ]->thumbnail, w, + info->thumbnail, w, secondThumbnail.adjusted(highlight_margin, highlight_margin, -highlight_margin, -highlight_margin), Qt::KeepAspectRatio); effects->paintWindow(w, PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSFORMED | PAINT_WINDOW_LANCZOS, - windows[ w ]->thumbnail, data); + info->thumbnail, data); } else if ((windows.size() % 2 == 0) && (w == right_window)) { // in case of even number of thumbnails: // the window on the right is painted one half on left and on half on the right side @@ -779,7 +792,7 @@ void BoxSwitchEffect::paintWindowThumbnail(EffectWindow* w) data.quads = leftQuads; effects->drawWindow(w, PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSFORMED | PAINT_WINDOW_LANCZOS, - windows[ w ]->thumbnail, data); + info->thumbnail, data); // right quads are painted on left side of frame data.quads = rightQuads; @@ -788,28 +801,28 @@ void BoxSwitchEffect::paintWindowThumbnail(EffectWindow* w) (float)item_max_size.width() * 0.5 + animationOffset, frame_area.y(), item_max_size.width(), item_max_size.height()); setPositionTransformations(data, - windows[ w ]->thumbnail, w, + info->thumbnail, w, secondThumbnail.adjusted(highlight_margin, highlight_margin, -highlight_margin, -highlight_margin), Qt::KeepAspectRatio); effects->drawWindow(w, PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSFORMED | PAINT_WINDOW_LANCZOS, - windows[ w ]->thumbnail, data); + info->thumbnail, data); } else { effects->drawWindow(w, PAINT_WINDOW_OPAQUE | PAINT_WINDOW_TRANSFORMED | PAINT_WINDOW_LANCZOS, - windows[ w ]->thumbnail, data); + info->thumbnail, data); } } void BoxSwitchEffect::paintDesktopThumbnail(int iDesktop) { - if (!desktops.contains(iDesktop)) + ItemInfo *info = desktops.value(iDesktop, 0); + if (!info) return; ScreenPaintData data; QRect region; - QRect r = desktops[ iDesktop ]->area.adjusted(highlight_margin, highlight_margin, - -highlight_margin, -highlight_margin); + QRect r = info->area.adjusted(highlight_margin, highlight_margin, -highlight_margin, -highlight_margin); QSize size = QSize(displayWidth(), displayHeight()); size.scale(r.size(), Qt::KeepAspectRatio); @@ -829,7 +842,8 @@ void BoxSwitchEffect::paintDesktopThumbnail(int iDesktop) void BoxSwitchEffect::paintWindowIcon(EffectWindow* w) { - if (!windows.contains(w)) + ItemInfo *info = windows.value(w, 0); + if (!info) return; // Don't render null icons if (w->icon().isNull()) { @@ -838,24 +852,24 @@ void BoxSwitchEffect::paintWindowIcon(EffectWindow* w) int width = w->icon().width(); int height = w->icon().height(); - int x = windows[ w ]->area.x() + windows[ w ]->area.width() - width - highlight_margin; - int y = windows[ w ]->area.y() + windows[ w ]->area.height() - height - highlight_margin; + int x = info->area.x() + info->area.width() - width - highlight_margin; + int y = info->area.y() + info->area.height() - height - highlight_margin; if ((windows.size() % 2 == 0)) { if (w == right_window) { // in case of right window the icon has to be painted on the left side of the frame - x = frame_area.x() + windows[ w ]->area.width() * 0.5 - width - highlight_margin; + x = frame_area.x() + info->area.width() * 0.5 - width - highlight_margin; if (animation) { if (timeLine.value() <= 0.5) { if (direction == Left) { - x -= windows[ w ]->area.width() * timeLine.value(); + x -= info->area.width() * timeLine.value(); x = qMax(x, frame_area.x()); } else - x += windows[ w ]->area.width() * timeLine.value(); + x += info->area.width() * timeLine.value(); } else { if (direction == Left) - x += windows[ w ]->area.width() * (1.0 - timeLine.value()); + x += info->area.width() * (1.0 - timeLine.value()); else { - x -= windows[ w ]->area.width() * (1.0 - timeLine.value()); + x -= info->area.width() * (1.0 - timeLine.value()); x = qMax(x, frame_area.x()); } } @@ -866,20 +880,20 @@ void BoxSwitchEffect::paintWindowIcon(EffectWindow* w) if (animation && w == edge_window) { if (timeLine.value() < 0.5) { if (direction == Left) - x += windows[ w ]->area.width() * timeLine.value(); + x += info->area.width() * timeLine.value(); else - x -= windows[ w ]->area.width() * timeLine.value(); + x -= info->area.width() * timeLine.value(); } else { if (direction == Left) - x -= windows[ w ]->area.width() * (1.0 - timeLine.value()); + x -= info->area.width() * (1.0 - timeLine.value()); else - x += windows[ w ]->area.width() * (1.0 - timeLine.value()); + x += info->area.width() * (1.0 - timeLine.value()); } } } - windows[ w ]->iconFrame->setPosition(QPoint(x, y)); - windows[ w ]->iconFrame->render(infiniteRegion(), 1.0, 0.75); + info->iconFrame->setPosition(QPoint(x, y)); + info->iconFrame->render(infiniteRegion(), 1.0, 0.75); } void* BoxSwitchEffect::proxy() From fc54bdfe8995a1298c0350f3b003b1ebc071a14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 6 Feb 2011 09:27:30 +0100 Subject: [PATCH 06/15] Unbind shader before copying pixels to back buffer. This solves the regression with NVIDIA drivers resulting in a black screen. Apparently NVIDIA does not support glXCopySubBuffer and the copying of pixels fails with a shader bound. So unbinding the shader before copying the pixels and rebinding the shader afterwards resolves the issue. This allows to remove the temporary hack to make NVIDIA work, again. --- lib/kwinglutils.cpp | 5 ----- scene_opengl_glx.cpp | 11 +++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index 49b94167a6..a01d1788a6 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -1183,11 +1183,6 @@ GLShader *ShaderManager::loadShaderFromCode(const QByteArray &vertexSource, cons void ShaderManager::initShaders() { - // HACK: the generic shaders fail with NVIDIA's blob - // temporarily disable them to force kwin on GL 1.x profile - if (GLPlatform::instance()->driver() == Driver_NVidia) { - return; - } m_orthoShader = new GLShader(":/resources/scene-vertex.glsl", ":/resources/scene-fragment.glsl"); if (m_orthoShader->isValid()) { pushShader(SimpleShader, true); diff --git a/scene_opengl_glx.cpp b/scene_opengl_glx.cpp index 4e89664f56..edff792ab8 100644 --- a/scene_opengl_glx.cpp +++ b/scene_opengl_glx.cpp @@ -587,6 +587,13 @@ void SceneOpenGL::flushBuffer(int mask, QRegion damage) glXCopySubBuffer(display(), glxbuffer, r.x(), y, r.width(), r.height()); } } else { + // if a shader is bound, copy pixels results in a black screen + // therefore unbind the shader and restore after copying the pixels + GLint shader = 0; + if (ShaderManager::instance()->isShaderBound()) { + glGetIntegerv(GL_CURRENT_PROGRAM, &shader); + glUseProgram(0); + } // no idea why glScissor() is used, but Compiz has it and it doesn't seem to hurt glEnable(GL_SCISSOR_TEST); glDrawBuffer(GL_FRONT); @@ -608,6 +615,10 @@ void SceneOpenGL::flushBuffer(int mask, QRegion damage) glBitmap(0, 0, 0, 0, -xpos, -ypos, NULL); // move position back to 0,0 glDrawBuffer(GL_BACK); glDisable(GL_SCISSOR_TEST); + // rebind previously bound shader + if (ShaderManager::instance()->isShaderBound()) { + glUseProgram(shader); + } } } else { waitSync(); From a3328bd44907281fcb0b93a796afc483674a8b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 6 Feb 2011 16:36:16 +0100 Subject: [PATCH 07/15] export WindowGeometry config symbols BUG: 265272 --- effects/configs_builtins.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/effects/configs_builtins.cpp b/effects/configs_builtins.cpp index 6861d5c9cb..6f0b8e32ff 100644 --- a/effects/configs_builtins.cpp +++ b/effects/configs_builtins.cpp @@ -32,6 +32,7 @@ along with this program. If not, see . #include "resize/resize_config.h" #include "showfps/showfps_config.h" #include "thumbnailaside/thumbnailaside_config.h" +#include "windowgeometry/windowgeometry_config.h" #include "zoom/zoom_config.h" #ifdef KWIN_HAVE_OPENGL_COMPOSITING @@ -67,6 +68,7 @@ KWIN_EFFECT_CONFIG_MULTIPLE(builtins, KWIN_EFFECT_CONFIG_SINGLE(showfps, ShowFpsEffectConfig) KWIN_EFFECT_CONFIG_SINGLE(translucency, TranslucencyEffectConfig) KWIN_EFFECT_CONFIG_SINGLE(thumbnailaside, ThumbnailAsideEffectConfig) + KWIN_EFFECT_CONFIG_SINGLE( windowgeometry, WindowGeometryConfig ) KWIN_EFFECT_CONFIG_SINGLE(zoom, ZoomEffectConfig) #ifdef KWIN_HAVE_OPENGL_COMPOSITING From 51ee04837f5aa40257df3db5e0ab68e5ab371c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 6 Feb 2011 16:39:41 +0100 Subject: [PATCH 08/15] whitespace: da3a0ad39be3cd5529b3d8b259065cd26e631a0b the other whitespace... --- effects/configs_builtins.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/effects/configs_builtins.cpp b/effects/configs_builtins.cpp index 6f0b8e32ff..b37ba585b8 100644 --- a/effects/configs_builtins.cpp +++ b/effects/configs_builtins.cpp @@ -68,7 +68,7 @@ KWIN_EFFECT_CONFIG_MULTIPLE(builtins, KWIN_EFFECT_CONFIG_SINGLE(showfps, ShowFpsEffectConfig) KWIN_EFFECT_CONFIG_SINGLE(translucency, TranslucencyEffectConfig) KWIN_EFFECT_CONFIG_SINGLE(thumbnailaside, ThumbnailAsideEffectConfig) - KWIN_EFFECT_CONFIG_SINGLE( windowgeometry, WindowGeometryConfig ) + KWIN_EFFECT_CONFIG_SINGLE(windowgeometry, WindowGeometryConfig) KWIN_EFFECT_CONFIG_SINGLE(zoom, ZoomEffectConfig) #ifdef KWIN_HAVE_OPENGL_COMPOSITING From eba4392272f99e18a0f77733f3d956d4944f6296 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 6 Feb 2011 16:42:45 +0100 Subject: [PATCH 09/15] Update deco buttons when allowed actions change BUG: 246442 --- client.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.cpp b/client.cpp index f3132e050b..027e41b23e 100644 --- a/client.cpp +++ b/client.cpp @@ -2148,7 +2148,8 @@ void Client::updateAllowedActions(bool force) return; // TODO: This could be delayed and compressed - It's only for pagers etc. anyway info->setAllowedActions(allowed_actions); - // TODO: This should also tell the decoration, so that it can update the buttons + if (decoration) + decoration->reset(KDecoration::SettingButtons); } void Client::autoRaise() From 7b5683f74bc71e4c824c1c48e1d32f1a7bac54f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 6 Feb 2011 16:50:47 +0100 Subject: [PATCH 10/15] explicitly trigger repaint on highlight window property changes forward port of 17934f79fa691a52efc4df142e5e8712634ad21a --- effects/highlightwindow/highlightwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/effects/highlightwindow/highlightwindow.cpp b/effects/highlightwindow/highlightwindow.cpp index 218f56af4f..1e9f15e427 100644 --- a/effects/highlightwindow/highlightwindow.cpp +++ b/effects/highlightwindow/highlightwindow.cpp @@ -240,6 +240,7 @@ void HighlightWindowEffect::prepareHighlighting() foreach (EffectWindow * w, effects->stackingOrder()) if (!m_windowOpacity.contains(w)) // Just in case we are still finishing from last time m_windowOpacity[w] = isInitiallyHidden(w) ? 0.0 : 1.0; + m_highlightedWindows.at(0)->addRepaintFull(); } void HighlightWindowEffect::finishHighlighting() @@ -247,6 +248,8 @@ void HighlightWindowEffect::finishHighlighting() m_finishing = true; m_monitorWindow = NULL; m_highlightedWindows.clear(); + if (!m_windowOpacity.isEmpty()) + m_windowOpacity.constBegin().key()->addRepaintFull(); } } // namespace From c5130993543fb297c62d285ef678291755b65afb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 6 Feb 2011 16:54:20 +0100 Subject: [PATCH 11/15] logout effect: remove deleted windows from list fwd port of 04831d049f73bb38694d7cecc4ea170b2a26a149 --- effects/logout/logout.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/effects/logout/logout.cpp b/effects/logout/logout.cpp index 8eaea94f01..3a9588e1b2 100644 --- a/effects/logout/logout.cpp +++ b/effects/logout/logout.cpp @@ -318,6 +318,7 @@ void LogoutEffect::windowClosed(EffectWindow* w) void LogoutEffect::windowDeleted(EffectWindow* w) { + windows.removeAll(w); ignoredWindows.removeAll(w); if (w == logoutWindow) logoutWindow = NULL; From b65f05f42b28f4b0566267b9d5e7db0309a0c1a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Wed, 2 Feb 2011 16:39:45 +0100 Subject: [PATCH 12/15] sanitize GL version stringlist BUG: 265131 --- lib/kwinglutils.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/kwinglutils.cpp b/lib/kwinglutils.cpp index a01d1788a6..bc2856b27b 100644 --- a/lib/kwinglutils.cpp +++ b/lib/kwinglutils.cpp @@ -94,9 +94,10 @@ void initGL() // Get OpenGL version QString glversionstring = QString((const char*)glGetString(GL_VERSION)); QStringList glversioninfo = glversionstring.left(glversionstring.indexOf(' ')).split('.'); + while (glversioninfo.count() < 3) + glversioninfo << "0"; #ifndef KWIN_HAVE_OPENGLES - glVersion = MAKE_GL_VERSION(glversioninfo[0].toInt(), glversioninfo[1].toInt(), - glversioninfo.count() > 2 ? glversioninfo[2].toInt() : 0); + glVersion = MAKE_GL_VERSION(glversioninfo[0].toInt(), glversioninfo[1].toInt(), glversioninfo[2].toInt()); #endif // Get list of supported OpenGL extensions glExtensions = QString((const char*)glGetString(GL_EXTENSIONS)).split(' '); From 95c8ba203588bad26f38326fbbb2d8f3058e1295 Mon Sep 17 00:00:00 2001 From: Script Kiddy Date: Mon, 7 Feb 2011 07:07:14 +0100 Subject: [PATCH 13/15] SVN_SILENT made messages (.desktop file) --- effects/invert/invert.desktop | 2 +- effects/login/login.desktop | 2 +- effects/logout/logout.desktop | 2 +- effects/taskbarthumbnail/taskbarthumbnail.desktop | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/effects/invert/invert.desktop b/effects/invert/invert.desktop index 3189bf4430..5344ae22c7 100644 --- a/effects/invert/invert.desktop +++ b/effects/invert/invert.desktop @@ -125,7 +125,7 @@ Comment[nn]=Snu fargane på skrivebordet og vindauge Comment[pa]=ਡੈਸਕਟਾਪ ਅਤੇ ਵਿੰਡੋ ਦੇ ਰੰਗ ਬਦਲੋ Comment[pl]=Odwrócenie kolorów pulpitu i okien Comment[pt]=Inverte a cor do ecrã e das janelas -Comment[pt_BR]=Inverte as cores da área de trabalho e das janelas +Comment[pt_BR]=Inverte as cores das janelas e da área de trabalho Comment[ro]=Inversează culoarea biroului și a ferestrelor Comment[ru]=Инверсия цвета рабочего стола и окон Comment[si]=වැඩතල හා කවුළු වල වර්‍ණ යටිකුරු කරන්න diff --git a/effects/login/login.desktop b/effects/login/login.desktop index 6d08e38f49..ff9b981859 100644 --- a/effects/login/login.desktop +++ b/effects/login/login.desktop @@ -126,7 +126,7 @@ Comment[nn]=Ton inn skrivebordet ved innlogging Comment[pa]=ਜਦੋਂ ਲਾਗਇਨ ਕਰਨਾ ਹੋਵੇ ਤਾਂ ਹੌਲੀ ਹੌਲੀ ਡੈਸਕਟਾਪ ਨੂੰ ਫਿੱਕਾ ਕਰੋ Comment[pl]=Płynne rozjaśnienie do pulpitu podczas logowania Comment[pt]=Desvanecer suavemente para o ecrã ao ligar-se -Comment[pt_BR]=Suaviza o desaparecimento da área de trabalho ao fazer login +Comment[pt_BR]=Suaviza o desaparecimento da área de trabalho ao fazer a autenticação Comment[ro]=Estompează lin biroul la autentificare Comment[ru]=Плавное проявление рабочего стола при входе в систему Comment[si]=පිවිසීමේදී වැඩතලයට සුමුදු අවපැහැකිරීමක් ලබාදෙන්න diff --git a/effects/logout/logout.desktop b/effects/logout/logout.desktop index 9c3cfd7308..198adc72c6 100644 --- a/effects/logout/logout.desktop +++ b/effects/logout/logout.desktop @@ -126,7 +126,7 @@ Comment[nn]=Ton ut skrivebordet ved utlogging Comment[pa]=ਜਦੋਂ ਲਾਗ-ਆਉਟ ਡਾਈਲਾਗ ਵੇਖਾਉਣਾ ਹੋਵੇ ਤਾਂ ਡੈਸਕਟਾਪ ਨੂੰ ਡਿ-ਸੈਚੂਰੇਟ ਕਰੋ Comment[pl]=Zmniejszenie nasycenia kolorów podczas pokazywania okna wylogowania Comment[pt]=Reduzir a saturação do ecrã ao mostrar a janela de fim de sessão -Comment[pt_BR]=Reduz a saturação da área de trabalho ao mostrar o diálogo de logout +Comment[pt_BR]=Reduz a saturação da área de trabalho ao mostrar o diálogo de desligamento Comment[ro]=Desaturează biroul la afișarea dialogului de ieșire Comment[ru]=Плавное обесцвечивание экрана при выходе из сеанса Comment[si]=පිටවීමෙ සංවාදය පෙන්වන විට වැඩතලය අසංතෘප්ත කරන්න diff --git a/effects/taskbarthumbnail/taskbarthumbnail.desktop b/effects/taskbarthumbnail/taskbarthumbnail.desktop index e443586e17..02c16af57b 100644 --- a/effects/taskbarthumbnail/taskbarthumbnail.desktop +++ b/effects/taskbarthumbnail/taskbarthumbnail.desktop @@ -120,7 +120,7 @@ Comment[nn]=Vis miniatyrbilete av vindauge når peikaren er over ikona på oppg Comment[pa]=ਵਿੰਡੋ ਥੰਮਨੇਲ ਵੇਖੋ, ਜਦੋਂ ਕਿ ਹੋਵਰਿੰਗ ਟਾਸਕਬਾਰ ਐਂਟਰੀ ਉੱਤੇ ਹੋਵੇ। Comment[pl]=Pokazuje miniaturki okien, kiedy kursor znajduje się na ich pozycji w pasku zadań Comment[pt]=Mostrar as miniaturas das janelas ao passar sobre os elementos da barra de tarefas -Comment[pt_BR]=Mostra miniaturas das janelas quando o cursor passar sobre os itens da barra de tarefas +Comment[pt_BR]=Mostra miniaturas das janelas quando o ponteiro do mouse passar sobre os itens da barra de tarefas Comment[ro]=Afișează miniaturile ferestrelor cînd cursorul planează deasupra înregistrărilor din bara de procese Comment[ru]=Показывать миниатюру окна при наведении мышью на элемент панели задач Comment[si]=ක්‍රියා තීරු ඇතුළත්කිරීම් වලට ඉහළින් හැසිරෙන විට කවුළු කුඩා රූ පෙන්වන්න From e1c04b7c3e2519af5c0f3e85a7f8e5bd8eeca16b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 7 Feb 2011 19:19:51 +0100 Subject: [PATCH 14/15] Add shortcuts for new quick tile modes. Shortcuts for quick tile to the quarters of the screen added in 4.6. Thanks to Arthur Arlt for implementing this feature. FEATURE: 265461 FIXED-IN: 4.7.0 CCMAIL: arre2000@gmx.de --- kwinbindings.cpp | 8 ++++++++ placement.cpp | 32 ++++++++++++++++++++++++++++++++ workspace.h | 4 ++++ 3 files changed, 44 insertions(+) diff --git a/kwinbindings.cpp b/kwinbindings.cpp index fd23915a16..0a2c1fc290 100644 --- a/kwinbindings.cpp +++ b/kwinbindings.cpp @@ -122,6 +122,14 @@ DEF2("Window Quick Tile Left", I18N_NOOP("Quick Tile Window to the Left"), 0, slotWindowQuickTileLeft()); DEF2("Window Quick Tile Right", I18N_NOOP("Quick Tile Window to the Right"), 0, slotWindowQuickTileRight()); +DEF2("Window Quick Tile Top Left", I18N_NOOP("Quick Tile Window to the Top Left"), + 0, slotWindowQuickTileTopLeft()); +DEF2("Window Quick Tile Bottom Left", I18N_NOOP("Quick Tile Window to the Bottom Left"), + 0, slotWindowQuickTileBottomLeft()); +DEF2("Window Quick Tile Top Right", I18N_NOOP("Quick Tile Window to the Top Right"), + 0, slotWindowQuickTileTopRight()); +DEF2("Window Quick Tile Bottom Right", I18N_NOOP("Quick Tile Window to the Bottom Right"), + 0, slotWindowQuickTileBottomRight()); DEF2("Switch Window Up", I18N_NOOP("Switch to Window Above"), Qt::META + Qt::ALT + Qt::Key_Up, slotSwitchWindowUp()); DEF2("Switch Window Down", I18N_NOOP("Switch to Window Below"), diff --git a/placement.cpp b/placement.cpp index a578803864..0f3d4d3926 100644 --- a/placement.cpp +++ b/placement.cpp @@ -700,6 +700,38 @@ void Workspace::slotWindowQuickTileRight() active_client->setQuickTileMode(QuickTileRight, true); } +void Workspace::slotWindowQuickTileTopLeft() +{ + if (!active_client) { + return; + } + active_client->setQuickTileMode(QuickTileTopLeft, true); +} + +void Workspace::slotWindowQuickTileTopRight() +{ + if (!active_client) { + return; + } + active_client->setQuickTileMode(QuickTileTopRight, true); +} + +void Workspace::slotWindowQuickTileBottomLeft() +{ + if (!active_client) { + return; + } + active_client->setQuickTileMode(QuickTileBottomLeft, true); +} + +void Workspace::slotWindowQuickTileBottomRight() +{ + if (!active_client) { + return; + } + active_client->setQuickTileMode(QuickTileBottomRight, true); +} + int Workspace::packPositionLeft(const Client* cl, int oldx, bool left_edge) const { int newx = clientArea(MovementArea, cl).left(); diff --git a/workspace.h b/workspace.h index 34ca651f21..fe97c776c4 100644 --- a/workspace.h +++ b/workspace.h @@ -764,6 +764,10 @@ public slots: void slotWindowShrinkVertical(); void slotWindowQuickTileLeft(); void slotWindowQuickTileRight(); + void slotWindowQuickTileTopLeft(); + void slotWindowQuickTileTopRight(); + void slotWindowQuickTileBottomLeft(); + void slotWindowQuickTileBottomRight(); void slotWalkThroughDesktops(); void slotWalkBackThroughDesktops(); From 54a700ab05a4d091153a395620265cc6c09a3b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 7 Feb 2011 19:57:13 +0100 Subject: [PATCH 15/15] Update HACKING file to kdelibs coding style. The complete HACKING file needs a rewrite... --- HACKING | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/HACKING b/HACKING index fc9e97e94a..e2ea805889 100644 --- a/HACKING +++ b/HACKING @@ -168,35 +168,9 @@ there is e.g. an extensive section related to window management). Coding style: ============= -There are these rules for patches for KWin: +KWin follows the kdelibs coding style. See: http://techbase.kde.org/Policies/Kdelibs_Coding_Style -- the code should be relatively nice and clean. Seriously. Rationale: Any messy code can be hard to comprehend, -but if the code is in a window manager it will be twice as difficult. - -- unless the functionality of the code is obvious, there should be either at least a short comment explaining -what it does, or it should be obvious from the commit log. If there's a hack needed, if there's a potentional -problem, if something is just a temporary fix, say so. Comments like "this clever trick is necessary" -don't count. See above for rationale. I needed more than two years to understand all of KWin, -and there were parts I never got and had to rewrite in order to fix a problem with them. - -- indentation is 4 spaces, not tabs. Rationale: The code looks like a mess if this is not consistent. - -- { and } enclosing a block are aligned with the block, neither with the above level nor there is any -trailing { (i.e. { and } are indented in the same column like the code they surround). See above for rationale. -If this feel weird or whatever, put them wherever you want first and when the changes are done, check -"svn diff" and fix it. If I can handle about half a dozen different formatting styles when working -on various parts of KDE, this shouldn't be that much work for you (and yes, I've even done -the "fix-before-submit" thing). - -- there is not space before (, i.e. it's "foo(", not "foo (". Rationale: This makes it simpler to grep for functions. - -- a null pointer is NULL, not a zero. Not that I really insist on this one, but the only reason for using 0 -is being way too lazy to type. Rationale: NULL says it's a pointer, and with many compilers it actually is a pointer, -making it possible to detect some mistakes. - -That's all. Bonus points if you try to follow the existing coding style in general, but I don't think -I really care about the rest, as long as these rules are followed. If I find out I care about more, -I'll add them here. +The source repository was reformatted with git commit 4fd08556a1702462335f4f1307da663c2c54b2c2 Branches: