Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package gnome-pomodoro for openSUSE:Factory checked in at 2024-04-03 17:19:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gnome-pomodoro (Old) and /work/SRC/openSUSE:Factory/.gnome-pomodoro.new.1905 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gnome-pomodoro" Wed Apr 3 17:19:17 2024 rev:37 rq:1164132 version:0.25.1 Changes: -------- --- /work/SRC/openSUSE:Factory/gnome-pomodoro/gnome-pomodoro.changes 2024-03-20 21:18:45.483773248 +0100 +++ /work/SRC/openSUSE:Factory/.gnome-pomodoro.new.1905/gnome-pomodoro.changes 2024-04-03 17:20:08.064873795 +0200 @@ -1,0 +2,7 @@ +Fri Mar 29 14:26:12 UTC 2024 - Michael Vetter <[email protected]> + +- Update to 0.25.1: + + Fixes for GNOME Shell 46 + + Drop support for GNOME Shell 45 + +------------------------------------------------------------------- Old: ---- 0.25.0.tar.gz New: ---- 0.25.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gnome-pomodoro.spec ++++++ --- /var/tmp/diff_new_pack.UnlZpo/_old 2024-04-03 17:20:08.724898115 +0200 +++ /var/tmp/diff_new_pack.UnlZpo/_new 2024-04-03 17:20:08.724898115 +0200 @@ -18,7 +18,7 @@ %global __requires_exclude typelib\\(Meta\\) Name: gnome-pomodoro -Version: 0.25.0 +Version: 0.25.1 Release: 0 Summary: A time management utility for GNOME License: GPL-3.0-or-later @@ -33,7 +33,7 @@ BuildRequires: meson >= 0.58.0 BuildRequires: pkgconfig BuildRequires: vala >= 0.28 -BuildRequires: (gnome-shell >= 45 with gnome-shell < 47) +BuildRequires: (gnome-shell >= 46 with gnome-shell < 47) BuildRequires: pkgconfig(appstream-glib) >= 0.7.3 BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(gio-2.0) >= 2.38.0 @@ -50,7 +50,7 @@ Requires: gstreamer Requires: gtk3 >= 3.20.0 Requires: hicolor-icon-theme -Requires: (gnome-shell >= 45 with gnome-shell < 47) +Requires: (gnome-shell >= 46 with gnome-shell < 47) Recommends: gstreamer-plugins-base %description ++++++ 0.25.0.tar.gz -> 0.25.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-pomodoro-0.25.0/NEWS new/gnome-pomodoro-0.25.1/NEWS --- old/gnome-pomodoro-0.25.0/NEWS 2024-03-05 08:04:49.000000000 +0100 +++ new/gnome-pomodoro-0.25.1/NEWS 2024-03-28 14:43:45.000000000 +0100 @@ -1,3 +1,9 @@ +2024-03-28 Kamil Prusko <[email protected]> + Release version 0.25.1: + + * Fixes for GNOME Shell 46 + * Drop support for GNOME Shell 45 + 2024-03-05 Kamil Prusko <[email protected]> Release version 0.25.0: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-pomodoro-0.25.0/data/org.gnome.Pomodoro.appdata.xml.in new/gnome-pomodoro-0.25.1/data/org.gnome.Pomodoro.appdata.xml.in --- old/gnome-pomodoro-0.25.0/data/org.gnome.Pomodoro.appdata.xml.in 2024-03-05 08:04:49.000000000 +0100 +++ new/gnome-pomodoro-0.25.1/data/org.gnome.Pomodoro.appdata.xml.in 2024-03-28 14:43:45.000000000 +0100 @@ -44,7 +44,16 @@ <translation type="gettext">gnome-pomodoro</translation> <content_rating type="oars-1.1" /> <releases> - <release version="0.25.0" date="2024-03-05"> + <release version="0.25.1" date="2024-03-28"> + <description translatable="no"> + <p>Overview of changes in gnome-pomodoro 0.25.1</p> + <ul> + <li>Fixes for GNOME Shell 46</li> + <li>Drop support for GNOME Shell 45</li> + </ul> + </description> + </release> + <release version="0.25.0" date="2024-03-05"> <description translatable="no"> <p>Overview of changes in gnome-pomodoro 0.25.0</p> <ul> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-pomodoro-0.25.0/meson.build new/gnome-pomodoro-0.25.1/meson.build --- old/gnome-pomodoro-0.25.0/meson.build 2024-03-05 08:04:49.000000000 +0100 +++ new/gnome-pomodoro-0.25.1/meson.build 2024-03-28 14:43:45.000000000 +0100 @@ -1,7 +1,7 @@ project( 'gnome-pomodoro', ['vala', 'c'], - version: '0.25.0', + version: '0.25.1', meson_version: '>=0.59.0', ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-pomodoro-0.25.0/plugins/gnome/extension/dialogs.js new/gnome-pomodoro-0.25.1/plugins/gnome/extension/dialogs.js --- old/gnome-pomodoro-0.25.0/plugins/gnome/extension/dialogs.js 2024-03-05 08:04:49.000000000 +0100 +++ new/gnome-pomodoro-0.25.1/plugins/gnome/extension/dialogs.js 2024-03-28 14:43:45.000000000 +0100 @@ -57,7 +57,7 @@ const FADE_OUT_TIME = 350; const BLUR_BRIGHTNESS = 0.4; -const BLUR_SIGMA = 20.0; +const BLUR_RADIUS = 40.0; const OPEN_WHEN_IDLE_MIN_REMAINING_TIME = 3.0; @@ -130,7 +130,7 @@ if (!this._background) { // Clone the group that contains all of UI on the screen. This is the // chrome, the windows, etc. - this._background = new Clutter.Clone({source: Main.uiGroup, clip_to_allocation: true}); + this._background = new Clutter.Clone({source: Main.uiGroup, clip_to_allocation: false}); this._background.set_background_color(BACKGROUND_COLOR); this._background.add_effect_with_name('blur', new Shell.BlurEffect()); this.set_child(this._background); @@ -154,7 +154,7 @@ if (effect) { effect.set({ brightness: BLUR_BRIGHTNESS, - sigma: BLUR_SIGMA * themeContext.scale_factor, + radius: BLUR_RADIUS * themeContext.scale_factor, }); effect.queue_repaint(); } @@ -226,7 +226,7 @@ name: 'overlayGroup', reactive: false, }); - global.stage.add_actor(this._overlayGroup); + global.stage.add_child(this._overlayGroup); global.stage.set_child_above_sibling(this._overlayGroup, null); } @@ -245,13 +245,13 @@ } for (const overlayData of this._overlayActors) - this._overlayGroup.add_actor(overlayData.actor); + this._overlayGroup.add_child(overlayData.actor); } _destroyOverlayGroup() { if (this._overlayGroup) { - this._overlayGroup.remove_all_children (); - global.stage.remove_actor(this._overlayGroup); + this._overlayGroup.remove_all_children(); + global.stage.remove_child(this._overlayGroup); this._overlayGroup = null; } @@ -269,8 +269,8 @@ } else { chromeData.actor.ref(); try { - Main.layoutManager.uiGroup.remove_actor(chromeData.actor); - global.stage.add_actor(chromeData.actor); + Main.layoutManager.uiGroup.remove_child(chromeData.actor); + global.stage.add_child(chromeData.actor); } finally { chromeData.actor.unref(); } @@ -294,8 +294,8 @@ } else { chromeData.actor.ref(); try { - global.stage.remove_actor(chromeData.actor); - Main.layoutManager.uiGroup.add_actor(chromeData.actor); + global.stage.remove_child(chromeData.actor); + Main.layoutManager.uiGroup.add_child(chromeData.actor); } finally { chromeData.actor.unref(); } @@ -451,7 +451,7 @@ // size requests. this._layout = new St.Widget({layout_manager: new Clutter.BinLayout()}); this._layout.add_constraint(this._monitorConstraint); - this.add_actor(this._layout); + this.add_child(this._layout); // Lightbox will be a direct child of the ModalDialog this._lightbox = extension.pluginSettings.get_boolean('blur-effect') @@ -570,14 +570,13 @@ _onIdleMonitorBecameIdle(monitor) { // eslint-disable-line no-unused-vars let pushModalTries = 0; const pushModalInterval = Math.floor(1000 / PUSH_MODAL_RATE); - const timestamp = global.get_current_time(); if (this._pushModalWatchId) { this._idleMonitor.remove_watch(this._pushModalWatchId); this._pushModalWatchId = 0; } - if (this.pushModal(timestamp)) + if (this.pushModal()) return; this._pushModalSource = GLib.timeout_add( @@ -744,7 +743,7 @@ // Drop modal status without closing the dialog; this makes the // dialog insensitive as well, so it needs to be followed shortly // by either a close() or a pushModal() - popModal(timestamp) { + popModal() { this._disconnectPushModalSignals(); if (this._keyFocusOutId) { @@ -760,25 +759,21 @@ if (!this._hasModal) return; - Main.popModal(this._grab, timestamp); + Main.popModal(this._grab); this._grab = null; this._hasModal = false; this._lightbox.reactive = false; } - pushModal(timestamp) { + pushModal() { if (this._hasModal) return true; if (this.state === DialogState.CLOSED || this.state === DialogState.CLOSING || this._destroyed) return false; - let params = {actionMode: Shell.ActionMode.SYSTEM_MODAL}; - if (timestamp) - params['timestamp'] = timestamp; - - let grab = Main.pushModal(this, params); + const grab = Main.pushModal(this, {actionMode: Shell.ActionMode.SYSTEM_MODAL}); if (grab && grab.get_seat_state() !== Clutter.GrabState.ALL) { Utils.logWarning('Unable become fully modal'); Main.popModal(grab); @@ -946,9 +941,9 @@ style_class: 'extension-pomodoro-dialog-box', vertical: true, }); - box.add_actor(this._timerLabel); - box.add_actor(this._descriptionLabel); - this._layout.add_actor(box); + box.add_child(this._timerLabel); + box.add_child(this._descriptionLabel); + this._layout.add_child(box); this._timerStateChangedId = this._timer.connect('state-changed', this._onTimerStateChanged.bind(this)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-pomodoro-0.25.0/plugins/gnome/extension/indicator.js new/gnome-pomodoro-0.25.1/plugins/gnome/extension/indicator.js --- old/gnome-pomodoro-0.25.0/plugins/gnome/extension/indicator.js 2024-03-05 08:04:49.000000000 +0100 +++ new/gnome-pomodoro-0.25.1/plugins/gnome/extension/indicator.js 2024-03-28 14:43:45.000000000 +0100 @@ -181,7 +181,7 @@ else this._onResumeClicked(); }); - buttonsBox.add_actor(pauseResumeButton); + buttonsBox.add_child(pauseResumeButton); const skipStopButton = this._createIconButton('gnome-pomodoro-stop-symbolic', _('Stop Timer')); skipStopButton.connect('clicked', @@ -191,7 +191,7 @@ else this._onStopClicked(); }); - buttonsBox.add_actor(skipStopButton); + buttonsBox.add_child(skipStopButton); const blinkingGroup = this._indicator.blinkingGroup; blinkingGroup.addActor(timerLabel); @@ -639,18 +639,18 @@ /* background pie */ if (isBreak || !isRunning) { - Clutter.cairo_set_source_color(cr, this._secondaryColor); + cr.setSourceColor(this._secondaryColor); cr.arcNegative(0, 0, radius, angle1, angle2); cr.setLineWidth(2.2 * scaleFactor); cr.stroke(); } else { - Clutter.cairo_set_source_color(cr, this._secondaryColor); + cr.setSourceColor(this._secondaryColor); cr.arc(0, 0, radius, 0.0, 2.0 * Math.PI); cr.setLineWidth(2.2 * scaleFactor); cr.stroke(); if (angle2 > angle1) { - Clutter.cairo_set_source_color(cr, this._primaryColor); + cr.setSourceColor(this._primaryColor); cr.arcNegative(0, 0, radius, angle1, angle2); cr.setOperator(Cairo.Operator.CLEAR); cr.setLineWidth(3.5 * scaleFactor); @@ -731,7 +731,7 @@ x_align: Clutter.ActorAlign.CENTER, y_align: Clutter.ActorAlign.CENTER, }); - this.add_actor(this._iconBox); + this.add_child(this._iconBox); this._blinking = false; this._blinkingGroup = new Utils.TransitionGroup(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-pomodoro-0.25.0/plugins/gnome/extension/metadata.json.in new/gnome-pomodoro-0.25.1/plugins/gnome/extension/metadata.json.in --- old/gnome-pomodoro-0.25.0/plugins/gnome/extension/metadata.json.in 2024-03-05 08:04:49.000000000 +0100 +++ new/gnome-pomodoro-0.25.1/plugins/gnome/extension/metadata.json.in 2024-03-28 14:43:45.000000000 +0100 @@ -2,7 +2,7 @@ "uuid": "@EXTENSION_UUID@", "name": "Pomodoro", "description": "Desktop integration for Pomodoro application.", - "shell-version": ["45", "46"], + "shell-version": ["46"], "session-modes": ["user", "unlock-dialog"], "gettext-domain": "@GETTEXT_PACKAGE@", "url": "@PACKAGE_URL@", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-pomodoro-0.25.0/plugins/gnome/extension/notifications.js new/gnome-pomodoro-0.25.1/plugins/gnome/extension/notifications.js --- old/gnome-pomodoro-0.25.0/plugins/gnome/extension/notifications.js 2024-03-05 08:04:49.000000000 +0100 +++ new/gnome-pomodoro-0.25.1/plugins/gnome/extension/notifications.js 2024-03-28 14:43:45.000000000 +0100 @@ -22,15 +22,13 @@ import GObject from 'gi://GObject'; import St from 'gi://St'; -import {EventEmitter} from 'resource:///org/gnome/shell/misc/signals.js'; import {trySpawnCommandLine} from 'resource:///org/gnome/shell/misc/util.js'; import {gettext as _} from 'resource:///org/gnome/shell/extensions/extension.js'; -import * as Calendar from 'resource:///org/gnome/shell/ui/calendar.js'; import * as Main from 'resource:///org/gnome/shell/ui/main.js'; import * as MessageTray from 'resource:///org/gnome/shell/ui/messageTray.js'; import * as Params from 'resource:///org/gnome/shell/misc/params.js'; +import * as Signals from 'resource:///org/gnome/shell/misc/signals.js'; -import {extension} from './extension.js'; import {PomodoroEndDialog, DialogState} from './dialogs.js'; import {State} from './timer.js'; import * as Config from './config.js'; @@ -51,16 +49,20 @@ /** - * + * The source that should be used for our notifications. */ -function getDefaultSource() { +export function getDefaultSource() { if (!source) { - source = new Source(); - source.connect('destroy', - _source => { - if (_source === source) - source = null; - }); + source = new MessageTray.Source({ + title: _('Pomodoro Timer'), + iconName: ICON_NAME, + policy: new NotificationPolicy(), + }); + + source.connect('destroy', () => { + source = null; + }); + Main.messageTray.add(source); } return source; @@ -113,145 +115,84 @@ }); -const Source = GObject.registerClass( -class PomodoroSource extends MessageTray.Source { - _init() { - super._init(_('Pomodoro Timer'), ICON_NAME); - } - - /* override parent method */ - _createPolicy() { - return new NotificationPolicy(); - } -}); - - export const Notification = GObject.registerClass({ Properties: { - // TODO: timer should be a property - 'view': GObject.ParamSpec.int('view', 'view', 'view', + 'view': GObject.ParamSpec.int('view', '', '', GObject.ParamFlags.READWRITE, - Math.min(...Object.values(NotificationView)), - Math.max(...Object.values(NotificationView)), + 0, + GLib.MAXINT32, NotificationView.NULL), }, }, class PomodoroNotification extends MessageTray.Notification { - _init(timer) { - super._init(null, '', null, null); + constructor(timer, params) { + params = Params.parse(params, { + source: getDefaultSource(), + useBodyMarkup: false, + }); + + super(params); // Notification will update its contents. - this.setResident(true); + this.resident = true; // Notification should not expire while the timer is running. - this.setTransient(false); + this.isTransient = false; // Show notification regardless of session busy status. - this.setForFeedback(true); + this.forFeedback = true; + + // Hide notification on screen shield. + this.privacyScope = MessageTray.PrivacyScope.USER; // We want notifications to be shown right after the action, // therefore urgency bump. - this.setUrgency(MessageTray.Urgency.HIGH); + this.urgency = MessageTray.Urgency.HIGH; this._timer = timer; - } - - get timer() { - return this._timer; - } - - // `createBanner()` is used only to display a notification popup. - // Banners in calendar menu or the lock screen are made by GNOME Shell. - createBanner() { - let idleId = 0; - - const banner = new NotificationBanner(this); - - // We keep notification as resident to keep banner visible. Once we want to hide the banner - // we need to update the notification. - // Note that `notify::mapped` will be triggered when we're moving MessageTray above the dialog. - banner.connect('notify::mapped', () => { - if (idleId) { - GLib.source_remove(idleId); - idleId = 0; - } - - if (!banner.mapped) { - idleId = GLib.idle_add(GLib.PRIORITY_DEFAULT, () => { - idleId = 0; - - // TODO: this should be handled by NotificationManager - if (this.resident && extension.notificationManager) - extension.notificationManager._updateNotification(); - - - return GLib.SOURCE_REMOVE; - }); - GLib.Source.set_name_by_id(idleId, '[gnome-shell] banner._onNotifyMapped()'); - } - }); - - return banner; - } - - show() { - if (!this.source) - this.source = getDefaultSource(); - - - if (this.source) { - this.acknowledged = false; - - if (!Main.messageTray.contains(this.source)) - Main.messageTray.add(this.source); - - this.source.showNotification(this); - } else { - Utils.logWarning('Called Notification.show() after destroy()'); - } - } -}); - - -const NotificationBanner = GObject.registerClass( -class PomodoroNotificationBanner extends MessageTray.NotificationBanner { - _init(notification) { - super._init(notification); - - this._timer = notification.timer; - this._view = NotificationView.NULL; - this._timerState = null; - this._skipBreakButton = null; - this._extendButton = null; + this._skipBreakAction = null; + this._extendAction = null; this._updateActionsBlocked = false; - this._timerUpdateId = 0; - this._notificationUpdatedId = this.notification.connect('updated', this._onNotificationUpdated.bind(this)); - - this.notification.connectObject( - 'destroy', reason => { // eslint-disable-line no-unused-vars - if (this._notificationUpdatedId) { - notification.disconnect(this._notificationUpdatedId); - this._notificationUpdatedId = 0; - } + this._timerUpdateId = this._timer.connect('update', this._onTimerUpdate.bind(this)); + this.connect( + 'destroy', () => { if (this._timerUpdateId) { this._timer.disconnect(this._timerUpdateId); this._timerUpdateId = 0; } + + this._timer = null; } ); - - this._onNotificationUpdated(); } get timer() { return this._timer; } - /* override parent method */ - canClose() { - return false; + get view() { + return this._view; + } + + set view(value) { + if (!Object.values(NotificationView).includes(value)) + throw new Error('out of range'); + + if (this._view === value) + return; + + this._view = value; + this._update(); + this.notify('view'); + } + + get datetime() { + return null; + } + + set datetime(value) { } _blockUpdateActions() { @@ -265,7 +206,7 @@ switch (this._view) { case NotificationView.POMODORO: - title = isStarting ? _('Pomodoro') : State.label(this._timerState); + title = isStarting ? _('Pomodoro') : State.label(this._timerState); // TODO: change title when starting a pomodoro break; case NotificationView.POMODORO_ABOUT_TO_END: @@ -295,15 +236,12 @@ break; } - this.setTitle(title); + this.title = title; } _updateBody() { let body; - if (this._timer.getState() !== this._timerState) - return; - switch (this._view) { case NotificationView.POMODORO: case NotificationView.POMODORO_ABOUT_TO_END: @@ -321,221 +259,92 @@ break; } - this.setBody(body); + this.body = body; } _updateActions() { // Currently we display only one variant of buttons across all notification views. - const hasButtons = this._skipBreakButton !== null && this._extendButton !== null; - const showButtons = + const hasActions = this._skipBreakAction !== null && this._extendAction !== null; + const showActions = this._view === NotificationView.POMODORO_ABOUT_TO_END || this._view === NotificationView.BREAK || this._view === NotificationView.BREAK_ABOUT_TO_END; - if (hasButtons === showButtons) + if (hasActions === showActions) return; - if (showButtons) { - this._skipBreakButton = this.addAction(_('Skip Break'), () => { + if (showActions) { + this._skipBreakAction = this.addAction(_('Skip Break'), () => { this._timer.setState(State.POMODORO); }); - this._extendButton = this.addAction(_('+1 Minute'), () => { + this._extendAction = this.addAction(_('+1 Minute'), () => { this._blockUpdateActions(); this._timer.stateDuration += 60.0; }); } else { - this._skipBreakButton.destroy(); - this._extendButton.destroy(); + if (this._skipBreakAction) { + this._skipBreakAction.destroy(); + this._skipBreakAction = null; + } - this._skipBreakButton = null; - this._extendButton = null; + if (this._extendAction) { + this._extendAction.destroy(); + this._extendAction = null; + } } } - _onNotificationUpdated() { - const timerState = this._timer.getState(); - const view = this.notification.view; - - // Don't update actions when "+1 Minute" was clicked. - let updateActions = !this._updateActionsBlocked; - - if (timerState === State.NULL || !view) - return; - - if (this._timerState !== timerState) { - this._timerState = timerState; - updateActions = true; - } - - if (this._view !== view) - this._view = view; + _update() { + this._timerState = this._timer.getState(); this._updateTitle(); this._updateBody(); - - if (updateActions) { - if (this.expanded && !this.hover) - this.unexpand(); - - - this._updateActions(); - } - - this._updateActionsBlocked = false; + this._updateActions(); } _onTimerUpdate() { - this._updateBody(); - } - - vfunc_map() { - if (!this._timerUpdateId) - this._timerUpdateId = this._timer.connect('update', this._onTimerUpdate.bind(this)); - - this._onTimerUpdate(); - - super.vfunc_map(); - } - - vfunc_unmap() { - if (this._timerUpdateId) { - this._timer.disconnect(this._timerUpdateId); - this._timerUpdateId = 0; - } - - super.vfunc_unmap(); - } - - _onDestroy() { - if (this.notification && this._notificationUpdatedId) { - this.notification.disconnect(this._notificationUpdatedId); - this._notificationUpdatedId = 0; - } - - if (this._timerUpdateId) { - this._timer.disconnect(this._timerUpdateId); - this._timerUpdateId = 0; - } - - super._onDestroy(); - } -}); - - -const NotificationMessage = GObject.registerClass( -class PomodoroNotificationMessage extends Calendar.NotificationMessage { - _init(notification) { - super._init(notification); - - this._timer = notification.timer; - this._timerState = null; - this._isPaused = false; - - this.setUseBodyMarkup(false); - - // Reclaim space used by unused elements. - this._secondaryBin.hide(); - this._closeButton.hide(); - - this.notification.connectObject( - 'updated', this._onNotificationUpdated.bind(this), - 'destroy', () => { - if (this._timerUpdateId) { - this._timer.disconnect(this._timerUpdateId); - this._timerUpdateId = 0; - } - } - ); - - this._onNotificationUpdated(); - } - - /* override parent method */ - canClose() { - return false; - } - - _updateTitle() { - this.setTitle(State.label(this._timerState)); - } - - _updateBody() { - if (this._timer.getState() === this._timerState) - this.setBody(formatRemainingTime(this._timer.getRemaining())); - } - - _onNotificationUpdated() { - const timerState = this._timer.getState(); - const isPaused = this._timer.isPaused(); - - if (timerState === State.NULL) + if (this._timer.getState() !== this._timerState) return; - this._timerState = timerState; - this._isPaused = isPaused; - - this._updateTitle(); - this._updateBody(); - } - - _onTimerUpdate() { this._updateBody(); } - /* override parent method */ - _onUpdated(n, clear) { // eslint-disable-line no-unused-vars - } - - vfunc_clicked() { - super.vfunc_clicked(); - - Main.panel.closeCalendar(); - } - - vfunc_map() { - if (!this._timerUpdateId) - this._timerUpdateId = this._timer.connect('update', this._onTimerUpdate.bind(this)); - - this._onTimerUpdate(); - - super.vfunc_map(); - } - - vfunc_unmap() { - if (this._timerUpdateId) { - this._timer.disconnect(this._timerUpdateId); - this._timerUpdateId = 0; + show() { + if (!this.source) { + Utils.logWarning('Called Notification.show() after destroy()'); + return; } - super.vfunc_unmap(); + if (this.source.notifications.includes(this)) { + this.acknowledged = false; + this.source.emit('notification-request-banner', this); + } else { + this.source.addNotification(this); + } } }); export const IssueNotification = GObject.registerClass( class PomodoroIssueNotification extends MessageTray.Notification { - _init(message) { - super._init(getDefaultSource(), _('Pomodoro Timer'), message, {bannerMarkup: true}); - - this.setTransient(true); - this.setUrgency(MessageTray.Urgency.HIGH); + constructor(message) { + super({ + source: getDefaultSource(), + title: _('Pomodoro Timer'), + body: message, + urgency: MessageTray.Urgency.HIGH, + isTransient: true, + useBodyMarkup: true, + }); this.addAction(_('Report issue'), () => { trySpawnCommandLine(`xdg-open ${GLib.shell_quote(Config.PACKAGE_BUGREPORT)}`); - this.destroy(); }); } - - show() { - if (!Main.messageTray.contains(this.source)) - Main.messageTray.add(this.source); - - this.source.showNotification(this); - } }); -export const NotificationManager = class extends EventEmitter { +export const NotificationManager = class extends Signals.EventEmitter { constructor(timer, params) { params = Params.parse(params, { useDialog: true, @@ -553,7 +362,6 @@ this._previousView = NotificationView.NULL; this._previousTimerState = State.NULL; this._patches = this._createPatches(); - this._notificationSectionPatch = null; this._animate = params.animate; this._initialized = false; this._destroying = false; @@ -595,49 +403,6 @@ this._useDialog = value; } - // Replace notification banner under date menu with our own `NotificationMessage`. - _patchNotificationSection() { - const notificationSection = Main.panel?.statusArea.dateMenu?._messageList?._notificationSection; - - if (this._notificationSectionPatch) { - this._notificationSectionPatch.destroy(); - this._notificationSectionPatch = null; - } - - if (!notificationSection) - return; - - const notificationSectionPatch = new Utils.Patch(notificationSection, { - addMessageAtIndex(message, index, animate) { - const notification = message.notification; - const isUrgent = notification.urgency === MessageTray.Urgency.CRITICAL; - - if ((notification instanceof Notification) && !(message instanceof NotificationMessage)) { - // undo what _onNotificationAdded has done - notification.disconnectObject(this); - - message = new NotificationMessage(message.notification); - index = this._nUrgent; - animate = this.mapped; - - notification.connectObject( - 'destroy', () => { - if (isUrgent) - this._nUrgent--; - }, - 'updated', () => { - this.moveMessage(message, this._nUrgent, this.mapped); - }, this); - } - - notificationSectionPatch.initial.addMessageAtIndex.bind(this)(message, index, animate); - }, - }); - notificationSectionPatch.apply(); - - this._notificationSectionPatch = notificationSectionPatch; - } - _createPatches() { const messagesIndicatorPatch = new Utils.Patch(Main.panel.statusArea.dateMenu._indicator, { _sync() { @@ -662,21 +427,9 @@ }, }); - const messageListPatch = new Utils.Patch(Calendar.CalendarMessageList.prototype, {}); - messageListPatch.connect('applied', () => { - this._patchNotificationSection(); - }); - messageListPatch.connect('reverted', () => { - if (this._notificationSectionPatch) { - this._notificationSectionPatch.destroy(); - this._notificationSectionPatch = null; - } - }); - return [ messagesIndicatorPatch, messageTrayPatch, - messageListPatch, ]; } @@ -821,7 +574,6 @@ _updateNotification() { const notification = this._notification; const view = this._view; - const timerState = this._timer.getState(); let changed = false; @@ -835,7 +587,7 @@ // Use Urgency.CRITICAL to force notification banner to stay open. const urgency = isUrgent ? MessageTray.Urgency.CRITICAL : MessageTray.Urgency.HIGH; if (notification.urgency !== urgency) { - notification.setUrgency(urgency); + notification.urgency = urgency; changed = true; } @@ -843,7 +595,7 @@ view === NotificationView.POMODORO || view === NotificationView.NULL; if (notification.isTransient !== isTransient) { - notification.setTransient(isTransient); + notification.isTransient = isTransient; changed = true; } @@ -851,9 +603,9 @@ view === NotificationView.POMODORO_ABOUT_TO_END || view === NotificationView.BREAK_ABOUT_TO_END || view === NotificationView.BREAK_ENDED; - const isResident = (!isTransient || forceResident) && view !== NotificationView.NULL; - if (notification.resident !== isResident) { - notification.setResident(isResident); + const resident = (!isTransient || forceResident) && view !== NotificationView.NULL; + if (notification.resident !== resident) { + notification.resident = resident; changed = true; } @@ -862,13 +614,7 @@ changed = true; } - const title = State.label(timerState); - if (notification.title !== title) - changed = true; - if (changed) { - notification.update(title, '', {}); - if (Main.messageTray._notification === notification && isTransient) Main.messageTray._updateNotificationTimeout(MIN_DISPLAY_TIME); @@ -903,12 +649,14 @@ const notification = this._notification; const banner = Main.messageTray._banner?.notification === notification ? Main.messageTray._banner : null; - notification.acknowledged = true; - notification.setTransient(true); - notification.setResident(false); - notification.setUrgency(MessageTray.Urgency.HIGH); - if (banner && banner.mapped) { + notification.acknowledged = true; + notification.isTransient = true; + notification.resident = false; + + if (notification.urgency === MessageTray.Urgency.CRITICAL) + notification.urgency = MessageTray.Urgency.HIGH; + let destroyId = notification.connect('destroy', () => { if (destroyId) { notification.disconnect(destroyId); @@ -930,8 +678,6 @@ } else { notification.destroy(MessageTray.NotificationDestroyedReason.EXPIRED); } - - this._notification = null; } _doNotify() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-pomodoro-0.25.0/plugins/gnome/extension/screenShield.js new/gnome-pomodoro-0.25.1/plugins/gnome/extension/screenShield.js --- old/gnome-pomodoro-0.25.0/plugins/gnome/extension/screenShield.js 2024-03-05 08:04:49.000000000 +0100 +++ new/gnome-pomodoro-0.25.1/plugins/gnome/extension/screenShield.js 2024-03-28 14:43:45.000000000 +0100 @@ -46,29 +46,29 @@ vertical: true, x_expand: true, }); - this.add_actor(vbox); + this.add_child(vbox); const hbox = new St.BoxLayout(); - vbox.add_actor(hbox); + vbox.add_child(hbox); const contentBox = new St.BoxLayout({ style_class: 'extension-pomodoro-widget-content', vertical: true, x_expand: true, }); - hbox.add_actor(contentBox); + hbox.add_child(contentBox); const blinkingGroup = new Utils.TransitionGroup(); const titleLabel = new St.Label({style_class: 'extension-pomodoro-widget-title'}); - contentBox.add_actor(titleLabel); + contentBox.add_child(titleLabel); const messageLabel = new St.Label({style_class: 'extension-pomodoro-widget-message', text: '15 minutes remaining'}); - contentBox.add_actor(messageLabel); + contentBox.add_child(messageLabel); blinkingGroup.addActor(messageLabel); const buttonsBox = new St.BoxLayout(); - hbox.add_actor(buttonsBox); + hbox.add_child(buttonsBox); const pauseResumeButton = this._createIconButton('gnome-pomodoro-pause-symbolic', _('Pause Timer')); pauseResumeButton.connect('clicked', @@ -79,7 +79,7 @@ else this._timer.resume(); }); - buttonsBox.add_actor(pauseResumeButton); + buttonsBox.add_child(pauseResumeButton); blinkingGroup.addActor(pauseResumeButton); const skipStopButton = this._createIconButton('gnome-pomodoro-stop-symbolic', _('Stop Timer')); @@ -90,7 +90,7 @@ else this._timer.stop(); }); - buttonsBox.add_actor(skipStopButton); + buttonsBox.add_child(skipStopButton); this._blinkingGroup = blinkingGroup; this._titleLabel = titleLabel; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-pomodoro-0.25.0/plugins/gnome/extension/stylesheet.css new/gnome-pomodoro-0.25.1/plugins/gnome/extension/stylesheet.css --- old/gnome-pomodoro-0.25.0/plugins/gnome/extension/stylesheet.css 2024-03-05 08:04:49.000000000 +0100 +++ new/gnome-pomodoro-0.25.1/plugins/gnome/extension/stylesheet.css 2024-03-28 14:43:45.000000000 +0100 @@ -32,12 +32,6 @@ background-color: transparent; } -.extension-pomodoro-indicator-menu .icon-button { - padding: 0; - width: 36px; - height: 36px; -} - .extension-pomodoro-indicator-menu .popup-menu-item > StLabel:first-child { padding-left: 16px; } @@ -84,19 +78,6 @@ padding: 0; } -.message .extension-pomodoro-message-action { - font-size: 10pt; - font-weight: bold; - padding: 10px 10px 10px 3px; - border-radius: 0; - background-color: transparent; -} - -.message .extension-pomodoro-message-action:last-child { - border-radius: 0 3px 3px 0; - padding-right: 18px; -} - .extension-pomodoro-lightbox { background-color: rgba(0, 0, 0, 0.6); } @@ -146,6 +127,7 @@ .extension-pomodoro-widget .icon-button { border-radius: 10px; + background-color: rgba(255, 255, 255, 0.0); /* override gradient */ } .extension-pomodoro-widget .icon-button.flat:hover { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gnome-pomodoro-0.25.0/plugins/gnome/extension/timer.js new/gnome-pomodoro-0.25.1/plugins/gnome/extension/timer.js --- old/gnome-pomodoro-0.25.0/plugins/gnome/extension/timer.js 2024-03-05 08:04:49.000000000 +0100 +++ new/gnome-pomodoro-0.25.1/plugins/gnome/extension/timer.js 2024-03-28 14:43:45.000000000 +0100 @@ -28,7 +28,7 @@ import * as Params from 'resource:///org/gnome/shell/misc/params.js'; import {PomodoroClient} from './dbus.js'; -import {IssueNotification} from './notifications.js'; +import {IssueNotification, getDefaultSource} from './notifications.js'; import * as Config from './config.js'; import * as Utils from './utils.js'; @@ -248,8 +248,9 @@ } _notifyServiceNotInstalled() { + const source = new getDefaultSource(); const notification = new IssueNotification(_('Failed to run <i>%s</i> service').format(Config.PACKAGE_NAME)); - notification.show(); + source.addNotification(notification); } destroy() { @@ -402,19 +403,19 @@ text: '0', text_align: Pango.Alignment.RIGHT, }); - this.add_actor(this._minutesLabel); + this.add_child(this._minutesLabel); this._separatorLabel = new St.Label({ text: ':', }); this._separatorLabel.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; - this.add_actor(this._separatorLabel); + this.add_child(this._separatorLabel); this._secondsLabel = new MonospaceLabel({ text: '00', text_align: Pango.Alignment.LEFT, }); - this.add_actor(this._secondsLabel); + this.add_child(this._secondsLabel); this.connect('destroy', this._onDestroy.bind(this)); }
