Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package cinnamon-settings-daemon for
openSUSE:Factory checked in at 2024-08-21 23:25:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cinnamon-settings-daemon (Old)
and /work/SRC/openSUSE:Factory/.cinnamon-settings-daemon.new.2698 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "cinnamon-settings-daemon"
Wed Aug 21 23:25:04 2024 rev:32 rq:1195066 version:6.2.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/cinnamon-settings-daemon/cinnamon-settings-daemon.changes
2023-12-03 20:48:53.853961839 +0100
+++
/work/SRC/openSUSE:Factory/.cinnamon-settings-daemon.new.2698/cinnamon-settings-daemon.changes
2024-08-21 23:25:27.324182371 +0200
@@ -1,0 +2,8 @@
+Mon Aug 19 14:39:00 UTC 2024 - sb56637 <[email protected]>
+
+- update to 6.2.0:
+ * Fixes and readability improvements
+ * print notifications: Don't send repeated printer-added notifications.
+ * notifications manager: Fix compiler warnings.
+
+-------------------------------------------------------------------
Old:
----
cinnamon-settings-daemon-6.0.0.tar.gz
New:
----
cinnamon-settings-daemon-6.2.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ cinnamon-settings-daemon.spec ++++++
--- /var/tmp/diff_new_pack.OrcNTn/_old 2024-08-21 23:25:27.788201743 +0200
+++ /var/tmp/diff_new_pack.OrcNTn/_new 2024-08-21 23:25:27.788201743 +0200
@@ -17,7 +17,7 @@
Name: cinnamon-settings-daemon
-Version: 6.0.0
+Version: 6.2.0
Release: 0
Summary: The settings Daemon for the Cinnamon Desktop
License: GPL-2.0-or-later AND LGPL-2.1-only
++++++ cinnamon-settings-daemon-6.0.0.tar.gz ->
cinnamon-settings-daemon-6.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cinnamon-settings-daemon-6.0.0/README.rst
new/cinnamon-settings-daemon-6.2.0/README.rst
--- old/cinnamon-settings-daemon-6.0.0/README.rst 2023-11-19
14:41:17.000000000 +0100
+++ new/cinnamon-settings-daemon-6.2.0/README.rst 2024-06-11
16:33:39.000000000 +0200
@@ -1,13 +1,14 @@
-cinnamon-settings-daemon is a collection of plugins.
+``cinnamon-settings-daemon`` is a collection of plugins.
-These plugins are started by cinnamon-session when you log in.
+These plugins are started by ``cinnamon-session`` when you log in.
-The plugins run in the background, each with their own process.
+The plugins run in the background, each with its own process.
-Plugins:
-========
-Here's a description of each plugin.
+PLUGINS
+=======
+
+Here is a description of each plugin.
a11y-settings
-------------
@@ -21,11 +22,11 @@
clipboard
---------
-Xorg features two ways of copying and pasting content. The first one is
``X-clipboard``, which is commonly used in edit menus and using ``Ctrl+C`` and
``Ctrl+V``. The second one is ``X-selection`` which is used by selecting
content with the mouse and pasting it with a middle-click.
+Xorg features two ways of copying and pasting content. The first one is
``X-clipboard``, which is commonly used in edit menus and when using ``Ctrl+C``
and ``Ctrl+V``. The second one is ``X-selection`` which is used when selecting
content with the mouse and pasting it with a middle-click.
When you copy content from a window, that content is available either in
``X-clipboard`` or ``X-selection`` until the application which owns that window
is terminated.
-This plugin keeps the content of ``X-clipboard`` in memory, so that even if
the owner application exits the content continues to be available.
+This plugin keeps the content of ``X-clipboard`` in memory, so that even if
the owner application exits, the content continues to be available.
color
-----
@@ -48,7 +49,7 @@
The thumbnail cache is cleaned up according to the settings stored in
``org.cinnamon.desktop.thumbnail-cache``.
-This is done 2 minutes after login and then once a day.
+This is done 2 minutes after login and then once each day.
**low disk space**
@@ -71,11 +72,11 @@
**keyboard layout**
-The layout selection is done in cinnamon-control-center's region plugin (which
is presented to the user in cinnamon-settings' keyboard module). That
configuration is set directly via gkbd (libgnomekbd) and xkl (libxklavier).
This plugin reads and listens to that configuration and assigns to the keyboard.
+The layout selection is done in the ``cinnamon-control-center`` ``region``
plugin (which is presented to the user in the ``cinnamon-settings``
``keyboard`` module). That configuration is set directly via ``gkbd``
(``libgnomekbd``) and ``xkl`` (``libxklavier``). This plugin reads and listens
to that configuration and assigns it to the keyboard.
**hotplug command**
-Although it isn't configured by default or used by cinnamon-settings, when a
keyboard is plugged in, or removed, the plugin executes the command specified
in ``org.cinnamon.settings-daemon.peripherals.input-devices hotplug-command``
with a series of argument to specify the event type, the device etc..
+Although it isn't configured by default or used by ``cinnamon-settings``, when
a keyboard is plugged in, or removed, this plugin executes the command
specified in ``org.cinnamon.settings-daemon.peripherals.input-devices
hotplug-command`` with a series of arguments to specify the event type, the
device, etc.
An example script which can be used for such a command is available in
``plugins/common/input-device-example.sh``.
@@ -92,7 +93,7 @@
On DBUS, it listens to events on ``org.cups.cupsd.Notifier``.
-Libnotify is used to show the notifications.
+``libnotify`` is used to show the notifications.
screensaver-proxy
-----------------
@@ -103,7 +104,7 @@
wacom
-----
-This plugin handles wacom tablets.
+This plugin handles Wacom tablets.
It reads and listens to the ``org.cinnamon.settings-daemon.peripherals.wacom``
and applies the configuration in X11.
@@ -112,6 +113,7 @@
This plugin sets the settings for GTK and Xft.
+
TESTING
=======
@@ -121,24 +123,24 @@
2. Build the project
3. Run the built plugin in verbose mode
-For instance:
+For example:
* ``killall csd-sound`` (you might have to kill it twice, if CSM tries to
restart it)
* ``dpkg-buildpackage``
* ``plugins/sound/csd-sound --verbose``
-TODO:
-=====
+TODO
+====
-- Remove custom keybinding code (we handle that in Cinnamon now) - do we want
to handle media keys in cinnamon also? Would get around the 'no meda keys
while a menu is open' issue.
+- Remove custom keybinding code (we handle that in Cinnamon now) - do we want
to handle media keys in cinnamon also? Would get around the 'no meta keys
while a menu is open' issue.
- Switch to Gnome's keyboard layout (gsettings) handler - basically reverting
Ubuntu's patch for this. This will allow us to implement ibus popups directly
in Cinnamon
- Look into backgrounds - we should be able to eliminate the background
manager in the cinnamon gnome 3.8 compat rollup, and continue to handle
backgrounds as we currently do
- Investigate: How to keep gnome-settings-daemon from autostarting. It
checks for environment=GNOME... which means Cinnamon also - is it time to have
our own freedesktop.org name?
--- Update on this: Setting session name to Cinnamon works - then add to
main.c in cinnamon, to set XDG_CURRENT_DESKTOP=GNOME makes sure apps keep
showing up
+-- Update on this: Setting session name to Cinnamon works - then add to main.c
in cinnamon, to set XDG_CURRENT_DESKTOP=GNOME makes sure apps keep showing up
- Multiple backgrounds on multiple monitors
-- /etc/acpi/powerbtn.sh - add cinnamon-settings-daemon to script - how?
postinst?
+- /etc/acpi/powerbtn.sh - add cinnamon-settings-daemon to script - how?
postinst?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cinnamon-settings-daemon-6.0.0/data/org.cinnamon.settings-daemon.peripherals.gschema.xml.in.in
new/cinnamon-settings-daemon-6.2.0/data/org.cinnamon.settings-daemon.peripherals.gschema.xml.in.in
---
old/cinnamon-settings-daemon-6.0.0/data/org.cinnamon.settings-daemon.peripherals.gschema.xml.in.in
2023-11-19 14:41:17.000000000 +0100
+++
new/cinnamon-settings-daemon-6.2.0/data/org.cinnamon.settings-daemon.peripherals.gschema.xml.in.in
2024-06-11 16:33:39.000000000 +0200
@@ -170,7 +170,7 @@
<key name="custom-acceleration" type="b">
<default>false</default>
<summary>Custom Motion Acceleration</summary>
- <description>Wheather or not to use a custom motion acceleration
value.</description>
+ <description>Whether or not to use a custom motion acceleration
value.</description>
</key>
<key name="motion-acceleration" type="d">
<default>-1</default>
@@ -180,7 +180,7 @@
<key name="custom-threshold" type="b">
<default>false</default>
<summary>Custom Motion Threshold</summary>
- <description>Wheather or not to use a custom motion threshold
value.</description>
+ <description>Whether or not to use a custom motion threshold
value.</description>
</key>
<key name="motion-threshold" type="i">
<default>-1</default>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cinnamon-settings-daemon-6.0.0/data/org.cinnamon.settings-daemon.plugins.power.gschema.xml.in.in
new/cinnamon-settings-daemon-6.2.0/data/org.cinnamon.settings-daemon.plugins.power.gschema.xml.in.in
---
old/cinnamon-settings-daemon-6.0.0/data/org.cinnamon.settings-daemon.plugins.power.gschema.xml.in.in
2023-11-19 14:41:17.000000000 +0100
+++
new/cinnamon-settings-daemon-6.2.0/data/org.cinnamon.settings-daemon.plugins.power.gschema.xml.in.in
2024-06-11 16:33:39.000000000 +0200
@@ -168,7 +168,7 @@
<key name="power-notifications-for-other-devices" type="b">
<default>true</default>
<summary>Low battery notifications for other connected devices</summary>
- <description>Whether to show low battery notifications for conected
devices other than keyboards and mice.</description>
+ <description>Whether to show low battery notifications for connected
devices other than keyboards and mice.</description>
</key>
</schema>
</schemalist>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cinnamon-settings-daemon-6.0.0/debian/changelog
new/cinnamon-settings-daemon-6.2.0/debian/changelog
--- old/cinnamon-settings-daemon-6.0.0/debian/changelog 2023-11-19
14:41:17.000000000 +0100
+++ new/cinnamon-settings-daemon-6.2.0/debian/changelog 2024-06-11
16:33:39.000000000 +0200
@@ -1,3 +1,14 @@
+cinnamon-settings-daemon (6.2.0) wilma; urgency=medium
+
+ [ Gitoffthelawn ]
+ * Fixes and readability improvements (#390)
+
+ [ Michael Webster ]
+ * print notifications: Don't send repeated printer-added notifications.
+ * notifications manager: Fix compiler warnings.
+
+ -- Clement Lefebvre <[email protected]> Tue, 11 Jun 2024 15:32:09 +0100
+
cinnamon-settings-daemon (6.0.0) virginia; urgency=medium
[ Rick Calixte ]
@@ -540,7 +551,7 @@
* mouse: simplify finalize call
https://github.com/GNOME/gnome-settings-daemon/commit/7c268ddf2c0fea89ed053e55002fba65c523904a#diff-f3eb78dbfdd1699b6580551f271aba41
* mouse: simplify stop call
https://github.com/GNOME/gnome-settings-daemon/commit/9e4e46a47fd385807f9cbae9d42ebcc312680a1e#diff-f3eb78dbfdd1699b6580551f271aba41
* mouse: replace dialogue by warning
https://github.com/GNOME/gnome-settings-daemon/commit/3e337371249dace2613d4698d91f587621188c19#diff-f3eb78dbfdd1699b6580551f271aba41
- * mouse: remove empty contructor and dispose functions
https://github.com/GNOME/gnome-settings-daemon/commit/98df44761b4f0c70078df635aaa68adff6454380#diff-f3eb78dbfdd1699b6580551f271aba41
+ * mouse: remove empty constructor and dispose functions
https://github.com/GNOME/gnome-settings-daemon/commit/98df44761b4f0c70078df635aaa68adff6454380#diff-f3eb78dbfdd1699b6580551f271aba41
* mouse: wrap device button mapping into gdk_error_trap_push/pop
https://github.com/GNOME/gnome-settings-daemon/commit/7a07cd12b862fa40ab5c38fee3dc264bb483a494#diff-f3eb78dbfdd1699b6580551f271aba41
* mouse: wrap pointer acceleration changes into a gdk_error_trap
https://github.com/GNOME/gnome-settings-daemon/commit/8b78228a7e0abfc2c1561a275214da5d77cc7a93#diff-f3eb78dbfdd1699b6580551f271aba41
* locate-pointer: Remove support for multiple X screens
https://github.com/GNOME/gnome-settings-daemon/commit/cf677a9c47d868b0bdae026b9d0db36df75f9dac#diff-f3eb78dbfdd1699b6580551f271aba41
gdk_display_get_n_screens is now hardcoded just to return 1, so take out the
loop using it
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/cinnamon-settings-daemon-6.0.0/meson.build
new/cinnamon-settings-daemon-6.2.0/meson.build
--- old/cinnamon-settings-daemon-6.0.0/meson.build 2023-11-19
14:41:17.000000000 +0100
+++ new/cinnamon-settings-daemon-6.2.0/meson.build 2024-06-11
16:33:39.000000000 +0200
@@ -1,4 +1,4 @@
-project('cinnamon-settings-daemon', 'c', version: '6.0.0', meson_version:
'>=0.56.0')
+project('cinnamon-settings-daemon', 'c', version : '6.2.0', meson_version :
'>=0.56.0')
gnome = import('gnome')
i18n = import('i18n')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cinnamon-settings-daemon-6.0.0/plugins/color/csd-color-manager.c
new/cinnamon-settings-daemon-6.2.0/plugins/color/csd-color-manager.c
--- old/cinnamon-settings-daemon-6.0.0/plugins/color/csd-color-manager.c
2023-11-19 14:41:17.000000000 +0100
+++ new/cinnamon-settings-daemon-6.2.0/plugins/color/csd-color-manager.c
2024-06-11 16:33:39.000000000 +0200
@@ -480,7 +480,7 @@
goto out;
}
- /* ensure desination does not already exist */
+ /* ensure destination does not already exist */
ret = g_file_query_exists (parent_dir, NULL);
if (ret)
goto out;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cinnamon-settings-daemon-6.0.0/plugins/common/test-input-helper.c
new/cinnamon-settings-daemon-6.2.0/plugins/common/test-input-helper.c
--- old/cinnamon-settings-daemon-6.0.0/plugins/common/test-input-helper.c
2023-11-19 14:41:17.000000000 +0100
+++ new/cinnamon-settings-daemon-6.2.0/plugins/common/test-input-helper.c
2024-06-11 16:33:39.000000000 +0200
@@ -38,7 +38,7 @@
manager = gdk_display_get_device_manager (gdk_display_get_default ());
devices = get_disabled_devices (manager);
- g_print ("Disabled devices:\t\t\t");
+ g_print ("Disabled devices:\t\t\t ");
if (devices == NULL) {
g_print ("no\n");
return;
@@ -62,24 +62,24 @@
supports_xinput = supports_xinput_devices ();
if (supports_xinput) {
- g_print ("Supports XInput:\t\t\tyes\n");
+ g_print ("Supports XInput:\t\t\t yes\n");
} else {
- g_print ("Supports XInput:\t\t\tno\n");
+ g_print ("Supports XInput:\t\t\t no\n");
return 0;
}
supports_xinput = supports_xinput2_devices (&opcode);
if (supports_xinput) {
- g_print ("Supports XInput2:\t\t\tyes (opcode: %d)\n", opcode);
+ g_print ("Supports XInput2:\t\t\t yes (opcode: %d)\n", opcode);
} else {
- g_print ("Supports XInput2:\t\t\tno\n");
+ g_print ("Supports XInput2:\t\t\t no\n");
return 0;
}
has_touchpad = touchpad_is_present ();
- g_print ("Has touchpad:\t\t\t\t%s\n", has_touchpad ? "yes" : "no");
+ g_print ("Has touchpad:\t\t\t\t %s\n", has_touchpad ? "yes" : "no");
has_touchscreen = touchscreen_is_present ();
- g_print ("Has touchscreen:\t\t\t%s\n", has_touchscreen ? "yes" : "no");
+ g_print ("Has touchscreen:\t\t\t %s\n", has_touchscreen ? "yes" : "no");
device_info = XListInputDevices (GDK_DISPLAY_XDISPLAY
(gdk_display_get_default ()), &n_devices);
if (device_info == NULL) {
@@ -93,7 +93,7 @@
XDevice *device;
if (device_info_is_touchscreen (&device_info[i])) {
- g_print ("Device %d is touchscreen:\t\t%s\n", (int)
device_info[i].id, "yes");
+ g_print ("Device %d is touchscreen:\t\t %s\n", (int)
device_info[i].id, "yes");
continue;
}
@@ -103,15 +103,15 @@
continue;
if (device_is_touchpad (device))
- g_print ("Device %d is touchpad:\t\t%s\n", (int)
device_info[i].id, "yes");
+ g_print ("Device %d is touchpad:\t\t %s\n", (int)
device_info[i].id, "yes");
else {
int tool_id;
tool_id = xdevice_get_last_tool_id (device_info[i].id);
if (tool_id >= 0x0)
- g_print ("Device %d is
touchpad/touchscreen:\t%s (tool ID: 0x%x)\n", (int) device_info[i].id, "no",
tool_id);
+ g_print ("Device %d is touchpad/touchscreen:\t
%s (tool ID: 0x%x)\n", (int) device_info[i].id, "no", tool_id);
else
- g_print ("Device %d is
touchpad/touchscreen:\t%s\n", (int) device_info[i].id, "no");
+ g_print ("Device %d is touchpad/touchscreen:\t
%s\n", (int) device_info[i].id, "no");
}
xdevice_close (device);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cinnamon-settings-daemon-6.0.0/plugins/datetime/csd-datetime-mechanism.c
new/cinnamon-settings-daemon-6.2.0/plugins/datetime/csd-datetime-mechanism.c
---
old/cinnamon-settings-daemon-6.0.0/plugins/datetime/csd-datetime-mechanism.c
2023-11-19 14:41:17.000000000 +0100
+++
new/cinnamon-settings-daemon-6.2.0/plugins/datetime/csd-datetime-mechanism.c
2024-06-11 16:33:39.000000000 +0200
@@ -764,7 +764,7 @@
&error);
if (error != NULL) {
- g_critical ("error exporting datetime intereface: %s",
error->message);
+ g_critical ("error exporting datetime interface: %s",
error->message);
g_error_free (error);
goto error;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cinnamon-settings-daemon-6.0.0/plugins/keyboard/gkbd-configuration.c
new/cinnamon-settings-daemon-6.2.0/plugins/keyboard/gkbd-configuration.c
--- old/cinnamon-settings-daemon-6.0.0/plugins/keyboard/gkbd-configuration.c
2023-11-19 14:41:17.000000000 +0100
+++ new/cinnamon-settings-daemon-6.2.0/plugins/keyboard/gkbd-configuration.c
2024-06-11 16:33:39.000000000 +0200
@@ -340,11 +340,11 @@
const char * const *
gkbd_configuration_get_group_names (GkbdConfiguration *configuration)
{
- return configuration->priv->full_group_names;
+ return (const char * const *)configuration->priv->full_group_names;
}
const char * const *
gkbd_configuration_get_short_group_names (GkbdConfiguration *configuration)
{
- return configuration->priv->short_group_names;
+ return (const char * const *)configuration->priv->short_group_names;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cinnamon-settings-daemon-6.0.0/plugins/power/csd-power-manager.c
new/cinnamon-settings-daemon-6.2.0/plugins/power/csd-power-manager.c
--- old/cinnamon-settings-daemon-6.0.0/plugins/power/csd-power-manager.c
2023-11-19 14:41:17.000000000 +0100
+++ new/cinnamon-settings-daemon-6.2.0/plugins/power/csd-power-manager.c
2024-06-11 16:33:39.000000000 +0200
@@ -3364,7 +3364,7 @@
* to adjust timeout, as related to current idle time, so the idle
* timeout will fire as designed.
*
- * Return value: timeout to set, adjusted acccording to current idle time.
+ * Return value: timeout to set, adjusted according to current idle time.
**/
static guint
idle_adjust_timeout (guint idle_time, guint timeout)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cinnamon-settings-daemon-6.0.0/plugins/print-notifications/csd-print-notifications-manager.c
new/cinnamon-settings-daemon-6.2.0/plugins/print-notifications/csd-print-notifications-manager.c
---
old/cinnamon-settings-daemon-6.0.0/plugins/print-notifications/csd-print-notifications-manager.c
2023-11-19 14:41:17.000000000 +0100
+++
new/cinnamon-settings-daemon-6.2.0/plugins/print-notifications/csd-print-notifications-manager.c
2024-06-11 16:33:39.000000000 +0200
@@ -53,6 +53,9 @@
#define CUPS_CONNECTION_TEST_INTERVAL 300
#define CHECK_INTERVAL 60 /* secs */
+#define PRINTER_REMOVED_LIFETIME 7200000000 // (7200 sec * 1000 * 1000
(microseconds) */
+#define PRINTER_REMOVED_UPDATE_INTERVAL 1260 /* 21 min (sec) */
+
#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
#define HAVE_CUPS_1_6 1
#endif
@@ -84,6 +87,8 @@
GPid scp_handler_pid;
GList *timeouts;
GHashTable *printing_printers;
+ GHashTable *removed_printers;
+ guint removed_printer_timeout_id;
GList *active_notifications;
guint cups_connection_timeout_id;
guint check_source_id;
@@ -332,6 +337,96 @@
process_new_notifications (user_data);
}
+typedef struct
+{
+ CsdPrintNotificationsManager *manager;
+ gint64 removed_time;
+} RemovePrinterData;
+
+static gboolean
+drop_expired_removal (const gchar *printer_name,
+ RemovePrinterData *foreach_data,
+ gpointer user_data)
+{
+ RemovePrinterData *current_data = (RemovePrinterData *) user_data;
+
+ if (current_data->removed_time > foreach_data->removed_time +
PRINTER_REMOVED_LIFETIME) {
+ g_debug ("Removing printer from removed-printers queue: %s
(removed over %lds ago)",
+ printer_name, PRINTER_REMOVED_LIFETIME / 1000 / 1000);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static gboolean
+removed_cache_update (CsdPrintNotificationsManager *manager)
+{
+ gint64 current_time = g_get_monotonic_time ();
+ RemovePrinterData *current_data = g_new0 (RemovePrinterData, 1);
+
+ g_debug ("Periodic update of removed-printers");
+
+ current_data->manager = manager;
+ current_data->removed_time = current_time;
+
+ g_hash_table_foreach_remove (manager->priv->removed_printers,
+ (GHRFunc) drop_expired_removal,
+ current_data);
+
+ if (g_hash_table_size (manager->priv->removed_printers) == 0) {
+ g_debug ("No more printers in removed-printers queue, stopping
update timer.");
+ manager->priv->removed_printer_timeout_id = 0;
+ return G_SOURCE_REMOVE;
+ }
+
+ return G_SOURCE_CONTINUE;
+}
+
+static gboolean
+should_notify_new_printer (CsdPrintNotificationsManager *manager,
+ const gchar *printer_name)
+{
+ g_debug ("Checking if user should be notified about a new printer:
%s", printer_name);
+ RemovePrinterData *data = g_hash_table_lookup
(manager->priv->removed_printers, printer_name);
+
+ if (data) {
+ g_hash_table_remove (manager->priv->removed_printers,
printer_name);
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void
+add_or_update_removed_cache (CsdPrintNotificationsManager *manager,
+ const gchar *printer_name)
+{
+ RemovePrinterData *data = g_new0 (RemovePrinterData, 1);
+ data->removed_time = g_get_monotonic_time ();
+ gboolean new;
+
+ new = g_hash_table_replace (manager->priv->removed_printers,
+ g_strdup (printer_name),
+ data);
+
+ if (new) {
+ g_debug ("Printer %s has been removed, adding to removed-printers
queue.", printer_name);
+ } else {
+ g_debug ("Printer %s has been re-removed, updating its removed
timestamp.", printer_name);
+ }
+
+ if (g_hash_table_size (manager->priv->removed_printers) > 0 &&
+ manager->priv->removed_printer_timeout_id == 0) {
+ g_debug ("Starting removed-printer timer");
+ manager->priv->removed_printer_timeout_id =
+ g_timeout_add_seconds (PRINTER_REMOVED_UPDATE_INTERVAL,
+ (GSourceFunc)
removed_cache_update,
+ manager);
+ }
+}
+
static gchar *
get_statuses_second (guint i,
const gchar *printer_name)
@@ -504,12 +599,17 @@
manager->priv->dests,
manager->priv->num_dests)) {
/* Translators: New printer has been added */
- primary_text = g_strdup (_("Printer added"));
- secondary_text = g_strdup (printer_name);
+ if (should_notify_new_printer (manager, printer_name))
{
+ primary_text = g_strdup (_("Printer added"));
+ secondary_text = g_strdup (printer_name);
+ } else {
+ g_debug ("A recently-removed printer %s has been
re-added, skipping notification.", printer_name);
+ }
}
} else if (g_strcmp0 (notify_subscribed_event, "printer-deleted") ==
0) {
cupsFreeDests (manager->priv->num_dests, manager->priv->dests);
manager->priv->num_dests = cupsGetDests
(&manager->priv->dests);
+ add_or_update_removed_cache (manager, printer_name);
} else if (g_strcmp0 (notify_subscribed_event, "job-completed") == 0
&& my_job) {
g_hash_table_remove (manager->priv->printing_printers,
printer_name);
@@ -1345,6 +1445,7 @@
cinnamon_settings_profile_start (NULL);
manager->priv->printing_printers = g_hash_table_new_full (g_str_hash,
g_str_equal, g_free, NULL);
+ manager->priv->removed_printers = g_hash_table_new_full (g_str_hash,
g_str_equal, g_free, g_free);
/*
* Set a password callback which cancels authentication
@@ -1387,6 +1488,8 @@
manager->priv->scp_handler_spawned = FALSE;
manager->priv->timeouts = NULL;
manager->priv->printing_printers = NULL;
+ manager->priv->removed_printers = NULL;
+ manager->priv->removed_printer_timeout_id = 0;
manager->priv->active_notifications = NULL;
manager->priv->cups_bus_connection = NULL;
manager->priv->cups_connection_timeout_id = 0;
@@ -1431,6 +1534,8 @@
cancel_subscription (manager->priv->subscription_id);
g_clear_pointer (&manager->priv->printing_printers,
g_hash_table_destroy);
+ g_clear_pointer (&manager->priv->removed_printers,
g_hash_table_destroy);
+ g_clear_handle_id (&manager->priv->removed_printer_timeout_id,
g_source_remove);
g_clear_object (&manager->priv->cups_bus_connection);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/cinnamon-settings-daemon-6.0.0/plugins/xsettings/csd-xsettings-manager.c
new/cinnamon-settings-daemon-6.2.0/plugins/xsettings/csd-xsettings-manager.c
---
old/cinnamon-settings-daemon-6.0.0/plugins/xsettings/csd-xsettings-manager.c
2023-11-19 14:41:17.000000000 +0100
+++
new/cinnamon-settings-daemon-6.2.0/plugins/xsettings/csd-xsettings-manager.c
2024-06-11 16:33:39.000000000 +0200
@@ -390,7 +390,7 @@
/* This is kind of a workaround. "menu" is useless in metacity
titlebars
* it duplicates the same features as the right-click menu.
- * In CSD windows on the hand it is required to show unique featues.
+ * In CSD windows on the hand it is required to show unique features.
*/
tmp = g_variant_get_string (value, NULL);