Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-12-09 19:07:59

william_g
Member
Registered: 2019-12-09
Posts: 2

[Solved] High CPU using adapta theme

Hi I have a problem similar to this https://forum.xfce.org/viewtopic.php?id=12821.
In my case I have an high CPU when there is file selected on the desktop. When I deselect the file the CPU returns to a normal state.
I tried to execute this command

xfdesktop -Q && xfdesktop --enable-debug

While a file is selected the program prints in loop this output:

DBG[xfdesktop-icon-view.c:1982] xfdesktop_icon_view_style_updated(): cell spacing is 2
DBG[xfdesktop-icon-view.c:1983] xfdesktop_icon_view_style_updated(): cell padding is 6
DBG[xfdesktop-icon-view.c:1984] xfdesktop_icon_view_style_updated(): cell text width proportion is 1.900000
DBG[xfdesktop-icon-view.c:1985] xfdesktop_icon_view_style_updated(): ellipsize icon label is true
DBG[xfdesktop-icon-view.c:1986] xfdesktop_icon_view_style_updated(): tooltip size is -1
DBG[xfdesktop-icon-view.c:1987] xfdesktop_icon_view_style_updated(): label radius is 4.000000

This happens only if the adapta theme is active.
The CPU usage of the xfdesktop can even reach 40%

Theese are some information about my currently installed versions

This is xfdesktop version 4.14.1, running on Xfce 4.14.
Built with GTK+ 3.24.10, linked with GTK+ 3.24.13.
Build options:
    Desktop Menu:        enabled
    Desktop Icons:       enabled
    Desktop File Icons:  enabled

I really like that theme, please help me.

Last edited by william_g (2019-12-11 00:09:45)

Offline

#2 2019-12-10 01:50:24

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,236

Re: [Solved] High CPU using adapta theme

Hello and welcome.

Just spent some time looking at this. What's interesting is:

  1. those debug statements print out continuously - something is forcing that function (xfdesktop_icon_view_style_updated(GtkWidget *widget)) to get called repeatedly which is probably causing the CPU spike.
    --

  2. if you set the background on the xfdesktopview active element to transparent, the high cpu usage stops. Try adding the following to ~/.config/gtk-3.0/gtk.css:

    XfdesktopIconView.view:active { background-color: transparent; }

    ... and restart xfdesktop. Note, you will lose the ability to tell which icon is the selected icon.

One way to get around this issue with the selected icon, is to use the foreground colour to change the active colour hue of the icon to make it stand out, something like:

XfdesktopIconView.view:active { background-color: transparent; color: rgb(77,182,172); }

Anyways, there is an active bug report for this issue and it looks like they are trying to contact an Adapta theme developer.

Offline

#3 2019-12-11 00:09:17

william_g
Member
Registered: 2019-12-09
Posts: 2

Re: [Solved] High CPU using adapta theme

Thank you this trick solves the issue.

I look at the code of adapta to use the same color and I got that the scss produces this line:

XfdesktopIconView.view:active { background-color: #00BCD4; text-shadow: none; }

So I try to to use the same setting, but again I have the loop.

The scss code which produces this line is:

XfdesktopIconView.view {
  border-radius: 2px;
  background: transparent;
  color: $selected_fg_color;
  text-shadow: $z-depth-1-label; // non-sense for me
  &:active {
    background-color: $selected_bg_color;
    text-shadow: none;
  }

Now, I'm not expert of scss or gtk theme, but just to give it a try, I tried to remove the & from that code.

This is the produced code (it is the same code obtained even adding a space after the &):

XfdesktopIconView.view :active { background-color: #00BCD4; text-shadow: none; }

I tried both to add this line to ~/.config/gtk-3.0/gtk.css, and to recompile and install adapta with this change.
If I recompile adapta, the theme works correctly.
If I add the line in ~/.config/gtk-3.0/gtk.css, I get the loop again; but if I write this:

XfdesktopIconView.view:active { background-color: transparent; }
XfdesktopIconView.view :active { background-color: #00BCD4; text-shadow: none; }

the theme works correctly.

I want to report this issue, but I don't know if it is actually due to adapta or gtk.

Last edited by william_g (2019-12-11 00:27:29)

Offline

#4 2019-12-11 00:41:01

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,236

Re: [Solved] High CPU using adapta theme

william_g wrote:

I want to report this issue, but I don't know if it is actually due to adapta or gtk.

I'm not either. I'll point the above bug report to this thread for more information.

Offline

Board footer

Powered by FluxBB