aboutsummaryrefslogtreecommitdiffstats
path: root/community/gnome-clocks/0002-background-mode.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/gnome-clocks/0002-background-mode.patch')
-rw-r--r--community/gnome-clocks/0002-background-mode.patch63
1 files changed, 0 insertions, 63 deletions
diff --git a/community/gnome-clocks/0002-background-mode.patch b/community/gnome-clocks/0002-background-mode.patch
deleted file mode 100644
index 6ceeaeb997e..00000000000
--- a/community/gnome-clocks/0002-background-mode.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From c4505e46d51ccacde30acf0395d40c0c9973aba8 Mon Sep 17 00:00:00 2001
-From: Adam Plumb <adamplumb@gmail.com>
-Date: Fri, 10 Sep 2021 20:14:19 -0400
-Subject: [PATCH] Add argument to start initial instance in the background
-
----
- src/application.vala | 19 ++++++++++++++++++-
- 1 file changed, 18 insertions(+), 1 deletion(-)
-
-diff --git a/src/application.vala b/src/application.vala
-index 2e67046..625cc16 100644
---- a/src/application.vala
-+++ b/src/application.vala
-@@ -21,6 +21,7 @@ namespace Clocks {
- public class Application : Gtk.Application {
- const OptionEntry[] OPTION_ENTRIES = {
- { "version", 'v', 0, OptionArg.NONE, null, N_("Print version information and exit"), null },
-+ { "background", 'b', 0, OptionArg.NONE, null, N_("Start in the background"), null },
- { (string) null }
- };
-
-@@ -37,6 +38,7 @@ public class Application : Gtk.Application {
- private uint world_clocks_id = 0;
- private Window? window;
- private List<string> system_notifications;
-+ private bool background = false;
-
- private Window ensure_window () ensures (window != null) {
- if (window == null) {
-@@ -96,7 +98,15 @@ public class Application : Gtk.Application {
- base.activate ();
-
- var win = ensure_window ();
-- win.present ();
-+
-+ // The first activation will toggle the background flag to false
-+ // That way the next activation (of other instances)
-+ // will cause the window to display
-+ if (background) {
-+ background = false;
-+ } else {
-+ win.present ();
-+ }
-
- win.focus_in_event.connect (() => {
- withdraw_notifications ();
-@@ -142,6 +152,13 @@ public class Application : Gtk.Application {
- print ("%s %s\n", (string) Environment.get_application_name (), Config.VERSION);
- return 0;
- }
-+
-+ // This allows the primary instance to start in the background
-+ // Any subsequent instances will cause the window to display
-+ // Even if they pass in the background argument
-+ if (options.contains ("background")) {
-+ background = true;
-+ }
-
- return -1;
- }
---
-2.33.0
-