Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Folder Icon on window when subpatch has the name of a folder #906

Open
mariobuoninfante opened this issue Mar 9, 2020 · 12 comments
Open

Folder Icon on window when subpatch has the name of a folder #906

mariobuoninfante opened this issue Mar 9, 2020 · 12 comments

Comments

@mariobuoninfante
Copy link

@mariobuoninfante mariobuoninfante commented Mar 9, 2020

MacOS High Sierra 10.13.1 - pd 0.50-2

having a subpatch with the same name of a folder added to the search path (ie in my case [declare -path ./foldername]) makes appear a folder icon next to the subpatch window title.

Screen Shot 2020-03-09 at 13 58 17

@umlaeute

This comment has been minimized.

Copy link
Contributor

@umlaeute umlaeute commented Mar 9, 2020

that seems to be very weird (if not unlikely).
The GUI does not get informed of which search-paths are added via [declare], so I fail to see how it would be able to display an icon (or not) based on information it does not have.

could you please try to recreate the problem using a more unique name for the library (e.g. Chochoo1), and share with us the entire folder, containing both your patch (with the subpatch) and the directory?.

does the problem appear, if you start Pd from the cmdline (/Applications/Pd.app/..../bin/pd)?
if so, could you also share the output you get when starting Pd with -d 1 (logging the communication from Pd to Pd-GUI; beware this can be a lot of data; make sure to only have a very minimal patch that exhibits the problem, before you create that log (so we don't drown in noise))

@mariobuoninfante

This comment has been minimized.

Copy link
Author

@mariobuoninfante mariobuoninfante commented Mar 10, 2020

here's another screenshot and the actual folder

Screen Shot 2020-03-10 at 15 36 40

[icon_issue.zip](https://github.com/pure-data/pure-data/files/4313299/icon_issue.zip)
@mariobuoninfante

This comment has been minimized.

Copy link
Author

@mariobuoninfante mariobuoninfante commented Mar 10, 2020

@mariobuoninfante

This comment has been minimized.

Copy link
Author

@mariobuoninfante mariobuoninfante commented Mar 10, 2020

it happens when launching Pd from terminal as well.
this is what I get when running pd -d 1

/Applications/Pd-0.50-2.app/Contents/Resources/bin/pd -d 1
set ::tmp_path {}
lappend ::tmp_path {/Users/mariobuoninfante/Documents/Pd/externals}
set ::sys_searchpath $::tmp_path
set ::tmp_path {}
set ::sys_temppath $::tmp_path
set ::tmp_path {}
lappend ::tmp_path {/Users/mariobuoninfante/Library/Pd}
lappend ::tmp_path {/Library/Pd}
lappend ::tmp_path {/Applications/Pd-0.50-2.app/Contents/Resources/extra}
set ::sys_staticpath $::tmp_path
set ::startup_flags {}
set ::startup_libraries {}
pdtk_pd_startup 0 50 2 {} { {"standard (portaudio)" 4} {jack 5} } {} {DejaVu Sans Mono} normal
set pd_whichapi 4
set zoom_open 0
::deken::set_platform Darwin amd64 64 32
::pdwindow::post {could not open midi input 0 (IAC Driver Bus 1): PortMidi: `Invalid device ID'
}
set pd_whichmidiapi 0
pdtk_canvas_new .x100642cc0 450 300 +0+23 0
pdtk_canvas_setparents .x100642cc0
pdtk_canvas_reflecttitle .x100642cc0 {/Users/mariobuoninfante/Documents/pdPatches/icon_issue} {main.pd} {} 0
::pd_menus::update_window_menu
pdtk_undomenu .x100642cc0 no no
.x100642cc0.c create line 167 52 346 52 346 71 167 71 167 52  -dash "" -width 1 -capstyle projecting -tags [list .x100642cc0.t100642bd0R obj]
.x100642cc0.c raise cord
pdtk_text_new .x100642cc0.c {.x100642cc0.t100642bd0 obj text} 169.000000 55.000000 {declare -path ./my_folder } 12 black
.x100642cc0.c create line 168 135 256 135 256 154 168 154 168 135  -dash "" -width 1 -capstyle projecting -tags [list .x100642cc0.t100643e30R obj]
.x100642cc0.c raise cord
pdtk_text_new .x100642cc0.c {.x100642cc0.t100643e30 obj text} 170.000000 138.000000 {pd my_folder } 12 black
.x100642cc0.c create line 168 155 249 155 249 174 168 174 168 155  -dash "" -width 1 -capstyle projecting -tags [list .x100642cc0.t100643eb0R obj]
.x100642cc0.c raise cord
pdtk_text_new .x100642cc0.c {.x100642cc0.t100643eb0 obj text} 170.000000 158.000000 {pd my_folde } 12 black
pdtk_canvas_getscroll .x100642cc0.c
.x100642cc0 configure -cursor $cursor_runmode_nothing
.x100642cc0 configure -cursor $cursor_runmode_clickme
pdtk_canvas_new .x100643c30 450 300 +0+23 0
pdtk_canvas_setparents .x100643c30 .x100642cc0
pdtk_canvas_reflecttitle .x100643c30 {/Users/mariobuoninfante/Documents/pdPatches/icon_issue} {my_folder} {} 0
::pd_menus::update_window_menu
pdtk_undomenu .x100643c30 no no
pdtk_canvas_getscroll .x100643c30.c
.x100643c30 configure -cursor $cursor_runmode_nothing
@porres

This comment has been minimized.

Copy link
Contributor

@porres porres commented Mar 10, 2020

hi, I opened the example patch and got the same thing

@mariobuoninfante

This comment has been minimized.

Copy link
Author

@mariobuoninfante mariobuoninfante commented Mar 10, 2020

I also tried the following (where PRINT_2 is an object in my subfolder)
This shows that the issue occurs even when the subfolder is not actually added to the search path.
it looks like a conflict with the name in [declare]
Screen Shot 2020-03-10 at 15 44 25

@mariobuoninfante

This comment has been minimized.

Copy link
Author

@mariobuoninfante mariobuoninfante commented Mar 10, 2020

actually even without using [declare] (I made sure I rebooted Pd before trying).
also, as soon as I rename the subfolder (from my_folder to my_folde), when I then reopen the subpatch, the icon disappears.

Screen Shot 2020-03-10 at 15 47 15

@mariobuoninfante

This comment has been minimized.

Copy link
Author

@mariobuoninfante mariobuoninfante commented Mar 10, 2020

@porres which OS are you on?

@porres

This comment has been minimized.

Copy link
Contributor

@porres porres commented Mar 10, 2020

10.14.6

@umlaeute

This comment has been minimized.

Copy link
Contributor

@umlaeute umlaeute commented Mar 10, 2020

it seems that this is totally intentional.
at least there is code with the sole purpose of setting the icon if possible (at least if i read the tk documentation correctly:

if [catch {wm attributes $mytoplevel -titlepath "$path/$name"}] {

the history of this code-snippet goes back to the Pd-GUI rewrite for Pd-0.42, and the "why?" is probably lost in time.

@umlaeute

This comment has been minimized.

Copy link
Contributor

@umlaeute umlaeute commented Mar 10, 2020

$path/$name will resolve to the filename of an abstraction (in the case of an abstraction window).

so i think that this was probably meant as a way to give abstractions an icon (namely, the icon that is associated with the abstraction-file, which defaults to the icon associated with generic .pd-files).

subpatches are much freer in what the $name part can be (that is: anything), so when resolving $path/$name you can easily and accidentally hit an existing "file" (or directory), in which case the icon of this file will be displayed.

assuming that JPEGs ar automatically associated with a thumbnail, you could also use [pd foo.jpg] and put a foo.jpg in the same path to get your own icons.

that almost smells like a feature :-)

more seriously: if we want to keep the icon for abstractions, it might become overly complicated to remove the current behaviour.

@mariobuoninfante

This comment has been minimized.

Copy link
Author

@mariobuoninfante mariobuoninfante commented Mar 10, 2020

well, I honestly don't think the current behavior is an issue.
I wouldn't call it a bug for sure, at least now that we know what's going on.
I think we can leave the world as it is if you guys agree.
Just my two cents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.