Opened 5 years ago

Closed 9 months ago

Last modified 9 months ago

#40110 closed enhancement (fixed)

app portgroup have x11 application not bounce indefinitely

Reported by: elelay (Eric Le Lay) Owned by: ryandesign (Ryan Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.2.0
Keywords: Cc: cooljeanius (Eric Gallager), ctreleaven (Craig Treleaven), mojca (Mojca Miklavec), kencu (Ken)
Port:

Description (last modified by elelay (Eric Le Lay))

(Following #39613)

There is an option that can be set in the Info.plist so that no dock icon is created for a graphical application:

<key>LSUIElement</key>
<string>1</string>

This is useful when building x11 gtk apps because they never signal the windowing system that they have launched and the associated icon keeps bouncing forever.

It would be nice to generate this into the plist depending on a boolean option of the app portgroup.

Otherwise I add following code in my Portfile:

    if {![variant_isset quartz]} {
        reinplace -E {s|(<string>APPL</string>)|\1 <key>LSUIElement</key><string>1</string>|} \
                 "${destroot}${applications_dir}/Quodlibet.app/Contents/Info.plist"
    }

Change History (14)

comment:1 Changed 5 years ago by elelay (Eric Le Lay)

Description: modified (diff)

comment:2 Changed 5 years ago by elelay (Eric Le Lay)

Description: modified (diff)

comment:3 Changed 5 years ago by cooljeanius (Eric Gallager)

I've seen some other individual portfiles set this, too, I forget which ones, though...

comment:4 Changed 5 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:5 Changed 5 years ago by ctreleaven (Craig Treleaven)

Cc: ctreleaven@… added

Cc Me!

comment:6 Changed 5 years ago by ctreleaven (Craig Treleaven)

Proposal: extend app port group to add 'app.behaviour' . Default would be as now, 'agent' would add "<key>LSUIElement</key><string>1</string>" as above. Ref:

https://developer.apple.com/library/mac/documentation/general/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/20001431-108256

Other app.behaviour values could be added as/when needs identified. Should be transparent to existing use of the portgroup.

Incidentally, I think the reinplace should have a return between the plist elements, ala

reinplace -E {s|(<string>APPL</string>)|\1\r<key>LSUIElement</key><string>1</string>|} \
                 ${destroot}${applications_dir}/${app.name}/Contents/Info.plist

comment:7 in reply to:  6 Changed 5 years ago by elelay (Eric Le Lay)

Replying to ctreleaven@…:

Proposal: extend app port group to add 'app.behaviour' . Default would be as now, 'agent' would add "<key>LSUIElement</key><string>1</string>" as above. Ref:

Looks good. I'm not going to do it at the moment, though.

Incidentally, I think the reinplace should have a return between the plist elements, ala

reinplace -E {s|(<string>APPL</string>)|\1\r<key>LSUIElement</key><string>1</string>|} \
                 ${destroot}${applications_dir}/${app.name}/Contents/Info.plist

Well, it's not necessary. The XML format doesn't care about carriage return.

comment:8 Changed 4 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added

Cc Me!

comment:9 Changed 9 months ago by kencu (Ken)

Cc: kencu added

comment:10 Changed 9 months ago by ken-cunningham-webuse

Resolution: fixed
Status: newclosed

In d5df001c5444d4a7003d6c914dae03429e8df134/macports-ports:

app PortGroup : add support for x11 applications

add a bash launch script option that does not pass
the -psn parameter, and that also sets PATH

add option to hide the dock icon (rather than have it
bounce continuously)

closes: #40110

comment:11 in reply to:  6 Changed 9 months ago by ryandesign (Ryan Schmidt)

Replying to ctreleaven:

Proposal: extend app port group to add 'app.behaviour' . Default would be as now, 'agent' would add "<key>LSUIElement</key><string>1</string>" as above. Ref:

https://developer.apple.com/library/mac/documentation/general/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/20001431-108256

As far as I can tell from that reference, LSUIElement is supposed to be a Boolean, not a string.

comment:12 Changed 9 months ago by kencu (Ken)

You could be right. I can confirm that the String reference works as written, however, on the several ports I tried it on.

comment:13 Changed 9 months ago by ryandesign (Ryan Schmidt)

The documentation says:

LSUIElement (Boolean - macOS) specifies whether the app runs as an agent app.

A survey of Info.plist files in /System on macOS Sierra shows most use a Boolean:

$ find /System -name Info.plist -print0 2>/dev/null | xargs -0 -n 1 /usr/libexec/PlistBuddy -c 'Print:LSUIElement' 2>/dev/null | sort | uniq -c
  37 1
   2 YES
 119 true

comment:14 Changed 9 months ago by kencu (Ken)

Indeed. From Dock.app on 10.7.5:

	<key>LSUIElement</key>
	<true/>

I can change it to that. Good pickup. I'm too trusting, clearly :>

Note: See TracTickets for help on using tickets.