Skip to content

Commit be23890

Browse files
Report GNOME notification controls unavailable outside GNOME Shell
1 parent 64dd667 commit be23890

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

‎apps/decksmith-studio/system_controls.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def profiles(self):
2525
def state(self,command):
2626
if command not in COMMANDS:raise ValueError('Unsupported system action')
2727
if command=='dnd':
28+
if not self.call(False,'org.freedesktop.DBus','/org/freedesktop/DBus','org.freedesktop.DBus','NameHasOwner',GLib.Variant('(s)',('org.gnome.Shell',)))[0]:
29+
return dict(available=False,active=False,text='Unavailable')
2830
s=self.setting('org.gnome.desktop.notifications')
2931
if not s.is_writable('show-banners'):raise ValueError('Notification setting is managed')
3032
active=not s.get_boolean('show-banners');return dict(available=True,active=active,text='On' if active else 'Off')

‎apps/decksmith-studio/test_system_controls.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
from system_controls import Controls,COMMANDS,LABELS
44
from system_confirm import confirmed_power
55
class SystemControlTests(unittest.TestCase):
6+
def test_non_gnome_dnd_never_claims_or_changes_gnome_notification_settings(self):
7+
c=Controls();c.call=Mock(return_value=(False,));c.setting=Mock()
8+
self.assertEqual(c.state('dnd'),{'available':False,'active':False,'text':'Unavailable'})
9+
with self.assertRaises(ValueError):c.execute('dnd')
10+
c.setting.assert_not_called()
11+
self.assertEqual(c.call.call_args.args[4],'NameHasOwner')
12+
def test_gnome_dnd_still_reads_and_toggles_banner_setting(self):
13+
c=Controls();c.call=Mock(return_value=(True,));setting=Mock();setting.get_boolean.return_value=True
14+
c.setting=Mock(return_value=setting)
15+
self.assertEqual(c.state('dnd'),{'available':True,'active':False,'text':'Off'})
16+
with patch('system_controls.Gio.Settings.sync'):c.execute('dnd')
17+
setting.set_boolean.assert_called_once_with('show-banners',False)
618
def test_unknown_command_rejected_before_bus_access(self):
719
c=Controls();c.call=Mock()
820
with self.assertRaises(ValueError):c.execute('run_shell')

‎docs/popos-preview-checkpoint.md‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ signed COSMIC candidate. Package hints now follow Pop!_OS's Ubuntu/Debian ancest
3636
First-launch sizing also exposed an unmapped-parent monitor lookup: an oversized
3737
1440×900 request on a 1280×800 display caused COSMIC to choose the 900×540 minimum.
3838
The editor now bounds its first request to an available monitor even before the
39-
parent maps. Exact-package normal-session rendering and user review remain gates.
39+
parent maps. At 1920×1200, the source-matched native workspace passes tab/layout,
40+
focus, settings and gauge-selector checks. COSMIC can still choose a narrower
41+
window on a 1280×800 display; manually enlarge the window if controls clip.
42+
Exact-package normal-session rendering and user review remain gates.
43+
44+
Do Not Disturb now requires a running GNOME Shell before reading or changing
45+
GNOME's notification setting. COSMIC reports it unavailable; changing an ignored
46+
GNOME preference must not masquerade as COSMIC notification control.
4047

4148
## Runtime dependencies and limitations
4249

0 commit comments

Comments
 (0)