From dc66bcb466a0ae08ef53aae30ee00cc2c46af4d2 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 17 Oct 2024 09:37:06 -0400 Subject: [PATCH 1/4] Add SingleMainWindow support --- menuinst/_schema.py | 5 +++++ menuinst/data/menuinst.default.json | 1 + menuinst/data/menuinst.schema.json | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/menuinst/_schema.py b/menuinst/_schema.py index 472862ac..83525b48 100644 --- a/menuinst/_schema.py +++ b/menuinst/_schema.py @@ -171,6 +171,11 @@ class Linux(BasePlatformSpecific): """ PrefersNonDefaultGPU: Optional[bool] = None "Hint that the app prefers to be run on a more powerful discrete GPU if available." + SingleMainWindow: Optional[bool] = None + """ + Hint to avoid offering a UI to launch another window of the app. + This is useful for removing the 'New Window' option in the app's context menu. + """ StartupNotify: Optional[bool] = None """ Advanced. See `Startup Notification spec diff --git a/menuinst/data/menuinst.default.json b/menuinst/data/menuinst.default.json index c9acad43..9bf540c0 100644 --- a/menuinst/data/menuinst.default.json +++ b/menuinst/data/menuinst.default.json @@ -28,6 +28,7 @@ "NotShowIn": null, "OnlyShowIn": null, "PrefersNonDefaultGPU": null, + "SingleMainWindow": null, "StartupNotify": null, "StartupWMClass": null, "TryExec": null, diff --git a/menuinst/data/menuinst.schema.json b/menuinst/data/menuinst.schema.json index 3ce53052..a8c9af67 100644 --- a/menuinst/data/menuinst.schema.json +++ b/menuinst/data/menuinst.schema.json @@ -226,6 +226,10 @@ "title": "Prefersnondefaultgpu", "type": "boolean" }, + "SingleMainWindow": { + "title": "Singlemainwindow", + "type": "boolean" + }, "StartupNotify": { "title": "Startupnotify", "type": "boolean" From 2f7656c6ada5bf8f20734e1e5776ccbb1fed3735 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 17 Oct 2024 13:00:39 -0400 Subject: [PATCH 2/4] Update menuinst/_schema.py Co-authored-by: Marco Esters --- menuinst/_schema.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/menuinst/_schema.py b/menuinst/_schema.py index 83525b48..ed388f70 100644 --- a/menuinst/_schema.py +++ b/menuinst/_schema.py @@ -173,8 +173,7 @@ class Linux(BasePlatformSpecific): "Hint that the app prefers to be run on a more powerful discrete GPU if available." SingleMainWindow: Optional[bool] = None """ - Hint to avoid offering a UI to launch another window of the app. - This is useful for removing the 'New Window' option in the app's context menu. + Do not show the 'New Window' option in the app's context menu. """ StartupNotify: Optional[bool] = None """ From dcbaf3e789e90deaa6ddd909f91b55917380ea53 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 17 Oct 2024 13:03:03 -0400 Subject: [PATCH 3/4] Document --- news/265-add-singlemainwindow-support | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 news/265-add-singlemainwindow-support diff --git a/news/265-add-singlemainwindow-support b/news/265-add-singlemainwindow-support new file mode 100644 index 00000000..3c7795af --- /dev/null +++ b/news/265-add-singlemainwindow-support @@ -0,0 +1,19 @@ +### Enhancements + +* Add support for `SingleMainWindow` in the Linux platform-specific options to allow disabling the `New Window` option in the app's context menu. + +### Bug fixes + +* + +### Deprecations + +* + +### Docs + +* + +### Other + +* From 70506142bce88b7f5aa508efe4758de3d69f116e Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Thu, 17 Oct 2024 13:22:03 -0400 Subject: [PATCH 4/4] Update news/265-add-singlemainwindow-support Co-authored-by: Marco Esters --- news/265-add-singlemainwindow-support | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news/265-add-singlemainwindow-support b/news/265-add-singlemainwindow-support index 3c7795af..9ace9ce0 100644 --- a/news/265-add-singlemainwindow-support +++ b/news/265-add-singlemainwindow-support @@ -1,6 +1,6 @@ ### Enhancements -* Add support for `SingleMainWindow` in the Linux platform-specific options to allow disabling the `New Window` option in the app's context menu. +* Add support for `SingleMainWindow` in the Linux platform-specific options to allow disabling the `New Window` option in the app's context menu. (#264 via #265) ### Bug fixes