Bug 310622 - Tabbox previews are missing
Summary: Tabbox previews are missing
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: tabbox (other bugs)
Version First Reported In: 4.9.80
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL: https://git.reviewboard.kde.org/r/122...
Keywords:
Depends on:
Blocks: 343081
  Show dependency treegraph
 
Reported: 2012-11-24 21:38 UTC by Elias Probst
Modified: 2015-01-21 08:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:
mgraesslin: ReviewRequest+


Attachments
Screenshow showing the broken layout of the "Grid" tabbox preview in different sizes (740.83 KB, image/png)
2012-11-24 21:38 UTC, Elias Probst
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elias Probst 2012-11-24 21:38:50 UTC
Created attachment 75457 [details]
Screenshow showing the broken layout of the "Grid" tabbox preview in different sizes

The layout preview for the "Grid" tabbox has a broken layout (the actual tabbox works).

By default, the window which shows the preview is very small (first window in attached screenshot).
The window previews overlap each other and the icon/application name are shown above the window preview.

When resizing it a little bit, one can reach a partially good looking preview, but the icon/application name placement is still a little off, as it seems not to be attached something like "20px below the window preview" but more like "spread evenly across the available space".

When resizing the window even further, it is clearly visible that the icon/application name is attached to the bottom of each application's area.

I also noted that the size of the preview window must be somewhere stored, as when having the preview window resized, then closing + re-opening it, it still shows the previous size.
This might be the reason, this broken layout went unnoticed, as during the development/test phase the window was resized once and in every further iteration the preview looked mostly ok.
Comment 1 Martin Flöser 2013-01-16 14:43:35 UTC
to be honest: almost all previews are a little bit broken. The problem is that a dialog which is supposed to be put on full screen is smashed into a window.
Comment 2 Martin Flöser 2015-01-13 11:53:27 UTC
the previews got improved in 5.x - do you consider this bug as fixed nowadays?
Comment 3 Elias Probst 2015-01-13 13:01:02 UTC
Now all previews are completely empty - just the background is shown.
Updating currently and will retry in a few minutes.
Comment 4 Elias Probst 2015-01-17 00:45:42 UTC
Ok, after updating + restarting everything: the previews are still completely empty - just their background is shown.

There aren't any related log messages neither from kwin nor the KCM.
Comment 5 Martin Flöser 2015-01-19 07:13:49 UTC
maybe we broke things when moving the layouts around... Will test on a clean install.
Comment 6 Martin Flöser 2015-01-19 07:59:19 UTC
I cannot reproduce with a clean install (tested kubuntu live cd)
Comment 7 Elias Probst 2015-01-19 17:29:03 UTC
The problem seems to be the hardcoded desktop files in layoutpreview.cpp which are used for the preview.

Adding this debug statement to layoutpreview.cpp:
diff --git a/kcmkwin/kwintabbox/layoutpreview.cpp b/kcmkwin/kwintabbox/layoutpreview.cpp
index 87ed1ba..7900fb2 100644
--- a/kcmkwin/kwintabbox/layoutpreview.cpp
+++ b/kcmkwin/kwintabbox/layoutpreview.cpp
@@ -140,6 +140,9 @@ void ExampleClientModel::init()
         if (service) {
             m_nameList << service->entryPath();
         }
+        else {
+            qDebug() << "Unable to create service for" << "kde4-" + application + ".desktop";
+        }
     }
 }

Gave me the following result:
Unable to create service for "kde4-konqbrowser.desktop"
Unable to create service for "kde4-KMail2.desktop"
Unable to create service for "kde4-systemsettings.desktop"
Unable to create service for "kde4-dolphin.desktop"

So the preview "blindly" assumes these applications are installed wherever kwintabbox is used.
The current approach is IMHO rather fragile, e.g. I don't have any "KDE4" apps installed and there dolphin's desktop file isn't even named dolphin.desktop but org.kde.dolphin.desktop. 

I think it would make more sense to create 4 dummy applications/desktop files to be shipped with tabbox and to use them instead.
Comment 8 Martin Flöser 2015-01-20 06:53:55 UTC
Thanks for the investigation. Yes, that needs changing.
Comment 9 Martin Flöser 2015-01-20 14:23:55 UTC
I cloned the bug to have this one about the new problem starting from comment #3.
Comment 10 Martin Flöser 2015-01-21 08:24:43 UTC
Git commit 4a260c6f42f5d09f1657b750fc2eb72dafcf4f23 by Martin Gräßlin.
Committed on 20/01/2015 at 14:16.
Pushed by graesslin into branch 'Plasma/5.2'.

[kcmkwin/tabbox] Improve locating the services used in preview mode

Instead of hard coding the desktop files, let's try to use what the
user actually uses.
 * Browser mapped from text/html mime type
 * File manager mapped from inode/directory mime type
 * Email client mapped from message/rfc822 mime type

Only systemsettings is "hard coded" as there is no mime type to map.

The thumbnails are not changed, though. But they are so small that
it's hardly recognizable anyway. For future it could be considered to
map against appdata to get a better screenshot.
REVIEW: 122170

M  +26   -19   kcmkwin/kwintabbox/layoutpreview.cpp
M  +6    -1    kcmkwin/kwintabbox/layoutpreview.h

http://commits.kde.org/kwin/4a260c6f42f5d09f1657b750fc2eb72dafcf4f23