Setting the GTK app id
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Ambito
- desktop
Direzione di ricerca
Inizia da gui-lib/mred/private/wx/gtk/unique.rkt, alla chiamata a gtk_application_new, poi esamina drracket/info.rkt e i percorsi get-aux-from-path e make-gracket-launcher. Il lavoro è completo quando l’ID dell’applicazione può essere controllato, rimane valido per GTK e D-Bus e il nome del desktop-file installato rimane coordinato con esso.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I've started looking at the guide to porting from GTK 3 to GTK 4. A lot of it seems fairly straightforward, but I see some challenges around this point:
Set a proper application ID
In GTK 4 we want the application’s
GApplication‘application-id’ (and therefore the D-Bus name), the desktop file basename and Wayland’s xdg-shellapp_idto match. In order to achieve this with GTK 3.x callg_set_prgname()with the same application ID you passed toGtkApplication. Rename your desktop files to match the application ID if needed.The call to
g_set_prgname()can be removed once you fully migrated to GTK 4.
Currently, this is what racket/gui passes to gtk_application_new:
There are several problems:
-
It certainly doesn't match the base name of anyone's
.desktopfile, particularly given the use ofgethostname. -
There is no guarantee that it will satisfy
g_application_id_is_valid, particularly the limit of 255 characters and the restriction to[A-Z][a-z][0-9]_-in labels. -
It will never be valid for D-Bus due to the hyphen in
org.racket-lang. From theg_application_id_is_validdocs:Note that the hyphen (
-) character is allowed in application identifiers, but is problematic or not allowed in various specifications and APIs that refer to D-Bus, such as Flatpak application IDs, theDBusActivatableinterface in the Desktop Entry Specification, and the convention that an application’s “main” interface and object path resemble its application identifier and bus name. To avoid situations that require special-case handling, it is recommended that new application identifiers consistently replace hyphens with underscores.Like D-Bus interface names, application identifiers should start with the reversed DNS domain name of the author of the interface (in lower-case), and it is conventional for the rest of the application identifier to consist of words run together, with initial capital letters.
As with D-Bus interface names, if the author’s DNS domain name contains hyphen/minus characters they should be replaced by underscores, and if it contains leading digits they should be escaped by prepending an underscore. For example, if the owner of 7-zip.org used an application identifier for an archiving application, it might be named
org._7_zip.Archiver.These rules would suggest something like
org.racket_lang.DrRacket.
More broadly, it seems like the application ID should be under the control of the programmer.
I'm not sure how best to communicate the application ID to the point where it's needed. Maybe it could us one of the special command-line options to gracket that translate to unsafe-register-process-global? (Or maybe some existing one should be used?)
Then there's the aspect of getting the .desktop file installed under the corresponding name, particularly for something like DrRacket where we have, and presumably want to keep:
which implies that we continue to use the name drracket.desktop to work with get-aux-from-path. Maybe we should add another kind of aux entry to specify the application ID, and use that when installing the file? Maybe there's something analogous to the rewriting make-gracket-launcher already does to the Exec entry in the .desktop file.
- Lingua principale
- Racket
- Stelle
- 68
- Fork
- 83
- Merge medio
- 21h
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di racket/gui
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
NousResearch/hermes-agent#140957 ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Windows 语音输入默认关闭Apertaenhancement source/qq
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
metasequoiaime/msime-windows#1054 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
omdsh-dev/DSH-better-sidebar#992 ·
I maintainer di solito rispondono entro 4 giorni
-
keypunchAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
Emanuele-web04/remodex#203 ·
I maintainer di solito rispondono entro 1 giorno