Folders Applet - panel not resizing on deletion of path

Bug #1385907 reported by nick on 2014-10-26
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cairo-Dock Plug-ins
Undecided
Unassigned

Bug Description

============================================================================
        Cairo-Dock version : 3.4.0
        Compiled date : Oct 17 2014 09:05:35
        Built with GTK : 3.14
        Running with OpenGL: 1
 ============================================================================
This issue was found in KDE and it occurs regardless of whether KDE Integration is enabled.

STEPS TO RE-CREATE
1. Configure the Folders Applet by adding a path with a number of different folders.
2. Click on Folders Applet - panel should be sized according to number of folders.
3. Configure the Folders Applet and blank out the path previously added - then click Apply.
4. Click on Folders Applet - large blank panel is displayed to user (see screenshot) - expected behaviour is that no panel should be displayed to user.

nick (thedarkstuff) wrote :
Brian (mycompostpile) wrote :

I can replicate this issue with the following system:

 ============================================================================
 Cairo-Dock version : 3.3.2
 Compiled date : Jun 19 2014 21:28:50
 Built with GTK : 3.10
 Running with OpenGL: 1
 ============================================================================

lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 14.04.1 LTS
Release: 14.04
Codename: trusty

xfdesktop -V
This is xfdesktop version 4.11.6, running on Xfce 4.10.
Built with GTK+ 2.24.23, linked with GTK+ 2.24.23.

lspci -vnn | grep VGA -A 12
40:00.0 VGA compatible controller [0300]: NVIDIA Corporation NV44 [Quadro NVS 285] [10de:0165] (rev a1) (prog-if 00 [VGA controller])

glxinfo | grep OpenGL
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro NVS 285/PCIe/SSE2
OpenGL version string: 2.1.2 NVIDIA 304.117
OpenGL shading language version string: 1.20 NVIDIA via Cg compiler
OpenGL extensions:

Brian (mycompostpile) wrote :

Just a note: When you blank the folder path you get a message stating to enter the configuration to set a path. The path is not supposed to be empty (not sure why you would want to have an empty one) but maybe should reset to an empty subdock when the path is empty.

nick (thedarkstuff) wrote :

Brian - I agree I think it is a minor cosmetic issue.

Initially, when you click on the Folders Applet (with no configuration added) it produces a pop up stating - 'Open the configuration of the applet to choose a folder to import.' In this case no blank panel is presented to the user which makes sense as no folders have been added.

I would expect the same behaviour when the folders have been removed - i.e. no blank folder panel presented to the user. I think all that is missing is a 'resize' event following the deletion of the path. If, for example, you add a different path with 3 folders it will resize accordingly.

Brian (mycompostpile) wrote :

nick - I agree that it would make sense to have the 'Open the configuration ...' pop up when the path is empty.

I have been looking at the code trying to see why it does not since the reloading of the configuration brings that popup message.

I haven't updated to the latest code yet but it looks like the reason is in how the code checks for the null path when the icon is clicked. If the icon list is null clicking the icon will pop up that message but if the icon list is not null (meaning it had data at some time) then clicking the icon will not pop up that message.

If the code for the Folders applet has not changed much for version 3.4.0 then one solution may be to change a line in the file applet-notifications.c (I haven't tested this so I am not 100% sure)

the line:
else if (CD_APPLET_MY_ICONS_LIST == NULL)
change to:
else if (CD_APPLET_MY_ICONS_LIST == NULL || myConfig.cDirPath == NULL)

This code is within the CD_APPLET_ON_CLICK_BEGIN section.

I see 2 problems:
- in cairo_dock_remove_all_icons_from_applet(), the sub-dock is not
updated; this is an optimisation (window resize), because in most case the
applet will load another list of Icons inside the container; however, it
forces the applet to load an empty icons list, which is probably not
intuitive (and as we see here, most of the time it will be forgotten ^^ )
- in the applet, the monitor on the previous folder is not removed, because
myConfig.cDirPath has already changed; so the applet should keep its value
in myData

2014-10-28 4:55 GMT+01:00 Brian <email address hidden>:

> nick - I agree that it would make sense to have the 'Open the
> configuration ...' pop up when the path is empty.
>
> I have been looking at the code trying to see why it does not since the
> reloading of the configuration brings that popup message.
>
> I haven't updated to the latest code yet but it looks like the reason is
> in how the code checks for the null path when the icon is clicked. If
> the icon list is null clicking the icon will pop up that message but if
> the icon list is not null (meaning it had data at some time) then
> clicking the icon will not pop up that message.
>
> If the code for the Folders applet has not changed much for version
> 3.4.0 then one solution may be to change a line in the file applet-
> notifications.c (I haven't tested this so I am not 100% sure)
>
> the line:
> else if (CD_APPLET_MY_ICONS_LIST == NULL)
> change to:
> else if (CD_APPLET_MY_ICONS_LIST == NULL || myConfig.cDirPath == NULL)
>
> This code is within the CD_APPLET_ON_CLICK_BEGIN section.
>
> --
> You received this bug notification because you are a member of Cairo-
> Dock Devs, which is subscribed to Cairo-Dock Plug-ins.
> https://bugs.launchpad.net/bugs/1385907
>
> Title:
> Folders Applet - panel not resizing on deletion of path
>
> Status in Cairo-Dock: Plug-ins:
> New
>
> Bug description:
>
> ============================================================================
> Cairo-Dock version : 3.4.0
> Compiled date : Oct 17 2014 09:05:35
> Built with GTK : 3.14
> Running with OpenGL: 1
>
> ============================================================================
> This issue was found in KDE and it occurs regardless of whether KDE
> Integration is enabled.
>
> STEPS TO RE-CREATE
> 1. Configure the Folders Applet by adding a path with a number of
> different folders.
> 2. Click on Folders Applet - panel should be sized according to number
> of folders.
> 3. Configure the Folders Applet and blank out the path previously added
> - then click Apply.
> 4. Click on Folders Applet - large blank panel is displayed to user (see
> screenshot) - expected behaviour is that no panel should be displayed to
> user.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/cairo-dock-plug-ins/+bug/1385907/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~cairo-dock-team
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~cairo-dock-team
> More help : https://help.launchpad.net/ListHelp
>

Brian (mycompostpile) wrote :

Thank you Fabounet I see what you mean.

By un-referencing the subdock and setting it to null at line 149 in the file applet-init.c the expected behaviour is achieved.

The following lines are copied from lines 165 and 166 and put in at line 149

                        gldi_object_unref (GLDI_OBJECT(myIcon->pSubDock));
                        myIcon->pSubDock = NULL;

After compiling and running the Folders applet now shows the configuration message when the folder path is emptied and the applet is clicked. It no longer shows a subdock when the path is empty.

Matthieu Baerts (matttbe) wrote :

Hello and sorry for the huge delay,

This bug should be fixed now.

Feel free to reopen this bug report if it's needed! :-)

Changed in cairo-dock-plug-ins:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers