diff --git a/.kdev4/kwayland-integration.kdev4 b/.kdev4/kwayland-integration.kdev4 new file mode 100644 --- /dev/null +++ b/.kdev4/kwayland-integration.kdev4 @@ -0,0 +1,16 @@ +[CMake] +Build Directory Count=1 +Current Build Directory Index-Host System=0 + +[CMake][CMake Build Directory 0] +Build Directory Path=/home/meven/kde/build/kwayland-integration +Build Type=RelWithDebInfo +CMake Binary=/usr/bin/cmake +CMake Executable=/usr/bin/cmake +Environment Profile= +Extra Arguments= +Install Directory=/home/meven/kde/usr +Runtime=Host System + +[Project] +VersionControlSupport=kdevgit diff --git a/CMakeLists.txt.user b/CMakeLists.txt.user new file mode 100644 --- /dev/null +++ b/CMakeLists.txt.user @@ -0,0 +1,201 @@ + + + + + + EnvironmentId + {eb5a2809-eb9b-4867-9964-f9993a3a95e5} + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + true + false + true + + Cpp + + CppGlobal + + + + QmlJS + + QmlJSGlobal + + + 2 + UTF-8 + false + 4 + false + 80 + true + true + 1 + true + false + 0 + true + true + 0 + 8 + true + 1 + true + true + true + false + + + + ProjectExplorer.Project.PluginSettings + + + true + + + + ProjectExplorer.Project.Target.0 + + Desktop + Desktop + {34d798d6-01ae-4525-be4f-1cf901cf0ae3} + 0 + 0 + 0 + + + CMAKE_BUILD_TYPE:STRING=RelWithDebInfo + + /home/meven/kde/build/kwayland-integration + + + + + all + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Build + + ProjectExplorer.BuildSteps.Build + + + + + + clean + + true + CMake Build + + CMakeProjectManager.MakeStep + + 1 + Clean + + ProjectExplorer.BuildSteps.Clean + + 2 + false + + Release with Debug Information + Release with Debug Information + CMakeProjectManager.CMakeBuildConfiguration + + 1 + + + 0 + Déploiement + + ProjectExplorer.BuildSteps.Deploy + + 1 + Deploy Configuration + + ProjectExplorer.DefaultDeployConfiguration + + 1 + + + false + false + 1000 + + true + + false + false + false + false + true + 0.01 + 10 + true + 1 + 25 + + 1 + true + false + true + valgrind + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + + 2 + + idleTest + + CMakeProjectManager.CMakeRunConfiguration.idleTest +/home/meven/kde/src/kwayland-integration/autotests/idletime/ + + 3768 + false + true + false + false + true + + /home/meven/kde/build/kwayland-integration/bin + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 20 + + + Version + 20 + + diff --git a/kwayland-integration.kdev4 b/kwayland-integration.kdev4 new file mode 100644 --- /dev/null +++ b/kwayland-integration.kdev4 @@ -0,0 +1,4 @@ +[Project] +CreatedFrom=CMakeLists.txt +Manager=KDevCMakeManager +Name=kwayland-integration diff --git a/src/windowsystem/windowsystem.cpp b/src/windowsystem/windowsystem.cpp --- a/src/windowsystem/windowsystem.cpp +++ b/src/windowsystem/windowsystem.cpp @@ -162,10 +162,32 @@ QPixmap WindowSystem::icon(WId win, int width, int height, bool scale, int flags) { - Q_UNUSED(scale) Q_UNUSED(flags) + + // Since width can be any arbitrary size, but the icons cannot, + // take the nearest value for best results (ignoring 22 pixel + // icons as they don't exist for apps): + int iconWidth; + if (width < 24) { + iconWidth = 16; + } else if (width < 40) { + iconWidth = 32; + } else if (width < 56) { + iconWidth = 48; + } else if (width < 96) { + iconWidth = 64; + } else if (width < 192) { + iconWidth = 128; + } else { + iconWidth = 256; + } + if (PlasmaWindow *w = window(win)) { - return w->icon().pixmap(width, height); + QPixmap pixmap = w->icon().pixmap(iconWidth, iconWidth); + if (scale) { + pixmap.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + } + return pixmap; } return QPixmap(); }