diff --git a/phosh/NEWS b/phosh/NEWS
index b897a6d09..952a36a4f 100644
--- a/phosh/NEWS
+++ b/phosh/NEWS
@@ -1,49 +1,3 @@
-phosh 0.53.0
-------------
-Released February 2026
-* Various auto brightness improvements, e.g.
- * remember auto brightness offset
- * compensate for night light
-* overview: Show thumbnails for launching apps
-* overview: Style improvements
-* polkit-prompt: Show more user data
-* Activation fixes for notifications
- (Needs https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/9269)
-* caffeine: Allow to open plugin prefs from the status page
-* Multiple other fixes (Use alias for Bluetooth devices, improve app icon
- lookup, …)
-* Issues fixed:
- * https://gitlab.gnome.org/World/Phosh/phosh/-/issues/647
- * https://gitlab.gnome.org/World/Phosh/phosh/-/issues/813
- * https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1229
- * https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1280
- * https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1287
- * https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1292
- * https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1297
- * https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1300
- * https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1298
-* Contributors:
- * AJ Dunevent
- * Arun Mani J
- * Guido Günther
- * Rudra Pratap Singh
-* UI translations:
- * Anders Jonsson (sv)
- * Antonio Marin (ro)
- * Artur S0 (ru)
- * Álvaro Burns (pt_BR)
- * Danial Behzadi (fa)
- * Efstathios Iosifidis (el)
- * Ekaterine Papava (ka)
- * Flynn Peck (kw)
- * Fredrik Fyksen (nb)
- * Jürgen Benvenuti (de)
- * Martin (sl)
- * Quentin PAGÈS (oc)
- * Sabri Ünal (tr)
- * Yuri Chornoivan (uk)
- * twlvnn kraftwerk (bg)
-
phosh 0.52.1
------------
Released January 2026
diff --git a/phosh/data/icons/fake-app.svg b/phosh/data/icons/fake-app.svg
new file mode 100644
index 000000000..26b42d774
--- /dev/null
+++ b/phosh/data/icons/fake-app.svg
@@ -0,0 +1,118 @@
+
+
+
+
diff --git a/phosh/data/mobi.phosh.shell.gschema.xml b/phosh/data/mobi.phosh.shell.gschema.xml
index 0df34d8dc..8494b1812 100644
--- a/phosh/data/mobi.phosh.shell.gschema.xml
+++ b/phosh/data/mobi.phosh.shell.gschema.xml
@@ -11,17 +11,6 @@
-
-
- 0.0
-
- Auto brightness offset
-
- Fixed offset added to the calculated auto brightnes value.
-
-
-
-
diff --git a/phosh/data/phosh-portals.conf b/phosh/data/phosh-portals.conf
index 3bf377d27..600c13984 100644
--- a/phosh/data/phosh-portals.conf
+++ b/phosh/data/phosh-portals.conf
@@ -1,5 +1,5 @@
[preferred]
-default=phrosh;phosh;gtk;
+default=phosh;phrosh;gtk;
org.freedesktop.impl.portal.Access=phosh-shell;
org.freedesktop.impl.portal.Background=none;
org.freedesktop.impl.portal.Clipboard=none;
diff --git a/phosh/data/phosh-session.in b/phosh/data/phosh-session.in
index 960eb5e7a..878e716d9 100755
--- a/phosh/data/phosh-session.in
+++ b/phosh/data/phosh-session.in
@@ -2,7 +2,7 @@
COMPOSITOR="@compositor@"
PHOC_INI="@pkgdatadir@/phoc.ini"
-PHOSH_SESSION_BIN=${PHOSH_SESSION_BIN:-gnome-session}
+GNOME_SESSION=${GNOME_SESSION:-gnome-session}
help()
{
@@ -52,4 +52,6 @@ fi
[ -n "$WLR_BACKENDS" ] || WLR_BACKENDS=drm,libinput
export WLR_BACKENDS
-exec $SYSTEMD_CAT "${COMPOSITOR}" -v -S -C "${PHOC_INI}" -E "${PHOSH_SESSION_BIN} --session=phosh"
+# Run gnome-session through a login shell so it picks
+# variables from /etc/profile.d (XDG_*)
+exec $SYSTEMD_CAT "${COMPOSITOR}" -v -S -C "${PHOC_INI}" -E "bash -lc 'exec ${GNOME_SESSION} --disable-acceleration-check --session=phosh'"
diff --git a/phosh/debian/changelog b/phosh/debian/changelog
index 4ffa9620a..9230bf583 100644
--- a/phosh/debian/changelog
+++ b/phosh/debian/changelog
@@ -1,250 +1,3 @@
-phosh (0.53.0) experimental; urgency=medium
-
- [ Guido Günther ]
- * portal: Use Rust based GUI variants by default. We want to drop the C
- variants so let's switch.
- * gvc: Update to latest upstream commit. We landed another bugfix, let's
- grab it
-
- [ Álvaro Burns ]
- * Update Brazilian Portuguese translation
-
- [ Quentin PAGÈS ]
- * Update Occitan translation
-
- -- Guido Günther Sun, 15 Feb 2026 09:23:10 +0100
-
-phosh (0.53~rc1) experimental; urgency=medium
-
- [ Efstathios Iosifidis ]
- * Update Greek translation
-
- [ Antonio Marin ]
- * Update Romanian translation
-
- [ Guido Günther ]
- * run: Use plugin_schema_path.
- We have it already so no need to maintain it in two locations
- Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1298o
- * util: Allow to activate without actions
- * util: Make platform-data helpers public. We'll use them for
- notifications
- * util: Determine object path automatically.
- Code taken from xdg-desktop-portal-phosh
- * notification: Activate applications when sending notifications.
- We activate the app and send the signal.
- Should our heuristic to determine the bus name fail to work well we
- can send `org.freedesktop.Notifications.ActivationToken` in
- `on_app_activated` as a future improvement.
- Helps: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/852
- * doc: Document missing plugin schema entries
- * brightness-manager: Use _ID for schema consistently.
- No point in having one schema with that suffix and the other without it.
- * brightness-manager: Use faster up interval.
- The human eye adjust to brightness gains more rapidly.
- * backlight: Round backlight level.
- This gives us more precise values than integer cutoff.
- * brightness-manager: Simplify ending the transition
- * brightness-manager: Smoothen brightness transition.
- Use smoothstep to make things look less jittering
- * monitor-manager: Add night light temperature property.
- This allows us to track whether it is in use
- * brightness-manager: Add additional factor when night light is on.
- Night light reduces contrast as the eye is less susceptible to contrast
- in the red spectrum. Lets make the display a bit brighter in those
- cases.
- Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1292
- * brightness-manager: Drop schema check. We can assume the 49 schema
- now.
- * brightness-manager: Add auto-brightness offset.
- Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1297
- * util: Fix indent.
- Gbp-dch: Ignore
- * app-tracker: Fix indent.
- We shorten a variable name and add get the shell variable in an extra
- step for readability.
- * app-list-model: Allow app-info lookup by recently launched executable.
- The shell is usually used to launch apps so when launching remember the
- executable. This will allow us look up app-info by exectable.
- This is useful for DBus activated apps too as they still usually `Exec`
- have an exec line in the desktop file.
- * audio-manager: Manage audio devices.
- Track the input and output audio devices
- * audio-settings: Use audio-devices and mixer control from audio-manager.
- This will allow us to use audio devices outside settings
- * audio-devices: Move out of settings.
- They're used in the audio manager now
- * channel-bar: Use proper namespace.
- It's a widget in Phosh so use that namespace. This also removes some
- confusion between the gvc submodule and our internal widget.
- * channel-bar: Rename source files.
- Do that in an extra commit to ease review
- * audio-settings: Avoid channel-bar casts.
- Just use the most specific type right away.
- * audio-settings: Avoid pointless cast
- * channel-bar: Remove unused defines
- * audio-devices: Use type.
- We used gpointer to not leak it into libphosh but the library
- is more self contained nowadays.
- * overview: Use common pattern for find_activity_by_toplevel()
- Return early from the loop instead of breaking and make the `l->data`
- assignment the first thing in the loop.
- Also make sure `g_autoptr ()` is always initialized.
- Again fewer lines with easier to read code.
- * overview: Use most specific type for carousel.
- Avoids the long casts
- * activity: Just use `MIN`
- No need to open code this.
- * activity: Use phosh_util_toggle_style_class consistently.
- We use it to remove the class, use it for adding it too
- * shell: Create splash manager earlier.
- We want to use it from the overview so it has to be there with the
- panels.
- * shell: Allow to get splash manager
- * swipe-tracker: Allow to disable swipes
- * splash: Allow to lower/raise the splash
- * splash-manager: Allow to lower all splashs and to raise base on startup-id
- * overview: Use splash colors instead of fake app.
- The fake app wasn't very useful. Use the splash screen
- colors instead.
- * activity: Show spinner when we don't have a thumbnail.
- Add a spinner and show it when we don't have a thumbnail of the
- application yet.
- * activity: Disable swipe and close button while app is loading.
- We can't stop it sensibly atm.
- * activity: Try harder to get an app-id
- * overview: Show activity for launching apps.
- This gives the user feedback that the app is launching.
- Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/647
- * overview: Add splash manager
- * overview: Raise and lower launch splashs.
- When activating a splash we raise it to the top, when activating
- an activity we lower all splashs so the app becomes visible.
- This is not the ideal place to do it as it doesn't concernt the overview
- but we track the toplevels here only atm (see
- https://gitlab.gnome.org/World/Phosh/phosh/-/issues/327)
- Helps: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/812
- Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/813
- * overview: Use light mode based on what the splash manager does.
- We won't switch when the user flips the theme during launch but
- that's o.k. for the moment.
- * activity: Render empty state only on drawing area.
- This makes the thumbnail look more like the app
- * activity: Use slightly rounded corners
- * phosh-session: Drop disable-acceleration-check.
- It is a noop nowadays
- * phosh-session: Avoid the extra shell exec
- gnome-session handles that for us
- * phosh-session: Use name variable.
- This ensures we don't accidentally clash with something set
- in the environment
- * media-player: Avoid nan when track length is empty.
- Zero track length (as happens with gapless) can lead to -NAN
- which trips up the progress bar. Use 0.0 in that case.
- Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1287
- * brightness-manager: Skip brightenss update.
- We can skip the brightness update on night light changes when
- auto brightness is disabled.
- * lockscreen: Sort callbacks alphabetically
- * lockscreen: Use two finger swipe gesture for brightness.
- This works better then trying to fit a zoom gesture. Move
- to the UI file while at that.
- Fixes: 336929ca4 ("lockscreen: Ignore gesture when user wants to zoom")
- Co-authored-by: Arun Mani J
- * packaging: Update dependencies.
- We need recent schema to start successfully. Drop an ancient
- conflict on calls and require stevia so we always have a working
- OSK (user can still switch ofc).
- * docs: Mention UsesNotifications.
- This is is similar to UsesFeedback.
- * gvc: Switch back to blessed repo.
- Most of our patches are in. The leak fix is still missing but hopefully
- we get that soon.
- Update to 664eba4 ("mixer-control: Document that add_stream is transfer full")
- * overview: Ignore missing activity.
- When an app failed to start and we can't find a matching
- activity that is usually because it crashed or exited
- already. Avoid a critical in that case.
- * toplevel-manager: Drop super-cautious checks.
- The pointer arrays are created in init and never unref'ed or
- free'd until dispose so no need to check this every call.
- * overview: Drop unused arguments from signal handler.
- No need to check types we never use
- * toplevel-manager: Track launched apps.
- When an app is reporting that it launced we track its app-id
- and wait for a matching toplevel in toplevel-manager. When
- that doesn't happen in time, we send out a signal.
- * overview: Remove splash if we never get a toplevel.
- In the unlikely case that we don't see a toplevel from a launched
- app, remove the splash when toplevel-manager tells us that the
- toplevel will likely never show up.
-
- [ Jürgen Benvenuti ]
- * Update German translation
-
- [ Fredrik Fyksen ]
- * Update Norwegian Bokmål translation
-
- [ twlvnn kraftwerk ]
- * Update Bulgarian translation
-
- [ Flynn Peck ]
- * Add Cornish translation
-
- [ Arun Mani J ]
- * pokit-auth-agent: Follow our coding style
- * polkit-auth-prompt: Follow our coding style
- * polkit-auth-agent: Uncrustify
- * polkit-auth-prompt: Uncrustify
- * polkit-auth-prompt: Display more information about user.
- Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1229
-
- [ Rudra Pratap Singh ]
- * top-panel: Add a common parsing function for panel options.
- This way, we can keep the parsing in
- sync for both mobile and non mobile panels.
- * top-panel: Make panel launching actions take parameters.
- Instead of a string we use (sav) parameter type
- so we can pass additional parameters.
- * util: Allow to open settings panel with additional parameters.
- We add a second parameter to
- `phosh_util_open_mobile_settings_panel`, allowing
- one to send panel options alongside. The panel
- name and options can then be packed to remotely
- activate settings app accordingly.
- * caffeine-quick-setting: Allow to open prefs via mobile settings.
- Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1280
-
- [ Danial Behzadi ]
- * Update Persian translation
-
- [ Yuri Chornoivan ]
- * Update Ukrainian translation
-
- [ Martin ]
- * Update Slovenian translation
-
- [ Ekaterine Papava ]
- * Update Georgian translation
-
- [ Anders Jonsson ]
- * Update Swedish translation
-
- [ Sabri Ünal ]
- * Update Turkish translation
-
- [ AJ Dunevent ]
- * device-row: Use 'alias' instead of 'name' for device display.
- The 'alias' property is preferred as it contains user-defined names
- while falling back to the hardware name if no alias is set. Stays
- consistent with other UI elements, similar environments, etc.
- Closes: https://gitlab.gnome.org/World/Phosh/phosh/-/issues/1300
-
- [ Artur S0 ]
- * Update Russian translation
-
- -- Guido Günther Tue, 10 Feb 2026 18:03:17 +0100
-
phosh (0.52.1) experimental; urgency=medium
* gvc: Handle port changes on streams.
diff --git a/phosh/debian/control b/phosh/debian/control
index b9154644a..f6ba60e01 100644
--- a/phosh/debian/control
+++ b/phosh/debian/control
@@ -9,7 +9,7 @@ Build-Depends:
libadwaita-1-dev,
libappstream-dev,
libcallaudio-dev,
- libevince-dev,
+ libpapers-dev,
libgirepository1.0-dev,
libgmobile-dev,
libjson-glib-dev,
@@ -74,16 +74,16 @@ Depends:
${misc:Depends},
${shlibs:Depends},
fonts-lato,
- gnome-shell-common (>= 49),
- gsettings-desktop-schemas (>= 49),
+ gnome-shell-common,
+ gsettings-desktop-schemas (>= 47),
libcap2-bin,
libqrcodegen1,
- phoc (>= 0.52.0),
+ phoc (>= 0.45.0),
phosh-common (= ${source:Version}),
Recommends:
feedbackd (>= 0.5.0),
- fonts-adwaita,
- gnome-session-bin (>= 49),
+ fonts-cantarell,
+ gnome-session-bin,
gnome-session-common,
gnome-settings-daemon (>= 49),
iio-sensor-proxy,
@@ -93,11 +93,12 @@ Recommends:
phosh-mobile-tweaks,
phosh-plugins,
slurp,
- phosh-osk-stevia,
+ phosh-osk-stevia | squeekboard,
Provides:
notification-daemon,
polkit-1-auth-agent,
Breaks:
+ gnome-calls (<< 42),
gnome-control-center (<< 42),
gnome-settings-daemon (<< 49),
libgtk-3-0 (<< 3.24.30),
diff --git a/phosh/docs/app-dev.md b/phosh/docs/app-dev.md
index f4135b766..d7119f65b 100644
--- a/phosh/docs/app-dev.md
+++ b/phosh/docs/app-dev.md
@@ -26,10 +26,6 @@ additional entries:
feedbackd to trigger audio, haptic or led feedback. This is useful for setting
applications so they can show entries for individual apps.
Example: `X-Phosh-UsesFeedback=true`
-* `X-GNOME-UsesNotifications`: Used to indicate that application submit notifications
- This is useful for setting applications so they can show entries for
- individual apps to fine tune their feedback.
- Example: `X-GNOME-UsesNotifications=true`
## Desktop Notification Specification
diff --git a/phosh/docs/phosh.gsettings.rst b/phosh/docs/phosh.gsettings.rst
index 729e77c5b..f9ba92a8b 100644
--- a/phosh/docs/phosh.gsettings.rst
+++ b/phosh/docs/phosh.gsettings.rst
@@ -26,10 +26,6 @@ GSettings
These gsettings are used by ``phosh``:
-- `mobi.phosh.shell.brightness`
-
- - `auto-brightness-offset`: Offset added to the calculated auto brightness value
-
- `mobi.phosh.shell.cell-broadcast`
- `enabled`: Whether receiving cell broadcasts is enabled
@@ -82,7 +78,7 @@ These gsettings are used by ``phosh``:
- `sm.puri.phosh.plugins.launcher-box`
- - `folder`: The folder containing the desktop files to show in the launcher box
+ - `folder`
- `sm.puri.phosh.plugins.ticket-box`
@@ -90,7 +86,7 @@ These gsettings are used by ``phosh``:
- `sm.puri.phosh.plugins.upcoming-events`
- - `days`: Number of days to show in the upcoming events list
+ - `days`
- `org.gnome.desktop.app-folders.folder`: Folder support
diff --git a/phosh/meson.build b/phosh/meson.build
index f7a08c37e..1298e5bea 100644
--- a/phosh/meson.build
+++ b/phosh/meson.build
@@ -1,7 +1,7 @@
project(
'phosh',
'c',
- version: '0.53.0',
+ version: '0.52.1',
license: 'GPL-3.0-or-later',
meson_version: '>= 1.7.0',
default_options: [
@@ -122,6 +122,11 @@ endif
add_project_arguments(global_c_args, language: 'c')
+run_data = configuration_data()
+run_data.set('ABS_BUILDDIR', meson.current_build_dir())
+run_data.set('ABS_SRCDIR', meson.current_source_dir())
+configure_file(input: 'run.in', output: 'run', configuration: run_data)
+
gnome = import('gnome')
i18n = import('i18n')
pkgconfig = import('pkgconfig')
@@ -130,11 +135,12 @@ appstream_dep = dependency('appstream', version: '>= 1.0.0')
ecal_dep = dependency('libecal-2.0', version: '>= 3.33.1')
eds_dep = dependency('libedataserver-1.2', version: '>= 3.33.1')
fribidi_dep = dependency('fribidi')
-gcr_dep = dependency('gcr-3', version: '>= 3.7.5')
+gcr_dep = dependency('gcr-4', version: '>= 4.3.0')
glib_dep = dependency('glib-2.0', version: glib_ver_cmp)
gio_dep = dependency('gio-2.0', version: glib_ver_cmp)
-gio_unix_dep = dependency('gio-unix-2.0', version: glib_ver_cmp)
-gnome_bluetooth_dep = dependency('gnome-bluetooth-3.0', version: '>= 46.0')
+gio_unix_dep = dependency('gio-unix-2.0', version: glib_ver_cmp)
+gnome_bg_dep = dependency('gnome-bg-4')
+gnome_bluetooth_dep = dependency ('gnome-bluetooth-3.0', version: '>= 46.0')
gmobile_dep = dependency(
'gmobile',
version: '>= 0.1.0',
@@ -147,15 +153,15 @@ gmobile_dep = dependency(
],
)
gmodule_dep = dependency('gmodule-no-export-2.0', version: glib_ver_cmp)
-gnome_desktop_dep = dependency('gnome-desktop-3.0', version: '>=3.26')
+gnome_desktop_dep = dependency('gnome-desktop-4', version: '>=4.0')
gobject_dep = dependency('gobject-2.0', version: glib_ver_cmp)
gsettings_desktop_schemas_dep = dependency(
'gsettings-desktop-schemas',
version: '>=47',
)
-gtk_dep = dependency('gtk+-3.0', version: '>=3.22')
-gtk_wayland_dep = dependency('gtk+-wayland-3.0', version: '>=3.22')
+gtk_dep = dependency('gtk4', version: '>=4.15')
gudev_dep = dependency('gudev-1.0')
+libadwaita_dep = dependency('libadwaita-1')
libcall_ui = subproject(
'libcall-ui',
default_options: [
@@ -189,12 +195,6 @@ libgvc = subproject(
],
)
libgvc_dep = libgvc.get_variable('libgvc_dep')
-libhandy_dep = dependency(
- 'libhandy-1',
- version: '>=1.1.90',
- fallback: ['libhandy', 'libhandy_dep'],
- default_options: ['introspection=disabled'],
-)
libcall_ui_dep = libcall_ui.get_variable('libcall_ui_dep')
libnm_dep = dependency('libnm', version: '>= 1.14')
libpolkit_agent_dep = dependency('polkit-agent-1', version: '>= 0.122')
@@ -249,19 +249,11 @@ configure_file(
install_dir: lib_inc_dir,
)
-
subdir('data')
subdir('po')
subdir('protocol')
subdir('src')
subdir('plugins')
-
-run_data = configuration_data()
-run_data.set('ABS_BUILDDIR', meson.current_build_dir())
-run_data.set('ABS_SRCDIR', meson.current_source_dir())
-run_data.set('PLUGIN_SCHEMA_PATH', plugin_schema_path)
-configure_file(input: 'run.in', output: 'run', configuration: run_data)
-
subdir('searchd')
subdir('tests')
subdir('tools')
diff --git a/phosh/plugins/caffeine-quick-setting/caffeine-quick-setting.c b/phosh/plugins/caffeine-quick-setting/caffeine-quick-setting.c
index fea45648d..8d65497cc 100644
--- a/phosh/plugins/caffeine-quick-setting/caffeine-quick-setting.c
+++ b/phosh/plugins/caffeine-quick-setting/caffeine-quick-setting.c
@@ -193,17 +193,17 @@ on_interval_row_activated (GtkListBox *listbox,
PhoshCaffeineQuickSetting *self)
{
uint selected_idx = 0;
- g_autoptr (GList) children = NULL;
if (self->cur_row != row) {
+ GtkListBoxRow *child;
phosh_caffeine_quick_setting_clear_timer (self);
- children = gtk_container_get_children (GTK_CONTAINER (self->listbox));
- for (GList *child = children; child; child = child->next) {
- if (child->data == row)
+ child = gtk_list_box_get_row_at_index (self->listbox, selected_idx);
+ while (child) {
+ if (child == row)
break;
-
selected_idx++;
+ child = gtk_list_box_get_row_at_index (self->listbox, selected_idx);
}
g_settings_set_uint (self->settings, CAFFEINE_SELECTED_KEY, selected_idx);
@@ -317,8 +317,14 @@ static void
on_selected_index_changed (PhoshCaffeineQuickSetting *self)
{
uint selected_idx = g_settings_get_uint (self->settings, CAFFEINE_SELECTED_KEY);
- g_autoptr (GList) children = gtk_container_get_children (GTK_CONTAINER (self->listbox));
- uint len = g_list_length (children);
+ GtkListBoxRow *child;
+ uint len = 0;
+
+ child = gtk_list_box_get_row_at_index (self->listbox, len);
+ while (child) {
+ len++;
+ child = gtk_list_box_get_row_at_index (self->listbox, len);
+ }
phosh_caffeine_quick_setting_clear_timer (self);
@@ -346,14 +352,12 @@ on_intervals_changed (PhoshCaffeineQuickSetting *self)
GVariantIter iter;
PhoshIntervalRow* row = NULL;
g_autoptr (GVariant) intervals = NULL;
- g_autoptr (GList) children = gtk_container_get_children (GTK_CONTAINER (self->listbox));
g_debug ("Intervals changed, reconfiguring listbox...");
self->cur_row = NULL;
- for (GList *child = children; child; child = child->next)
- gtk_container_remove (GTK_CONTAINER (self->listbox), child->data);
+ gtk_list_box_remove_all (self->listbox);
intervals = g_settings_get_value (self->settings, CAFFEINE_INTERVALS_KEY);
@@ -373,7 +377,7 @@ static void
phosh_caffeine_quick_setting_init (PhoshCaffeineQuickSetting *self) {
gtk_widget_init_template (GTK_WIDGET (self));
- gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (),
+ gtk_icon_theme_add_resource_path (gtk_icon_theme_get_for_display (gdk_display_get_default ()),
"/mobi/phosh/plugins/caffeine-quick-setting/icons");
self->settings = g_settings_new (CAFFEINE_QUICK_SETTING_SCHEMA);
diff --git a/phosh/plugins/caffeine-quick-setting/interval-row.c b/phosh/plugins/caffeine-quick-setting/interval-row.c
index 191a33096..e5eb6169c 100644
--- a/phosh/plugins/caffeine-quick-setting/interval-row.c
+++ b/phosh/plugins/caffeine-quick-setting/interval-row.c
@@ -26,14 +26,14 @@ enum {
static GParamSpec *props[PROP_LAST_PROP];
struct _PhoshIntervalRow {
- HdyActionRow parent;
+ AdwActionRow parent;
GtkRevealer *revealer;
uint value;
gboolean selected;
};
-G_DEFINE_TYPE (PhoshIntervalRow, phosh_interval_row, HDY_TYPE_ACTION_ROW);
+G_DEFINE_TYPE (PhoshIntervalRow, phosh_interval_row, ADW_TYPE_ACTION_ROW);
static void
phosh_interval_row_set_value (PhoshIntervalRow *self, uint value)
@@ -43,9 +43,9 @@ phosh_interval_row_set_value (PhoshIntervalRow *self, uint value)
if (value < PHOSH_INTERVAL_ROW_INFINITY_VALUE) {
g_autofree char *label = cui_call_format_duration ((double) value);
- hdy_preferences_row_set_title (HDY_PREFERENCES_ROW (self), label);
+ adw_preferences_row_set_title (ADW_PREFERENCES_ROW (self), label);
} else {
- hdy_preferences_row_set_title (HDY_PREFERENCES_ROW (self), "∞");
+ adw_preferences_row_set_title (ADW_PREFERENCES_ROW (self), "∞");
}
g_object_bind_property (self,
diff --git a/phosh/plugins/caffeine-quick-setting/interval-row.h b/phosh/plugins/caffeine-quick-setting/interval-row.h
index 2c11b6a75..586a8b9ce 100644
--- a/phosh/plugins/caffeine-quick-setting/interval-row.h
+++ b/phosh/plugins/caffeine-quick-setting/interval-row.h
@@ -6,7 +6,7 @@
#pragma once
-#include
+#include
#define PHOSH_INTERVAL_ROW_INFINITY_VALUE G_MAXUINT32
@@ -14,7 +14,7 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_INTERVAL_ROW (phosh_interval_row_get_type ())
-G_DECLARE_FINAL_TYPE (PhoshIntervalRow, phosh_interval_row, PHOSH, INTERVAL_ROW, HdyActionRow)
+G_DECLARE_FINAL_TYPE (PhoshIntervalRow, phosh_interval_row, PHOSH, INTERVAL_ROW, AdwActionRow)
PhoshIntervalRow *phosh_interval_row_new (uint value, gboolean selected);
uint phosh_interval_row_get_value (PhoshIntervalRow *self);
diff --git a/phosh/plugins/caffeine-quick-setting/interval-row.ui b/phosh/plugins/caffeine-quick-setting/interval-row.ui
index df286c0fa..9adecfb8b 100644
--- a/phosh/plugins/caffeine-quick-setting/interval-row.ui
+++ b/phosh/plugins/caffeine-quick-setting/interval-row.ui
@@ -1,8 +1,7 @@
-
-
-
+
+
1
1
@@ -14,13 +13,13 @@
diff --git a/phosh/plugins/caffeine-quick-setting/qs.ui b/phosh/plugins/caffeine-quick-setting/qs.ui
index 1c28c5c1c..cd84b1772 100644
--- a/phosh/plugins/caffeine-quick-setting/qs.ui
+++ b/phosh/plugins/caffeine-quick-setting/qs.ui
@@ -1,7 +1,8 @@
-
+
+ 0
info
status_page
@@ -14,7 +15,6 @@
1
Caffeine timers
stack
- footer
1
@@ -42,18 +42,4 @@
-
diff --git a/phosh/plugins/calendar/calendar.c b/phosh/plugins/calendar/calendar.c
index d82f883ae..a4834c787 100644
--- a/phosh/plugins/calendar/calendar.c
+++ b/phosh/plugins/calendar/calendar.c
@@ -40,18 +40,10 @@ on_settings_changed (GSettings *settings,
gpointer user_data)
{
PhoshCalendar *self = PHOSH_CALENDAR (user_data);
- GtkCalendarDisplayOptions display_options;
gboolean display_week;
- display_options = gtk_calendar_get_display_options (self->calendar);
display_week = g_settings_get_boolean (settings, key);
-
- if (display_week)
- display_options |= GTK_CALENDAR_SHOW_WEEK_NUMBERS;
- else
- display_options &= ~GTK_CALENDAR_SHOW_WEEK_NUMBERS;
-
- gtk_calendar_set_display_options (self->calendar, display_options);
+ gtk_calendar_set_show_week_numbers (self->calendar, display_week);
}
@@ -82,9 +74,9 @@ phosh_calendar_init (PhoshCalendar *self)
css_provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (css_provider,
"/mobi/phosh/plugins/calendar/stylesheet/common.css");
- gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (self)),
- GTK_STYLE_PROVIDER (css_provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (css_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
self->calendar_settings = g_settings_new ("org.gnome.desktop.calendar");
g_signal_connect (self->calendar_settings,
diff --git a/phosh/plugins/calendar/calendar.ui b/phosh/plugins/calendar/calendar.ui
index 86baedf6d..b9c4703fb 100644
--- a/phosh/plugins/calendar/calendar.ui
+++ b/phosh/plugins/calendar/calendar.ui
@@ -1,7 +1,8 @@
-
+
+ 0
vertical
12
12
diff --git a/phosh/plugins/dark-mode-quick-setting/dark-mode-quick-setting.c b/phosh/plugins/dark-mode-quick-setting/dark-mode-quick-setting.c
index 26096ca7a..23cb7e37e 100644
--- a/phosh/plugins/dark-mode-quick-setting/dark-mode-quick-setting.c
+++ b/phosh/plugins/dark-mode-quick-setting/dark-mode-quick-setting.c
@@ -118,7 +118,7 @@ phosh_dark_mode_quick_setting_init (PhoshDarkModeQuickSetting *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
- gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (),
+ gtk_icon_theme_add_resource_path (gtk_icon_theme_get_for_display (gdk_display_get_default ()),
"/mobi/phosh/plugins/dark-mode-quick-setting/icons");
self->settings = g_settings_new ("org.gnome.desktop.interface");
diff --git a/phosh/plugins/dark-mode-quick-setting/qs.ui b/phosh/plugins/dark-mode-quick-setting/qs.ui
index c1421993a..24c8bafc2 100644
--- a/phosh/plugins/dark-mode-quick-setting/qs.ui
+++ b/phosh/plugins/dark-mode-quick-setting/qs.ui
@@ -1,7 +1,8 @@
-
+
+ 0
info
diff --git a/phosh/plugins/emergency-info/emergency-info-row.c b/phosh/plugins/emergency-info/emergency-info-row.c
index e4ab5d42a..8c74a3514 100644
--- a/phosh/plugins/emergency-info/emergency-info-row.c
+++ b/phosh/plugins/emergency-info/emergency-info-row.c
@@ -9,7 +9,6 @@
#include "emergency-info-row.h"
#include
-#include
enum {
PROP_0,
@@ -19,12 +18,12 @@ enum {
static GParamSpec *props[PROP_LAST_PROP];
struct _PhoshEmergencyInfoRow {
- HdyActionRow parent;
+ AdwActionRow parent;
GtkLabel *label_contact;
};
-G_DEFINE_TYPE (PhoshEmergencyInfoRow, phosh_emergency_info_row, HDY_TYPE_ACTION_ROW)
+G_DEFINE_TYPE (PhoshEmergencyInfoRow, phosh_emergency_info_row, ADW_TYPE_ACTION_ROW)
/* TODO: Clicking on the emergency contact does nothing. */
diff --git a/phosh/plugins/emergency-info/emergency-info-row.h b/phosh/plugins/emergency-info/emergency-info-row.h
index 50e7745c7..d4fa1a9ee 100644
--- a/phosh/plugins/emergency-info/emergency-info-row.h
+++ b/phosh/plugins/emergency-info/emergency-info-row.h
@@ -9,13 +9,13 @@
#include "emergency-info.h"
#include
-#include
+#include
G_BEGIN_DECLS
#define PHOSH_TYPE_EMERGENCY_INFO_ROW (phosh_emergency_info_row_get_type ())
-G_DECLARE_FINAL_TYPE (PhoshEmergencyInfoRow, phosh_emergency_info_row, PHOSH, EMERGENCY_INFO_ROW, HdyActionRow)
+G_DECLARE_FINAL_TYPE (PhoshEmergencyInfoRow, phosh_emergency_info_row, PHOSH, EMERGENCY_INFO_ROW, AdwActionRow)
GtkWidget *phosh_emergency_info_row_new (const char *contact,
const char *number,
diff --git a/phosh/plugins/emergency-info/emergency-info-row.ui b/phosh/plugins/emergency-info/emergency-info-row.ui
index b658ddbae..0d42b7865 100644
--- a/phosh/plugins/emergency-info/emergency-info-row.ui
+++ b/phosh/plugins/emergency-info/emergency-info-row.ui
@@ -1,8 +1,7 @@
-
-
-
+
+
1
diff --git a/phosh/plugins/emergency-info/emergency-info.c b/phosh/plugins/emergency-info/emergency-info.c
index 58fb1193d..4b9eb55ff 100644
--- a/phosh/plugins/emergency-info/emergency-info.c
+++ b/phosh/plugins/emergency-info/emergency-info.c
@@ -68,33 +68,33 @@ struct _PhoshEmergencyInfo {
GtkLabel *label_height;
GtkLabel *label_weight;
- HdyActionRow *row_owner_name;
- HdyActionRow *row_dob;
- HdyActionRow *row_language;
- HdyActionRow *row_home_address;
- HdyActionRow *row_age;
- HdyActionRow *row_blood_type;
- HdyActionRow *row_height;
- HdyActionRow *row_weight;
- HdyActionRow *row_allergies;
- HdyActionRow *row_medications;
- HdyActionRow *row_other_info;
-
- HdyPreferencesGroup *pers_info;
- HdyPreferencesGroup *emer_info;
- HdyPreferencesGroup *emer_contacts;
+ AdwActionRow *row_owner_name;
+ AdwActionRow *row_dob;
+ AdwActionRow *row_language;
+ AdwActionRow *row_home_address;
+ AdwActionRow *row_age;
+ AdwActionRow *row_blood_type;
+ AdwActionRow *row_height;
+ AdwActionRow *row_weight;
+ AdwActionRow *row_allergies;
+ AdwActionRow *row_medications;
+ AdwActionRow *row_other_info;
+
+ AdwPreferencesGroup *pers_info;
+ AdwPreferencesGroup *emer_info;
+ AdwPreferencesGroup *emer_contacts;
};
G_DEFINE_TYPE (PhoshEmergencyInfo, phosh_emergency_info, GTK_TYPE_BOX);
static gboolean
set_subtitle_or_hide_widget (const char *label,
- HdyActionRow *widget_action_row)
+ AdwActionRow *widget_action_row)
{
gboolean visible;
visible = !!(label && *label);
- hdy_action_row_set_subtitle (widget_action_row, label);
+ adw_action_row_set_subtitle (widget_action_row, label);
gtk_widget_set_visible (GTK_WIDGET (widget_action_row), visible);
return visible;
}
@@ -218,8 +218,8 @@ load_info (PhoshEmergencyInfo *self)
new_row = phosh_emergency_info_row_new (self->contacts[i],
number_split[0],
number_split[1]);
- gtk_container_add (GTK_CONTAINER (self->emer_contacts),
- GTK_WIDGET (new_row));
+ adw_preferences_group_add (self->emer_contacts,
+ GTK_WIDGET (new_row));
}
}
@@ -320,9 +320,9 @@ phosh_emergency_info_init (PhoshEmergencyInfo *self)
gtk_css_provider_load_from_resource (css_provider,
"/mobi/phosh/plugins/emergency-info/stylesheet/common.css");
- gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (self)),
- GTK_STYLE_PROVIDER (css_provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (css_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
load_info (self);
}
diff --git a/phosh/plugins/emergency-info/emergency-info.h b/phosh/plugins/emergency-info/emergency-info.h
index 74092dcf9..23e9b8721 100644
--- a/phosh/plugins/emergency-info/emergency-info.h
+++ b/phosh/plugins/emergency-info/emergency-info.h
@@ -8,7 +8,7 @@
#include
-#include
+#include
#pragma once
diff --git a/phosh/plugins/emergency-info/emergency-info.ui b/phosh/plugins/emergency-info/emergency-info.ui
index af7fe095e..1cffa6d11 100644
--- a/phosh/plugins/emergency-info/emergency-info.ui
+++ b/phosh/plugins/emergency-info/emergency-info.ui
@@ -1,7 +1,6 @@
-
-
+
vertical
12
@@ -14,13 +13,13 @@
never
1
1
-
+
1
1
vertical
-
+
1
0
1
@@ -38,13 +37,13 @@
-
+
1
Personal Information
12
12
-
+
1
0
1
@@ -64,7 +63,7 @@
-
+
1
0
1
@@ -84,7 +83,7 @@
-
+
1
0
1
@@ -94,13 +93,13 @@
-
+
1
Medical Information
12
12
-
+
1
0
1
@@ -120,7 +119,7 @@
-
+
1
0
1
@@ -140,7 +139,7 @@
-
+
1
0
1
@@ -160,7 +159,7 @@
-
+
1
0
1
@@ -180,7 +179,7 @@
-
+
1
0
1
@@ -188,15 +187,16 @@
-
+
1
0
+ 0
1
Medications & Conditions
-
+
1
0
1
@@ -206,7 +206,7 @@
-
+
1
Emergency Contacts
12
@@ -214,7 +214,7 @@
-
+
diff --git a/phosh/plugins/emergency-info/prefs/emergency-info-prefs-row.ui b/phosh/plugins/emergency-info/prefs/emergency-info-prefs-row.ui
index 8656135ea..6e9254e4b 100644
--- a/phosh/plugins/emergency-info/prefs/emergency-info-prefs-row.ui
+++ b/phosh/plugins/emergency-info/prefs/emergency-info-prefs-row.ui
@@ -1,6 +1,6 @@
-
+
diff --git a/phosh/plugins/launcher-box/launcher-box.c b/phosh/plugins/launcher-box/launcher-box.c
index 255708efb..651dce494 100644
--- a/phosh/plugins/launcher-box/launcher-box.c
+++ b/phosh/plugins/launcher-box/launcher-box.c
@@ -276,7 +276,7 @@ phosh_launcher_box_init (PhoshLauncherBox *self)
css_provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (css_provider,
"/mobi/phosh/plugins/launcher-box/stylesheet/common.css");
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (css_provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
diff --git a/phosh/plugins/launcher-box/launcher-box.ui b/phosh/plugins/launcher-box/launcher-box.ui
index 5c0b660cb..6a244afb0 100644
--- a/phosh/plugins/launcher-box/launcher-box.ui
+++ b/phosh/plugins/launcher-box/launcher-box.ui
@@ -1,6 +1,6 @@
-
+
vertical
12
@@ -11,24 +11,29 @@
1
-
+
+ no-launchers
+
+
1
applications-utilities-symbolic
Launcher Box
No launchers configured
-
- no-launchers
-
+
+
+
+ launchers
+
1
never
1
480
-
+
1
Launchers
@@ -42,9 +47,8 @@
-
- launchers
-
+
+
diff --git a/phosh/plugins/launcher-box/launcher-row.c b/phosh/plugins/launcher-box/launcher-row.c
index 3022e0472..f81234901 100644
--- a/phosh/plugins/launcher-box/launcher-row.c
+++ b/phosh/plugins/launcher-box/launcher-row.c
@@ -11,7 +11,6 @@
#include "launcher-row.h"
#include
-#include
enum {
@@ -23,7 +22,7 @@ static GParamSpec *props[PROP_LAST_PROP];
struct _PhoshLauncherRow {
- HdyActionRow parent;
+ AdwActionRow parent;
PhoshLauncherItem *item;
@@ -31,7 +30,7 @@ struct _PhoshLauncherRow {
GtkWidget *progress_bar;
GtkWidget *box_data;
};
-G_DEFINE_TYPE (PhoshLauncherRow, phosh_launcher_row, HDY_TYPE_ACTION_ROW)
+G_DEFINE_TYPE (PhoshLauncherRow, phosh_launcher_row, ADW_TYPE_ACTION_ROW)
static gboolean
@@ -60,16 +59,16 @@ set_item (PhoshLauncherRow *self, PhoshLauncherItem *item)
self->item = g_object_ref (item);
info = phosh_launcher_item_get_app_info (item);
- hdy_preferences_row_set_title (HDY_PREFERENCES_ROW (self),
+ adw_preferences_row_set_title (ADW_PREFERENCES_ROW (self),
g_app_info_get_display_name (G_APP_INFO (info)));
icon_name = g_desktop_app_info_get_string (info, "Icon");
if (icon_name)
- hdy_action_row_set_icon_name (HDY_ACTION_ROW (self), icon_name);
+ adw_action_row_add_prefix (ADW_ACTION_ROW (self), gtk_image_new_from_icon_name (icon_name));
desc = g_app_info_get_description (G_APP_INFO (info));
- hdy_action_row_set_subtitle (HDY_ACTION_ROW (self), desc);
- hdy_action_row_set_subtitle_lines (HDY_ACTION_ROW (self), 1);
+ adw_action_row_set_subtitle (ADW_ACTION_ROW (self), desc);
+ adw_action_row_set_subtitle_lines (ADW_ACTION_ROW (self), 1);
g_object_bind_property (self->item, "progress-visible",
self->progress_bar, "visible",
diff --git a/phosh/plugins/launcher-box/launcher-row.h b/phosh/plugins/launcher-box/launcher-row.h
index f57521156..ea3fddc13 100644
--- a/phosh/plugins/launcher-box/launcher-row.h
+++ b/phosh/plugins/launcher-box/launcher-row.h
@@ -9,7 +9,7 @@
#include "launcher-item.h"
#include
-#include
+#include
#include
@@ -17,7 +17,7 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_LAUNCHER_ROW (phosh_launcher_row_get_type ())
-G_DECLARE_FINAL_TYPE (PhoshLauncherRow, phosh_launcher_row, PHOSH, LAUNCHER_ROW, HdyActionRow)
+G_DECLARE_FINAL_TYPE (PhoshLauncherRow, phosh_launcher_row, PHOSH, LAUNCHER_ROW, AdwActionRow)
GtkWidget *phosh_launcher_row_new (PhoshLauncherItem *item);
PhoshLauncherItem *phosh_launcher_row_get_item (PhoshLauncherRow *self);
diff --git a/phosh/plugins/launcher-box/launcher-row.ui b/phosh/plugins/launcher-box/launcher-row.ui
index 5d9ccd593..614159bcf 100644
--- a/phosh/plugins/launcher-box/launcher-row.ui
+++ b/phosh/plugins/launcher-box/launcher-row.ui
@@ -1,9 +1,10 @@
-
-
+
+
+ 0
6
6
6
@@ -15,6 +16,7 @@
100
+ 0
center
-
- no-events
-
+
+
+
+ events
+
1
none
@@ -42,9 +47,8 @@
-
- events
-
+
+
diff --git a/phosh/plugins/upcoming-events/upcoming-event.c b/phosh/plugins/upcoming-events/upcoming-event.c
index 7388b7f2d..d304891a0 100644
--- a/phosh/plugins/upcoming-events/upcoming-event.c
+++ b/phosh/plugins/upcoming-events/upcoming-event.c
@@ -167,7 +167,6 @@ static void
phosh_upcoming_event_set_color (PhoshUpcomingEvent *self, const char *color)
{
g_autofree char* css = NULL;
- g_autoptr (GError) err = NULL;
g_autofree char *colorstr = NULL;
GdkRGBA rgba;
@@ -182,10 +181,7 @@ phosh_upcoming_event_set_color (PhoshUpcomingEvent *self, const char *color)
colorstr = gdk_rgba_to_string (&rgba);
css = g_strdup_printf (COLOR_BAR_CSS, colorstr);
- if (gtk_css_provider_load_from_data (self->color_css, css, -1, &err) == FALSE) {
- g_warning ("Failed to load css: %s", err->message);
- return;
- }
+ gtk_css_provider_load_from_string (self->color_css, css);
}
@@ -363,9 +359,9 @@ phosh_upcoming_event_init (PhoshUpcomingEvent *self)
gtk_widget_init_template (GTK_WIDGET (self));
self->color_css = gtk_css_provider_new ();
- gtk_style_context_add_provider (gtk_widget_get_style_context (GTK_WIDGET (self->color_bar)),
- GTK_STYLE_PROVIDER (self->color_css),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (self->color_css),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
self->is_24h = TRUE;
}
diff --git a/phosh/plugins/upcoming-events/upcoming-event.ui b/phosh/plugins/upcoming-events/upcoming-event.ui
index fbdd4aeca..89141fcbd 100644
--- a/phosh/plugins/upcoming-events/upcoming-event.ui
+++ b/phosh/plugins/upcoming-events/upcoming-event.ui
@@ -1,6 +1,6 @@
-
+
1
6
diff --git a/phosh/plugins/upcoming-events/upcoming-events.c b/phosh/plugins/upcoming-events/upcoming-events.c
index 959e838f1..4a27739d0 100644
--- a/phosh/plugins/upcoming-events/upcoming-events.c
+++ b/phosh/plugins/upcoming-events/upcoming-events.c
@@ -11,11 +11,10 @@
#include "event-list.h"
#include "calendar-event.h"
#include "upcoming-events.h"
-#include "gtkfilterlistmodel.h"
#include "phosh-plugin-upcoming-events-phosh-calendar-dbus.h"
-#include
+#include
#include
#include
@@ -40,6 +39,7 @@ struct _PhoshUpcomingEvents {
GtkStack *stack;
GtkListBox *events_box;
GListModel *event_lists;
+ GtkFilter *event_lists_filter;
GtkFilterListModel *event_lists_filtered;
GListStore *events;
GHashTable *event_ids;
@@ -164,7 +164,7 @@ refilter_event_lists (PhoshUpcomingEvents *self)
{
const char *child_name = "no-events";
- gtk_filter_list_model_refilter (self->event_lists_filtered);
+ gtk_filter_changed (self->event_lists_filter, GTK_FILTER_CHANGE_DIFFERENT);
if (!self->skip_empty || g_list_model_get_n_items (G_LIST_MODEL (self->event_lists_filtered)))
child_name = "events-window";
@@ -357,8 +357,7 @@ on_skip_empty_changed (PhoshUpcomingEvents *self)
self->skip_empty = g_settings_get_boolean (self->settings, UPCOMING_EVENT_SKIP_DAYS_KEY);
icon_name = self->skip_empty ? EXPAND_LIST_ICON : SHRINK_LIST_ICON;
- gtk_button_set_image (GTK_BUTTON (self->skip_empty_btn),
- gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON));
+ gtk_button_set_icon_name (GTK_BUTTON (self->skip_empty_btn), icon_name);
refilter_event_lists (self);
}
@@ -401,13 +400,13 @@ static void
on_num_days_changed (PhoshUpcomingEvents *self)
{
g_autofree char *desc = NULL;
- HdyStatusPage *no_events = HDY_STATUS_PAGE (gtk_stack_get_child_by_name (self->stack,
+ AdwStatusPage *no_events = ADW_STATUS_PAGE (gtk_stack_get_child_by_name (self->stack,
"no-events"));
self->num_days = g_settings_get_uint (self->settings, UPCOMING_EVENT_DAYS_KEY);
desc = g_strdup_printf (_("No events for the next %d days"), self->num_days);
- hdy_status_page_set_description (no_events, desc);
+ adw_status_page_set_description (no_events, desc);
g_debug ("Number of days changed to %u; reconfiguring event lists", self->num_days);
@@ -488,10 +487,10 @@ phosh_upcoming_events_init (PhoshUpcomingEvents *self)
G_CONNECT_SWAPPED);
self->event_lists = G_LIST_MODEL (g_list_store_new (PHOSH_TYPE_EVENT_LIST));
- self->event_lists_filtered = gtk_filter_list_model_new (self->event_lists,
- filter_event_lists_func,
- self,
- NULL);
+ self->event_lists_filter = GTK_FILTER (gtk_custom_filter_new (filter_event_lists_func,
+ self,
+ NULL));
+ self->event_lists_filtered = gtk_filter_list_model_new (self->event_lists, self->event_lists_filter);
self->events = g_list_store_new (PHOSH_TYPE_CALENDAR_EVENT);
self->event_ids = g_hash_table_new_full (g_str_hash,
@@ -514,10 +513,10 @@ phosh_upcoming_events_init (PhoshUpcomingEvents *self)
css_provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (css_provider,
"/mobi/phosh/plugins/upcoming-events/stylesheet/common.css");
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (css_provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
- gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (),
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (css_provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ gtk_icon_theme_add_resource_path (gtk_icon_theme_get_for_display (gdk_display_get_default ()),
"/mobi/phosh/plugins/upcoming-events/icons");
tz = g_file_new_for_path ("/etc/localtime");
diff --git a/phosh/plugins/upcoming-events/upcoming-events.ui b/phosh/plugins/upcoming-events/upcoming-events.ui
index 33c64ad37..01606551c 100644
--- a/phosh/plugins/upcoming-events/upcoming-events.ui
+++ b/phosh/plugins/upcoming-events/upcoming-events.ui
@@ -1,6 +1,6 @@
-
+
vertical
12
@@ -23,32 +23,36 @@
1
-
+
+ no-events
+
+
1
No upcoming events
x-office-calendar-symbolic
1
center
-
- no-events
-
+
+
+
+ events-window
+
1
never
1
-
+
1
none
-
+
+
+
-
- events-window
-
diff --git a/phosh/plugins/wifi-hotspot-quick-setting/qs.ui b/phosh/plugins/wifi-hotspot-quick-setting/qs.ui
index 039c27254..143318eff 100644
--- a/phosh/plugins/wifi-hotspot-quick-setting/qs.ui
+++ b/phosh/plugins/wifi-hotspot-quick-setting/qs.ui
@@ -1,7 +1,8 @@
-
+
+ 0
info
status_page
diff --git a/phosh/plugins/wifi-hotspot-quick-setting/status-page.ui b/phosh/plugins/wifi-hotspot-quick-setting/status-page.ui
index 5627360f5..524866097 100644
--- a/phosh/plugins/wifi-hotspot-quick-setting/status-page.ui
+++ b/phosh/plugins/wifi-hotspot-quick-setting/status-page.ui
@@ -1,6 +1,6 @@
-
+
1
Wi-Fi Hotspot
@@ -12,15 +12,20 @@
crossfade
0
+
+ empty_state
+
1
turn_on_btn
-
- empty_state
-
+
+
+
+ hotspot_enabled
+
1
vertical
@@ -60,9 +65,8 @@
-
- hotspot_enabled
-
+
+
@@ -77,7 +81,7 @@
1
0
panel.launch-panel
- ("wifi", [<"">])
+ "wifi"
1
diff --git a/phosh/plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c b/phosh/plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c
index 85b7b07df..bb5a6d100 100644
--- a/phosh/plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c
+++ b/phosh/plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c
@@ -127,11 +127,11 @@ phosh_wifi_hotspot_quick_setting_init (PhoshWifiHotspotQuickSetting *self)
css_provider = gtk_css_provider_new ();
gtk_css_provider_load_from_resource (css_provider,
"/mobi/phosh/plugins/wifi-hotspot-quick-setting/style.css");
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
GTK_STYLE_PROVIDER (css_provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
- gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (),
+ gtk_icon_theme_add_resource_path (gtk_icon_theme_get_for_display (gdk_display_get_default ()),
"/mobi/phosh/plugins/wifi-hotspot-quick-setting/icons");
self->wifi = phosh_shell_get_wifi_manager (shell);
diff --git a/phosh/plugins/wifi-hotspot-quick-setting/wifi-hotspot-status-page.c b/phosh/plugins/wifi-hotspot-quick-setting/wifi-hotspot-status-page.c
index 37db015d2..d10f37963 100644
--- a/phosh/plugins/wifi-hotspot-quick-setting/wifi-hotspot-status-page.c
+++ b/phosh/plugins/wifi-hotspot-quick-setting/wifi-hotspot-status-page.c
@@ -12,11 +12,9 @@
#include
+#define BYTES_PER_R8G8B8 3
#define QR_CODE_SIZE 128
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (cairo_t, cairo_destroy)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC (cairo_surface_t, cairo_surface_destroy)
-
/**
* PhoshWifiHotspotStatusPage:
*
@@ -42,18 +40,33 @@ struct _PhoshWifiHotspotStatusPage {
G_DEFINE_TYPE (PhoshWifiHotspotStatusPage, phosh_wifi_hotspot_status_page, PHOSH_TYPE_STATUS_PAGE);
-static cairo_surface_t *
+static void
+fill_pixel (GByteArray *array, guint8 value, int pixel_size)
+{
+ guint i;
+
+ for (i = 0; i < pixel_size; i++)
+ {
+ g_byte_array_append (array, &value, 1); /* R */
+ g_byte_array_append (array, &value, 1); /* G */
+ g_byte_array_append (array, &value, 1); /* B */
+ }
+}
+
+
+static GdkPaintable *
qr_from_text (const char *text, int size, int scale)
{
uint8_t qr_code[qrcodegen_BUFFER_LEN_FOR_VERSION (qrcodegen_VERSION_MAX)];
uint8_t temp_buf[qrcodegen_BUFFER_LEN_FOR_VERSION (qrcodegen_VERSION_MAX)];
- g_autoptr (cairo_t) cr = NULL;
- cairo_surface_t *surface;
- int pixel_size, qr_size, padding;
+ g_autoptr (GBytes) bytes = NULL;
+ GByteArray *qr_matrix;
+ int pixel_size, qr_size, total_size;
+ int column, row, i;
gboolean success = FALSE;
+ GdkTexture *texture;
g_return_val_if_fail (size > 0, NULL);
- g_return_val_if_fail (scale > 0, NULL);
success = qrcodegen_encodeText (text,
temp_buf,
@@ -67,42 +80,34 @@ qr_from_text (const char *text, int size, int scale)
if (!success)
return NULL;
- surface = cairo_image_surface_create (CAIRO_FORMAT_RGB24, size * scale, size * scale);
- cairo_surface_set_device_scale (surface, scale, scale);
- cr = cairo_create (surface);
- cairo_set_antialias (cr, CAIRO_ANTIALIAS_NONE);
-
- /* Draw white background */
- cairo_set_source_rgba (cr, 1, 1, 1, 1);
- cairo_rectangle (cr, 0, 0, size * scale, size * scale);
- cairo_fill (cr);
-
qr_size = qrcodegen_getSize (qr_code);
pixel_size = MAX (1, size / (qr_size));
- padding = (size - qr_size * pixel_size) / 2;
+ total_size = qr_size * pixel_size;
+ qr_matrix = g_byte_array_sized_new (total_size * total_size * pixel_size * BYTES_PER_R8G8B8);
+
+ for (column = 0; column < total_size; column++)
+ {
+ for (i = 0; i < pixel_size; i++)
+ {
+ for (row = 0; row < total_size / pixel_size; row++)
+ {
+ if (qrcodegen_getModule (qr_code, column, row))
+ fill_pixel (qr_matrix, 0x00, pixel_size);
+ else
+ fill_pixel (qr_matrix, 0xff, pixel_size);
+ }
+ }
+ }
- /* If subpixel size is big and margin is pretty small,
- * increase the margin */
- if (pixel_size > 4 && padding < 12) {
- pixel_size--;
- padding = (size - qr_size * pixel_size) / 2;
- }
+ bytes = g_byte_array_free_to_bytes (qr_matrix);
- /* Now draw the black QR code pixels */
- cairo_set_source_rgba (cr, 0, 0, 0, 1);
- for (int row = 0; row < qr_size; row++) {
- for (int column = 0; column < qr_size; column++) {
- if (qrcodegen_getModule (qr_code, row, column)) {
- cairo_rectangle (cr,
- column * pixel_size + padding,
- row * pixel_size + padding,
- pixel_size, pixel_size);
- cairo_fill (cr);
- }
- }
- }
+ texture = gdk_memory_texture_new (total_size,
+ total_size,
+ GDK_MEMORY_R8G8B8,
+ bytes,
+ total_size * BYTES_PER_R8G8B8);
- return surface;
+ return GDK_PAINTABLE (texture);
}
@@ -254,14 +259,14 @@ on_secrets_ready (GObject *object, GAsyncResult *result, gpointer data)
g_autoptr (GVariant) variant = NULL;
g_autofree char *cnx_str = NULL;
g_autofree char *password = NULL;
- g_autoptr (cairo_surface_t) surface = NULL;
+ g_autoptr (GdkPaintable) paintable = NULL;
int scale;
variant = nm_remote_connection_get_secrets_finish (NM_REMOTE_CONNECTION (conn), result, &error);
if (variant == NULL) {
g_warning ("Unable to fetch secrets: %s", error->message);
- gtk_image_set_from_icon_name (self->image, "face-sad-symbolic", -1);
- gtk_entry_set_text (self->entry, "");
+ gtk_image_set_from_icon_name (self->image, "face-sad-symbolic");
+ gtk_editable_set_text (GTK_EDITABLE (self->entry), "");
return;
}
if (!nm_connection_update_secrets (conn,
@@ -269,17 +274,17 @@ on_secrets_ready (GObject *object, GAsyncResult *result, gpointer data)
variant,
&error)) {
g_warning ("Unable to set secrets: %s", error->message);
- gtk_image_set_from_icon_name (self->image, "face-sad-symbolic", -1);
- gtk_entry_set_text (self->entry, "");
+ gtk_image_set_from_icon_name (self->image, "face-sad-symbolic");
+ gtk_editable_set_text (GTK_EDITABLE (self->entry), "");
return;
}
cnx_str = get_qr_string_for_connection (conn);
scale = gtk_widget_get_scale_factor (GTK_WIDGET (self->image));
- surface = qr_from_text (cnx_str, QR_CODE_SIZE, scale);
+ paintable = qr_from_text (cnx_str, QR_CODE_SIZE, scale);
password = get_wifi_password (conn);
- gtk_image_set_from_surface (self->image, surface);
- gtk_entry_set_text (self->entry, password);
+ gtk_image_set_from_paintable (self->image, paintable);
+ gtk_editable_set_text (GTK_EDITABLE (self->entry), password);
nm_connection_clear_secrets (conn);
}
diff --git a/phosh/po/LINGUAS b/phosh/po/LINGUAS
index e156bcf31..349f422ae 100644
--- a/phosh/po/LINGUAS
+++ b/phosh/po/LINGUAS
@@ -27,7 +27,6 @@ it
ja
ka
ko
-kw
la
lv
nb
diff --git a/phosh/po/POTFILES.in b/phosh/po/POTFILES.in
index e1b02d6cd..babe7d3b0 100644
--- a/phosh/po/POTFILES.in
+++ b/phosh/po/POTFILES.in
@@ -21,7 +21,6 @@ src/app-grid-button.c
src/app-grid.c
src/app-list-model.c
src/arrow.c
-src/audio-manager.c
src/auth.c
src/background.c
src/background-manager.c
diff --git a/phosh/po/POTFILES.skip b/phosh/po/POTFILES.skip
index bd7f35ce0..66249f13c 100644
--- a/phosh/po/POTFILES.skip
+++ b/phosh/po/POTFILES.skip
@@ -1,6 +1,6 @@
src/gtk-list-models/gtkfilterlistmodel.c
src/gtk-list-models/gtksortlistmodel.c
-src/settings/channel-bar.c
+src/settings/gvc-channel-bar.c
subprojects/
plugins/simple-custom-quick-setting/qs.ui
plugins/simple-custom-quick-setting/simple-custom-quick-setting.c
diff --git a/phosh/po/bg.po b/phosh/po/bg.po
index e049eb943..4946f4548 100644
--- a/phosh/po/bg.po
+++ b/phosh/po/bg.po
@@ -3,14 +3,14 @@
# Copyright (C) 2024, 2025 twlvnn kraftwerk .
# This file is distributed under the same license as the phosh-tour package.
# Miro Cekov , 2019. #zanata
-# twlvnn kraftwerk , 2024, 2025, 2026.
+# twlvnn kraftwerk , 2024, 2025.
#
msgid ""
msgstr ""
"Project-Id-Version: phosh\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-04 11:02+0000\n"
-"PO-Revision-Date: 2026-02-04 20:29+0100\n"
+"POT-Creation-Date: 2025-09-24 05:24+0000\n"
+"PO-Revision-Date: 2025-09-24 13:21+0200\n"
"Last-Translator: twlvnn kraftwerk \n"
"Language-Team: Bulgarian \n"
"Language: bg\n"
@@ -18,7 +18,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 3.8\n"
+"X-Generator: Poedit 3.6\n"
#: data/mobi.phosh.Shell.desktop.in.in:3 data/wayland-sessions/phosh.desktop:3
msgid "Phone Shell"
@@ -80,14 +80,6 @@ msgid "Add launchers to the lock screen. This plugin is experimental."
msgstr ""
"Добавя стартери на заключения екран. Тази приставка е експериментална."
-#: plugins/location-quick-setting/location-quick-setting.desktop.in.in:4
-msgid "Location Quick Setting"
-msgstr "Бърза настройка за местоположение"
-
-#: plugins/location-quick-setting/location-quick-setting.desktop.in.in:6
-msgid "Toggle location services on/off"
-msgstr "Превключване на услугите за местоположение"
-
#: plugins/media-players/media-players.desktop.in.in:3
#: plugins/media-players/media-players.ui:19
#: plugins/media-players/media-players.ui:35
@@ -154,18 +146,14 @@ msgstr "Създаване на нова папка"
msgid "Application"
msgstr "Програма"
-#: src/app-grid.c:264
+#: src/app-grid.c:261
msgid "Show All Apps"
msgstr "Показване на всички програми"
-#: src/app-grid.c:267
+#: src/app-grid.c:264
msgid "Show Only Mobile Friendly Apps"
msgstr "Показване само на програмите за мобилни устройства"
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr "Управление на силата на звука"
-
#. Translators: a battery level in percent
#: src/bt-device-row.c:81
#, c-format
@@ -282,29 +270,29 @@ msgctxt "feedback:enabled"
msgid "On"
msgstr "Вкл."
-#: src/location-manager.c:266
+#: src/location-manager.c:268
#, c-format
msgid "Allow '%s' to access your location information?"
msgstr "Позволявате ли на „%s“ достъп до информацията за местоположението ви?"
-#: src/location-manager.c:271
+#: src/location-manager.c:273
msgid "Geolocation"
msgstr "Местоположение"
-#: src/location-manager.c:272
+#: src/location-manager.c:274
msgid "Yes"
msgstr "Да"
-#: src/location-manager.c:272
+#: src/location-manager.c:274
msgid "No"
msgstr "Не"
#. give visual feedback on error
-#: src/lockscreen.c:396 src/ui/lockscreen.ui:282
+#: src/lockscreen.c:313 src/ui/lockscreen.ui:282
msgid "Enter Passcode"
msgstr "Въведете код за достъп"
-#: src/lockscreen.c:1036
+#: src/lockscreen.c:956
msgid "Checking…"
msgstr "Проверка…"
@@ -336,27 +324,27 @@ msgid "Screenshot from %s%s.png"
msgstr "Снимка на екрана на %s%s.png"
#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
+#: src/media-player.c:646 src/ui/media-player.ui:208
msgid "Unknown Title"
msgstr "Неизвестно заглавие"
#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
+#: src/media-player.c:654 src/ui/media-player.ui:196
msgid "Unknown Artist"
msgstr "Неизвестен изпълнител"
-#: src/monitor-manager.c:129
+#: src/monitor-manager.c:127
msgid "Built-in display"
msgstr "Вграден дисплей"
-#: src/monitor-manager.c:147
+#: src/monitor-manager.c:145
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
-#: src/monitor-manager.c:154
+#: src/monitor-manager.c:152
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -365,7 +353,7 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
+#: src/monitor-manager.c:161
msgid "Unknown"
msgstr "Неизвестен"
@@ -386,7 +374,7 @@ msgstr "Отваряне"
#. We don't just set the app_info but name and icon separately to
#. * not overwrite values set by the caller
#: src/notifications/notification.c:422 src/notifications/notification.c:695
-#: src/notifications/notify-manager.c:1009
+#: src/notifications/notify-manager.c:1012
msgid "Notification"
msgstr "Известие"
@@ -494,17 +482,17 @@ msgid_plural "Almost %dy"
msgstr[0] "Преди %dг"
msgstr[1] "Преди %dг"
-#: src/polkit-auth-agent.c:275
+#: src/polkit-auth-agent.c:271
msgid "Authentication dialog was dismissed by the user"
msgstr "Прозорецът за удостоверяване бе затворен от потребителя"
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
+#: src/polkit-auth-prompt.c:275 src/ui/gtk-mount-prompt.ui:17
+#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:45
#: src/ui/system-prompt.ui:28
msgid "Password:"
msgstr "Парола:"
-#: src/polkit-auth-prompt.c:429
+#: src/polkit-auth-prompt.c:322
msgid "Sorry, that didn’t work. Please try again."
msgstr "За съжаление това не сработи. Пробвайте наново."
@@ -535,6 +523,10 @@ msgstr "Натиснете Esc за отмяна"
msgid "Running '%s' failed"
msgstr "Неуспешно изпълнение на „%s“"
+#: src/settings/audio-settings.c:376
+msgid "Phone Shell Volume Control"
+msgstr "Управление на силата на звука"
+
#: src/system-prompt.c:376
msgid "Passwords do not match."
msgstr "Паролите не съвпадат."
@@ -543,7 +535,7 @@ msgstr "Паролите не съвпадат."
msgid "Password cannot be blank"
msgstr "Паролата не може да бъде празна"
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "Фенерче"
@@ -592,14 +584,6 @@ msgstr "Входни устройства"
msgid "Sound Settings"
msgstr "Настройки на звука"
-#: src/ui/brightness-settings.ui:87
-msgid "Automatic Brightness"
-msgstr "Автоматична яркост"
-
-#: src/ui/brightness-settings.ui:120
-msgid "Brightness Settings"
-msgstr "Настройки за яркост"
-
#: src/ui/bt-status-page.ui:39
msgid "Enable Bluetooth"
msgstr "Включване на Bluetooth"
@@ -649,7 +633,7 @@ msgstr "Обратна връзка"
msgid "Do not disturb"
msgstr "Не безпокойте!"
-#: src/ui/feedback-status-page.ui:53
+#: src/ui/feedback-status-page.ui:52
msgid "Feedback Settings"
msgstr "Настройки за обратна връзка"
@@ -682,7 +666,6 @@ msgid "Authentication required"
msgstr "Необходимо е удостоверяване"
#: src/ui/network-auth-prompt.ui:37
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:75
#: plugins/emergency-info/prefs/emergency-info-prefs.ui:212
msgid "_Cancel"
msgstr "_Отказване"
@@ -691,7 +674,7 @@ msgstr "_Отказване"
msgid "C_onnect"
msgstr "_Свързване"
-#: src/ui/polkit-auth-prompt.ui:96
+#: src/ui/polkit-auth-prompt.ui:97
msgid "Authenticate"
msgstr "Удостоверяване"
@@ -711,15 +694,15 @@ msgstr "Спешни случаи"
msgid "Run Command"
msgstr "Команда за изпълнение"
-#: src/ui/settings.ui:121
+#: src/ui/settings.ui:138
msgid "No notifications"
msgstr "Няма известия"
-#: src/ui/settings.ui:150
+#: src/ui/settings.ui:167
msgid "Notifications"
msgstr "Известия"
-#: src/ui/settings.ui:159
+#: src/ui/settings.ui:176
msgid "Clear all"
msgstr "Изчистване на всичко"
@@ -748,7 +731,6 @@ msgid "Wi-Fi"
msgstr "Wi-Fi"
#: src/ui/wifi-status-page.ui:89
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:85
msgid "Wi-Fi Settings"
msgstr "Настройки на Wi-Fi"
@@ -801,100 +783,29 @@ msgid "Cellular"
msgstr "Клетъчна мрежа"
#. Translators: Phosh prevents the session from going idle because the caffeine quick setting is toggled
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:70
+#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:53
msgid "Phosh on caffeine"
msgstr "Phosh на кофеин"
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:245
-msgctxt "caffeine-disabled"
-msgid "Off"
-msgstr "Изкл."
-
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:250
+#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:132
msgctxt "caffeine-enabled"
msgid "On"
msgstr "Вкл."
-#: plugins/caffeine-quick-setting/qs.ui:15
-msgid "Caffeine timers"
-msgstr "Таймери на Caffeine"
-
-#: plugins/caffeine-quick-setting/qs.ui:38
-msgid "No caffeine intervals"
-msgstr "Няма интервали на Caffeine"
-
-#: plugins/caffeine-quick-setting/qs.ui:55
-msgid "Caffeine Settings"
-msgstr "Настройка за Caffeine"
-
-#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
-msgid "No timeout (∞)"
-msgstr "Без време за изчакване (∞)"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:7
-msgid "Caffeine Quick Setting Preferences"
-msgstr "Бързи настройки за Caffeine"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:11
-msgid "Caffeine Duration"
-msgstr "Продължителност на Caffeine"
-
-# Няма много място за този текст, затова го съкратих.
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:15
-msgid "Manage Caffeine Duration"
-msgstr "Продължителност"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:16
-msgid "Add or remove custom caffeine intervals"
-msgstr "Добавяне или премахване на собствени интервали на Caffeine"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:22
-msgid "Add interval"
-msgstr "Добавяне на интервал"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:66
-msgid "Add New Interval"
-msgstr "Добавяне на нов интервал"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:83
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:220
-msgid "_Add"
-msgstr "_Добавяне"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:115
-msgid "Quickstart Intervals"
-msgstr "Готови интервали"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:127
-msgid "5 m"
-msgstr "5 м"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:138
-msgid "15 m"
-msgstr "15 м"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:149
-msgid "30 m"
-msgstr "30 м"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:160
-msgid "1 h"
-msgstr "1 ч"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:188
-msgid "Choose Interval"
-msgstr "Избор на интервал"
+#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:132
+msgctxt "caffeine-disabled"
+msgid "Off"
+msgstr "Изкл."
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:34
+#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:36
msgid "Default style"
msgstr "Стил на системата"
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:35
+#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:37
msgid "Dark mode"
msgstr "Тъмен режим"
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:36
+#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:38
msgid "Light mode"
msgstr "Светъл режим"
@@ -1000,6 +911,10 @@ msgstr "Добавяне на контакт"
msgid "Add New Contact"
msgstr "Добавяне на нов контакт"
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:220
+msgid "_Add"
+msgstr "_Добавяне"
+
#: plugins/emergency-info/prefs/emergency-info-prefs.ui:240
msgid "_Contact Name"
msgstr "_Име за контакта"
@@ -1020,60 +935,52 @@ msgstr "Няма настроени стартери"
msgid "Launchers"
msgstr "Стартери"
-#: plugins/location-quick-setting/location-quick-setting.c:65
-msgid "Location On"
-msgstr "Местоположението е вкл."
-
-#: plugins/location-quick-setting/location-quick-setting.c:65
-msgid "Location Off"
-msgstr "Местоположението е изкл."
-
#: plugins/media-players/media-players.ui:20
msgid "No running media players"
msgstr "Няма работещи музикални устройства"
-#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.c:79
+#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.c:82
msgid "Mobile Data On"
msgstr "Мобилните данни са вкл."
-#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.c:79
+#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.c:82
msgid "Mobile Data Off"
msgstr "Мобилните данни са изкл."
-#: plugins/night-light-quick-setting/night-light-quick-setting.c:63
+#: plugins/night-light-quick-setting/night-light-quick-setting.c:65
msgid "Night Light On"
msgstr "Нощен режим е вкл."
-#: plugins/night-light-quick-setting/night-light-quick-setting.c:63
+#: plugins/night-light-quick-setting/night-light-quick-setting.c:65
msgid "Night Light Off"
msgstr "Нощен режим е изкл."
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:72
+#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:75
msgid "Pomodoro start"
msgstr "Начало на Помодоро"
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:73
+#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:76
#, c-format
msgid "Focus on your task for %d minutes"
msgstr "Фокусирайте се върху задачата си за %d минути"
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:78
+#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:81
msgid "Take a break"
msgstr "Вземете си почивка"
#. Translators: Pomodoro is a technique, no need to translate it
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:80
+#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:83
#, c-format
msgid "You have %d minutes until next Pomodoro"
msgstr "Имате %d минути до следващото Помодоро"
#. Translators: Pomodoro is a technique, no need to translate it
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:95
+#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:98
msgid "Pomodoro Timer"
msgstr "Хронометър за Помодоро"
#. Translators: Pomodoro is a technique, no need to translate it
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:118
+#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:121
#, c-format
msgid "Pomodoro Off"
msgstr "Изключване на Помодоро"
@@ -1189,15 +1096,6 @@ msgstr "Приключва на"
msgid "Untitled event"
msgstr "Неозаглавено събитие"
-#: plugins/upcoming-events/upcoming-events.c:408
-#, c-format
-msgid "No events for the next %d days"
-msgstr "Няма събития за следващите %d дни"
-
-#: plugins/upcoming-events/upcoming-events.ui:28
-msgid "No upcoming events"
-msgstr "Няма предстоящи събития"
-
#: plugins/upcoming-events/prefs/upcoming-events-prefs.ui:6
msgid "Upcoming Events Preferences"
msgstr "Настройки за предстоящи събития"
@@ -1221,24 +1119,16 @@ msgstr "Мащаби на екраните"
#. Translators: This is scale factor of a monitor in percent
#: plugins/scaling-quick-setting/scale-row.c:48
-#: plugins/scaling-quick-setting/scaling-quick-setting.c:91
+#: plugins/scaling-quick-setting/scaling-quick-setting.c:93
#, c-format
msgid "%d%%"
msgstr "%d%%"
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:6
-msgid "Wi-Fi Hotspot"
-msgstr "Точки за достъп по Wi-Fi"
-
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:71
-msgid "Turn On"
-msgstr "Включване"
-
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:80
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:79
msgid "Hotspot On"
msgstr "Тчк. за достъп е вкл."
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:82
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:81
msgid "Hotspot Off"
msgstr "Тчк. за достъп е изкл."
diff --git a/phosh/po/de.po b/phosh/po/de.po
index aee335166..8c3dbe6c8 100644
--- a/phosh/po/de.po
+++ b/phosh/po/de.po
@@ -16,15 +16,15 @@
# Tim Sabsch , 2020, 2024.
# Michael Oppliger , 2021.
# Philipp Kiemle , 2021, 2023-2025.
-# Jürgen Benvenuti , 2022-2026.
+# Jürgen Benvenuti , 2022-2025.
#
#
msgid ""
msgstr ""
"Project-Id-Version: phosh\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2025-12-31 16:32+0000\n"
-"PO-Revision-Date: 2026-01-08 21:56+0100\n"
+"POT-Creation-Date: 2025-11-21 07:43+0000\n"
+"PO-Revision-Date: 2025-11-23 11:03+0100\n"
"Last-Translator: Jürgen Benvenuti \n"
"Language-Team: German \n"
"Language: de\n"
@@ -168,11 +168,11 @@ msgstr "Neuen Ordner erstellen"
msgid "Application"
msgstr "Anwendung"
-#: src/app-grid.c:264
+#: src/app-grid.c:261
msgid "Show All Apps"
msgstr "Alle Anwendungen anzeigen"
-#: src/app-grid.c:267
+#: src/app-grid.c:264
msgid "Show Only Mobile Friendly Apps"
msgstr "Nur mobiloptimierte Anwendungen anzeigen"
@@ -308,11 +308,11 @@ msgid "No"
msgstr "Nein"
#. give visual feedback on error
-#: src/lockscreen.c:397 src/ui/lockscreen.ui:282
+#: src/lockscreen.c:313 src/ui/lockscreen.ui:282
msgid "Enter Passcode"
msgstr "Zugangscode eingeben"
-#: src/lockscreen.c:1041
+#: src/lockscreen.c:956
msgid "Checking…"
msgstr "Überprüfung läuft …"
@@ -557,7 +557,7 @@ msgstr "Die Passwörter stimmen nicht überein."
msgid "Password cannot be blank"
msgstr "Das Passwort darf nicht leer sein"
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "Taschenlampe"
@@ -762,7 +762,6 @@ msgid "Wi-Fi"
msgstr "WLAN"
#: src/ui/wifi-status-page.ui:89
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:85
msgid "Wi-Fi Settings"
msgstr "WLAN-Einstellungen"
@@ -840,7 +839,7 @@ msgstr "Keine Koffein-Intervalle"
#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
msgid "No timeout (∞)"
-msgstr "Keine Zeitüberschreitung (∞)"
+msgstr ""
#: plugins/caffeine-quick-setting/prefs/prefs.ui:7
msgid "Caffeine Quick Setting Preferences"
@@ -1198,7 +1197,7 @@ msgstr "Endet"
msgid "Untitled event"
msgstr "Unbenannter Termin"
-#: plugins/upcoming-events/upcoming-events.c:408
+#: plugins/upcoming-events/upcoming-events.c:372
#, c-format
msgid "No events for the next %d days"
msgstr "Kein Termin für die nächsten %d Tage"
@@ -1226,7 +1225,7 @@ msgstr "Anzahl der Tage, für die Termine angezeigt werden sollen"
#: plugins/scaling-quick-setting/qs.ui:14
msgid "Monitor scales"
-msgstr "Bildschirmskalierung"
+msgstr ""
#. Translators: This is scale factor of a monitor in percent
#: plugins/scaling-quick-setting/scale-row.c:48
@@ -1235,19 +1234,11 @@ msgstr "Bildschirmskalierung"
msgid "%d%%"
msgstr "%d %%"
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:6
-msgid "Wi-Fi Hotspot"
-msgstr "WLAN-Hotspot"
-
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:71
-msgid "Turn On"
-msgstr "Einschalten"
-
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:80
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:75
msgid "Hotspot On"
msgstr "Hotspot an"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:82
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:77
msgid "Hotspot Off"
msgstr "Hotspot aus"
diff --git a/phosh/po/fa.po b/phosh/po/fa.po
index 760d8fbc3..d6cf96704 100644
--- a/phosh/po/fa.po
+++ b/phosh/po/fa.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: phosh master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-04 11:02+0000\n"
-"PO-Revision-Date: 2026-02-04 16:18+0330\n"
+"POT-Creation-Date: 2025-12-08 06:52+0000\n"
+"PO-Revision-Date: 2025-12-08 21:55+0330\n"
"Last-Translator: Danial Behzadi \n"
"Language-Team: Persian\n"
"Language: fa\n"
@@ -153,18 +153,14 @@ msgstr "ایجاد شاخهٔ جدید"
msgid "Application"
msgstr "برنامه"
-#: src/app-grid.c:264
+#: src/app-grid.c:261
msgid "Show All Apps"
msgstr "نمایش تمامی کارهها"
-#: src/app-grid.c:267
+#: src/app-grid.c:264
msgid "Show Only Mobile Friendly Apps"
msgstr "فقط نمایش کارههای سازگار با تلفن همراه"
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr "واپایش حجم صدای پوستهٔ تلفن"
-
#. Translators: a battery level in percent
#: src/bt-device-row.c:81
#, c-format
@@ -297,11 +293,11 @@ msgid "No"
msgstr "نه"
#. give visual feedback on error
-#: src/lockscreen.c:396 src/ui/lockscreen.ui:282
+#: src/lockscreen.c:313 src/ui/lockscreen.ui:282
msgid "Enter Passcode"
msgstr "ورود رمز عبور"
-#: src/lockscreen.c:1036
+#: src/lockscreen.c:956
msgid "Checking…"
msgstr "در حال بررسی…"
@@ -333,27 +329,27 @@ msgid "Screenshot from %s%s.png"
msgstr "نماگرفت از %s%s.png"
#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
+#: src/media-player.c:690 src/ui/media-player.ui:208
msgid "Unknown Title"
msgstr "عنوان ناشناخته"
#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
+#: src/media-player.c:698 src/ui/media-player.ui:196
msgid "Unknown Artist"
msgstr "هنرمند ناشناخته"
-#: src/monitor-manager.c:129
+#: src/monitor-manager.c:128
msgid "Built-in display"
msgstr "نمایشگر توکار"
-#: src/monitor-manager.c:147
+#: src/monitor-manager.c:146
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
-#: src/monitor-manager.c:154
+#: src/monitor-manager.c:153
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -362,7 +358,7 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
+#: src/monitor-manager.c:162
msgid "Unknown"
msgstr "ناشناخته"
@@ -491,17 +487,17 @@ msgid_plural "Almost %dy"
msgstr[0] "تقریباً %Idسا"
msgstr[1] "تقریباً %Idسا"
-#: src/polkit-auth-agent.c:275
+#: src/polkit-auth-agent.c:271
msgid "Authentication dialog was dismissed by the user"
msgstr "گفتوگوی تأیید هویت از سمت کاربر رد شد"
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
+#: src/polkit-auth-prompt.c:275 src/ui/gtk-mount-prompt.ui:17
+#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:45
#: src/ui/system-prompt.ui:28
msgid "Password:"
msgstr "گذرواژه:"
-#: src/polkit-auth-prompt.c:429
+#: src/polkit-auth-prompt.c:322
msgid "Sorry, that didn’t work. Please try again."
msgstr "متاسفانه اثری نداشت! لطفاً دوباره تلاش کنید."
@@ -532,6 +528,10 @@ msgstr "برای بستن، گریز را بزنید"
msgid "Running '%s' failed"
msgstr "اجرای «%s» شکست خورد"
+#: src/settings/audio-settings.c:376
+msgid "Phone Shell Volume Control"
+msgstr "واپایش حجم صدای پوستهٔ تلفن"
+
#: src/system-prompt.c:376
msgid "Passwords do not match."
msgstr "گذرواژههای مطابق نیستند."
@@ -540,7 +540,7 @@ msgstr "گذرواژههای مطابق نیستند."
msgid "Password cannot be blank"
msgstr "گذرواژه نمیتواند خالی باشد"
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "چراغ"
@@ -646,7 +646,7 @@ msgstr "بازخورد"
msgid "Do not disturb"
msgstr "مزاحم نشوید"
-#: src/ui/feedback-status-page.ui:53
+#: src/ui/feedback-status-page.ui:52
msgid "Feedback Settings"
msgstr "تنظیمات بازخورد"
@@ -688,7 +688,7 @@ msgstr "_لغو"
msgid "C_onnect"
msgstr "_وصل شدن"
-#: src/ui/polkit-auth-prompt.ui:96
+#: src/ui/polkit-auth-prompt.ui:97
msgid "Authenticate"
msgstr "تأیید هویت"
@@ -745,7 +745,7 @@ msgid "Wi-Fi"
msgstr "وایفای"
#: src/ui/wifi-status-page.ui:89
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:85
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:73
msgid "Wi-Fi Settings"
msgstr "تنظیمات وایفای"
@@ -816,14 +816,10 @@ msgstr "روشن"
msgid "Caffeine timers"
msgstr "شمارش معکوس کافئین"
-#: plugins/caffeine-quick-setting/qs.ui:38
+#: plugins/caffeine-quick-setting/qs.ui:37
msgid "No caffeine intervals"
msgstr "بدون دورهٔ کافئین"
-#: plugins/caffeine-quick-setting/qs.ui:55
-msgid "Caffeine Settings"
-msgstr "تنظیمات کافئین"
-
#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
msgid "No timeout (∞)"
@@ -1226,14 +1222,14 @@ msgstr "%Id٪"
msgid "Wi-Fi Hotspot"
msgstr "نقطهٔ داغ وایفای"
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:71
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:59
msgid "Turn On"
msgstr "روشن کردن"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:80
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:76
msgid "Hotspot On"
msgstr "نقطهٔ داغ روشن"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:82
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:78
msgid "Hotspot Off"
msgstr "نقطهٔ داغ خاموش"
diff --git a/phosh/po/ka.po b/phosh/po/ka.po
index 39a9ddfe3..934d3460c 100644
--- a/phosh/po/ka.po
+++ b/phosh/po/ka.po
@@ -7,15 +7,15 @@ msgid ""
msgstr ""
"Project-Id-Version: phosh\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-04 11:02+0000\n"
-"PO-Revision-Date: 2026-02-05 08:39+0100\n"
+"POT-Creation-Date: 2025-12-02 16:11+0000\n"
+"PO-Revision-Date: 2025-12-03 00:28+0100\n"
"Last-Translator: Ekaterine Papava \n"
"Language-Team: Georgian <(nothing)>\n"
"Language: ka\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 3.8\n"
#: data/mobi.phosh.Shell.desktop.in.in:3 data/wayland-sessions/phosh.desktop:3
@@ -37,7 +37,7 @@ msgstr "ეს სესია Phosh-ში შეგიყვანთ"
#: plugins/caffeine-quick-setting/caffeine-quick-setting.desktop.in.in:4
msgid "Caffeine Quick Setting"
-msgstr "Caffeine-ის სწრაფი მორგება"
+msgstr "კოფეინის სწრაფი მორგება"
#: plugins/caffeine-quick-setting/caffeine-quick-setting.desktop.in.in:6
msgid "Prevent the session from going idle"
@@ -151,18 +151,14 @@ msgstr "ახალი საქაღალდის შექმნა"
msgid "Application"
msgstr "აპლიკაცია"
-#: src/app-grid.c:264
+#: src/app-grid.c:261
msgid "Show All Apps"
msgstr "ყველა აპლიკაციის ჩვენება"
-#: src/app-grid.c:267
+#: src/app-grid.c:264
msgid "Show Only Mobile Friendly Apps"
msgstr "მხოლოდ მობილურზე მორგებული აპლიკაციების ჩვენება"
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr "ტელეფონის გარსის ხმის კონტროლი"
-
#. Translators: a battery level in percent
#: src/bt-device-row.c:81
#, c-format
@@ -233,7 +229,6 @@ msgstr "გამოსვლა"
msgid "%s will be logged out automatically in %d second."
msgid_plural "%s will be logged out automatically in %d seconds."
msgstr[0] "%s გამოვა ავტომატურად, %d წამში."
-msgstr[1] "%s გამოვა ავტომატურად, %d წამში."
#: src/end-session-dialog.c:182 src/ui/power-menu.ui:72
msgid "Power Off"
@@ -244,7 +239,6 @@ msgstr "გამორთვა"
msgid "The system will power off automatically in %d second."
msgid_plural "The system will power off automatically in %d seconds."
msgstr[0] "სისტემა გამოირთვება ავტომატურად %d წამში."
-msgstr[1] "სისტემა გამოირთვება ავტომატურად %d წამში."
#: src/end-session-dialog.c:189
msgid "Restart"
@@ -255,7 +249,6 @@ msgstr "გადატვრთვა"
msgid "The system will restart automatically in %d second."
msgid_plural "The system will restart automatically in %d seconds."
msgstr[0] "სისტემა გადაიტვირთება ავტომატურად %d წამში."
-msgstr[1] "სისტემა გადაიტვირთება ავტომატურად %d წამში."
#. Translators: quiet and silent are fbd profiles names:
#. see https://source.puri.sm/Librem5/feedbackd#profiles
@@ -295,11 +288,11 @@ msgid "No"
msgstr "არა"
#. give visual feedback on error
-#: src/lockscreen.c:396 src/ui/lockscreen.ui:282
+#: src/lockscreen.c:313 src/ui/lockscreen.ui:282
msgid "Enter Passcode"
msgstr "შეიყვანეთ კოდი"
-#: src/lockscreen.c:1036
+#: src/lockscreen.c:956
msgid "Checking…"
msgstr "შემოწმება…"
@@ -331,27 +324,27 @@ msgid "Screenshot from %s%s.png"
msgstr "ეკრანის ანაბეჭდი %s%s.png-დან"
#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
+#: src/media-player.c:690 src/ui/media-player.ui:208
msgid "Unknown Title"
msgstr "უცნობი სათაური"
#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
+#: src/media-player.c:698 src/ui/media-player.ui:196
msgid "Unknown Artist"
msgstr "უცნობი შემსრულებელი"
-#: src/monitor-manager.c:129
+#: src/monitor-manager.c:128
msgid "Built-in display"
msgstr "ჩაშენებული ეკრანი"
-#: src/monitor-manager.c:147
+#: src/monitor-manager.c:146
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
-#: src/monitor-manager.c:154
+#: src/monitor-manager.c:153
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -360,7 +353,7 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
+#: src/monitor-manager.c:162
msgid "Unknown"
msgstr "უცნობი"
@@ -419,7 +412,6 @@ msgstr "~1წთ"
msgid "%dm"
msgid_plural "%dm"
msgstr[0] "%dწთ"
-msgstr[1] "%dწთ"
#. Translators: abbreviated time difference "About 3 hours ago"
#. Please stick to a maximum of 4 chars for the time unit
@@ -428,7 +420,6 @@ msgstr[1] "%dწთ"
msgid "~%dh"
msgid_plural "~%dh"
msgstr[0] "~%dსთ"
-msgstr[1] "~%dსთ"
#. Translators: abbreviated time difference "About 1 day ago"
#. Please stick to a maximum of 4 chars for the time unit
@@ -444,7 +435,6 @@ msgstr "~1დ"
msgid "%dd"
msgid_plural "%dd"
msgstr[0] "%dდღე"
-msgstr[1] "%dდღე"
#. Translators: abbreviated time difference "About 1 month ago"
#. Please stick to a maximum of 4 chars for the time unit
@@ -460,7 +450,6 @@ msgstr "~1თვე"
msgid "%dmo"
msgid_plural "%dmos"
msgstr[0] "%dთვე"
-msgstr[1] "%dთვე"
#. Translators: abbreviated time difference "About 5 years ago"
#. Please stick to a maximum of 4 chars for the time unit
@@ -469,7 +458,6 @@ msgstr[1] "%dთვე"
msgid "~%dy"
msgid_plural "~%dy"
msgstr[0] "~%dწ"
-msgstr[1] "~%dწ"
#. Translators: abbreviated time difference "Over 5 years ago"
#. Please stick to a maximum of 4 chars for the time unit
@@ -478,7 +466,6 @@ msgstr[1] "~%dწ"
msgid "Over %dy"
msgid_plural "Over %dy"
msgstr[0] "%d წელზე მეტი"
-msgstr[1] "%d წელზე მეტი"
#. Translators: abbreviated time difference "almost 5 years ago"
#. Please stick to a maximum of 4 chars for the time unit
@@ -487,19 +474,18 @@ msgstr[1] "%d წელზე მეტი"
msgid "Almost %dy"
msgid_plural "Almost %dy"
msgstr[0] "თითქმის %dწ"
-msgstr[1] "თითქმის %dწ"
-#: src/polkit-auth-agent.c:275
+#: src/polkit-auth-agent.c:271
msgid "Authentication dialog was dismissed by the user"
msgstr "ავთენტიკაციის ფანჯარა დახურულია მომხმარებლის მიერ"
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
+#: src/polkit-auth-prompt.c:275 src/ui/gtk-mount-prompt.ui:17
+#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:45
#: src/ui/system-prompt.ui:28
msgid "Password:"
msgstr "პაროლი:"
-#: src/polkit-auth-prompt.c:429
+#: src/polkit-auth-prompt.c:322
msgid "Sorry, that didn’t work. Please try again."
msgstr "უკაცრავად, არ იმუშავა. კიდევ სცადეთ."
@@ -530,6 +516,10 @@ msgstr "დასახურად დააწექით ESC-ს"
msgid "Running '%s' failed"
msgstr "%s-ის გაშვების შეცდომა"
+#: src/settings/audio-settings.c:376
+msgid "Phone Shell Volume Control"
+msgstr "ტელეფონის გარსის ხმის კონტროლი"
+
#: src/system-prompt.c:376
msgid "Passwords do not match."
msgstr "პაროლები არ ემთხვევა."
@@ -538,7 +528,7 @@ msgstr "პაროლები არ ემთხვევა."
msgid "Password cannot be blank"
msgstr "პაროლები ცარიელი ვერ იქნება"
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "შეხება"
@@ -644,7 +634,7 @@ msgstr "უკუკავშირი"
msgid "Do not disturb"
msgstr "არ შემაწუხო"
-#: src/ui/feedback-status-page.ui:53
+#: src/ui/feedback-status-page.ui:52
msgid "Feedback Settings"
msgstr "უკუკავშირის მორგება"
@@ -686,7 +676,7 @@ msgstr "_გაუქმება"
msgid "C_onnect"
msgstr "_კავშირი"
-#: src/ui/polkit-auth-prompt.ui:96
+#: src/ui/polkit-auth-prompt.ui:97
msgid "Authenticate"
msgstr "ავთენტიკაცია"
@@ -743,7 +733,7 @@ msgid "Wi-Fi"
msgstr "Wi-Fi"
#: src/ui/wifi-status-page.ui:89
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:85
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:73
msgid "Wi-Fi Settings"
msgstr "Wi-Fi-ის მორგება"
@@ -812,17 +802,12 @@ msgstr "ჩართ"
#: plugins/caffeine-quick-setting/qs.ui:15
msgid "Caffeine timers"
-msgstr "Caffeine-ის ტაიმერები"
+msgstr "კოფეინის ტაიმერები"
-#: plugins/caffeine-quick-setting/qs.ui:38
+#: plugins/caffeine-quick-setting/qs.ui:37
msgid "No caffeine intervals"
msgstr "კოფეინის შუალედების გარეშე"
-#: plugins/caffeine-quick-setting/qs.ui:55
-#| msgid "Caffeine Quick Setting"
-msgid "Caffeine Settings"
-msgstr "Caffeine-iის მორგება"
-
#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
msgid "No timeout (∞)"
@@ -830,7 +815,7 @@ msgstr "უვადო (∞)"
#: plugins/caffeine-quick-setting/prefs/prefs.ui:7
msgid "Caffeine Quick Setting Preferences"
-msgstr "Caffeine-ის სწრაფი მორგების პარამეტრები"
+msgstr "კოფეინის სწრაფი მორგების პარამეტრები"
#: plugins/caffeine-quick-setting/prefs/prefs.ui:11
msgid "Caffeine Duration"
@@ -1225,15 +1210,15 @@ msgstr "%d%%"
msgid "Wi-Fi Hotspot"
msgstr "Wi-Fi ჰოტსპოტი"
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:71
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:59
msgid "Turn On"
msgstr "ჩართვა"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:80
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:76
msgid "Hotspot On"
msgstr "ჰოტსპოტი ჩართ"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:82
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:78
msgid "Hotspot Off"
msgstr "ჰოტსპოტი გამორთ"
diff --git a/phosh/po/kw.po b/phosh/po/kw.po
deleted file mode 100644
index fdb043b27..000000000
--- a/phosh/po/kw.po
+++ /dev/null
@@ -1,1243 +0,0 @@
-# Cornish translation for phosh.
-# Copyright (C) 2026 phosh's COPYRIGHT HOLDER
-# This file is distributed under the same license as the phosh package.
-# FIRST AUTHOR , YEAR.
-# Flynn Peck , 2026.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: phosh main\n"
-"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-04 11:02+0000\n"
-"PO-Revision-Date: 2026-02-08 22:24+0000\n"
-"Last-Translator: Flynn Peck \n"
-"Language-Team: kw\n"
-"Language: kw\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-DL-VCS-Web: https://gitlab.gnome.org/World/Phosh/phosh\n"
-"X-DL-Lang: kw\n"
-"X-DL-Module: phosh\n"
-"X-DL-Branch: main\n"
-"X-DL-Domain: po\n"
-"X-DL-State: Translating\n"
-"X-Generator: Gtranslator 49.0\n"
-
-#: data/mobi.phosh.Shell.desktop.in.in:3 data/wayland-sessions/phosh.desktop:3
-msgid "Phone Shell"
-msgstr "Shell Kellgowser"
-
-#: data/mobi.phosh.Shell.desktop.in.in:4
-msgid "Window management and application launching for mobile"
-msgstr "Dyghtyans fenestri ha lonchyans appys rag kellgowsoryon"
-
-#. Translators: this is the session name, no need to translate it
-#: data/phosh.session.desktop.in.in:3 data/wayland-sessions/phosh.desktop:2
-msgid "Phosh"
-msgstr "Phosh"
-
-#: data/wayland-sessions/phosh.desktop:4
-msgid "This session logs you into Phosh"
-msgstr "An esedhek ma omgelmi ty yn Phosh"
-
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.desktop.in.in:4
-msgid "Caffeine Quick Setting"
-msgstr "Settyans Uskis Kaffin"
-
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.desktop.in.in:6
-msgid "Prevent the session from going idle"
-msgstr "Lettya an esedhek rag bos diek"
-
-#: plugins/calendar/calendar.desktop.in.in:4
-msgid "Calendar"
-msgstr "Kalender"
-
-#: plugins/calendar/calendar.desktop.in.in:6
-msgid "A simple calendar widget"
-msgstr "Unn kalender sempel"
-
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.desktop.in.in:4
-msgid "Dark Mode / Color Scheme Quick Setting"
-msgstr "Settyans Uskis Fordh Du / Gis"
-
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.desktop.in.in:6
-msgid "Toggle dark mode"
-msgstr "Dewis fordh du"
-
-#: plugins/emergency-info/emergency-info.desktop.in.in:4
-msgid "Emergency Info"
-msgstr "Kedhlow Goredhom"
-
-#: plugins/emergency-info/emergency-info.desktop.in.in:6
-msgid "Show emergency information and contacts"
-msgstr "Diskwedhes kedhlow goredhom ha kestavow"
-
-#: plugins/launcher-box/launcher-box.desktop.in.in:3
-#: plugins/launcher-box/launcher-box.ui:17
-msgid "Launcher Box"
-msgstr "Boks Lonchyer"
-
-#: plugins/launcher-box/launcher-box.desktop.in.in:5
-msgid "Add launchers to the lock screen. This plugin is experimental."
-msgstr ""
-"Addya lonchyoryon war an alhwedh-skrin. An ystynnans ma yw arbrovel."
-
-#: plugins/location-quick-setting/location-quick-setting.desktop.in.in:4
-msgid "Location Quick Setting"
-msgstr "Settyans Uskis GPS"
-
-#: plugins/location-quick-setting/location-quick-setting.desktop.in.in:6
-msgid "Toggle location services on/off"
-msgstr "Dewis GPS byw/marow"
-
-#: plugins/media-players/media-players.desktop.in.in:3
-#: plugins/media-players/media-players.ui:19
-#: plugins/media-players/media-players.ui:35
-msgid "Media Players"
-msgstr "Gwarioryon Media"
-
-#: plugins/media-players/media-players.desktop.in.in:5
-msgid "Track currently running media players"
-msgstr "Helerghi gwarioryon media a'n jydh"
-
-#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.desktop.in.in:4
-msgid "Mobile Data Quick Setting"
-msgstr "Settyans Uskis Data Kellgowser"
-
-#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.desktop.in.in:6
-msgid "Toggle mobile data on/off"
-msgstr "Dewis data kellgowser byw/marow"
-
-#: plugins/night-light-quick-setting/night-light-quick-setting.desktop.in.in:4
-msgid "Night Light Quick Setting"
-msgstr "Settyansow Uskis Golow Nos"
-
-#: plugins/night-light-quick-setting/night-light-quick-setting.desktop.in.in:6
-msgid "Toggle night light on/off"
-msgstr "Dewis golow nos byw/marow"
-
-#. Translators: "Pomodoro" is a technique, no need to translate it
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.desktop.in.in:5
-msgid "Pomodoro Quick Setting"
-msgstr "Settyans Uskis Pomodoro"
-
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.desktop.in.in:7
-msgid "Simple Pomodoro Timer"
-msgstr "Termynadow Sempel Pomodoro"
-
-#: plugins/ticket-box/ticket-box.desktop.in.in:3
-#: plugins/ticket-box/ticket-box.ui:17
-msgid "Ticket Box"
-msgstr "Boks Tokyn"
-
-#: plugins/ticket-box/ticket-box.desktop.in.in:5
-msgid "Show PDFs on the lock screen. This plugin is experimental."
-msgstr ""
-"Diskwedhes PDFs war an alhwedh-skrin. An ystynnans ma yw arbrovel."
-
-#: plugins/upcoming-events/upcoming-events.desktop.in.in:3
-msgid "Upcoming Events"
-msgstr "Hwarvosow a Dheu"
-
-#: plugins/upcoming-events/upcoming-events.desktop.in.in:5
-msgid "Show upcoming calendar events"
-msgstr "Diskwedhes hwarvosow kalender a dheu"
-
-#: src/app-grid-button.c:144
-msgid "Add to Folder"
-msgstr "Addya dhe Restrenva"
-
-#: src/app-grid-button.c:168
-msgid "Create new folder"
-msgstr "Gul restrenva nowydh"
-
-#: src/app-grid-button.c:694 src/app-grid-button.c:748
-msgid "Application"
-msgstr "App"
-
-#: src/app-grid.c:264
-msgid "Show All Apps"
-msgstr "Diskwedhes Oll Appys"
-
-#: src/app-grid.c:267
-msgid "Show Only Mobile Friendly Apps"
-msgstr "Diskwedhes Appys Kellgowser-Kowethek Hepken"
-
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr "Routyans Ughelder"
-
-#. Translators: a battery level in percent
-#: src/bt-device-row.c:81
-#, c-format
-msgid "Battery %.0f%%"
-msgstr "Batri %.0F%%"
-
-#: src/bt-info.c:95 src/ui/bt-status-page.ui:6
-msgid "Bluetooth"
-msgstr "Bluetooth"
-
-#: src/bt-info.c:123
-msgctxt "bluetooth:enabled"
-msgid "On"
-msgstr "Byw"
-
-#: src/bt-status-page.c:123
-msgid "No connectable Bluetooth Devices found"
-msgstr "Devisyow Bluetooth junyadow kavosys vyth"
-
-#: src/bt-status-page.c:127
-msgid "Bluetooth disabled"
-msgstr "Bluetooth marow"
-
-#: src/call-notification.c:63
-msgid "Unknown caller"
-msgstr "Galowyer ankoth"
-
-#: src/connectivity-manager.c:114
-#, c-format
-msgid "Wi-Fi network '%s' uses a captive portal"
-msgstr "Rosweyth Wi-Fi '%s' devnydhya unn portal keth"
-
-#: src/connectivity-manager.c:116
-msgid "The Wi-Fi network uses a captive portal"
-msgstr "An rosweyth Wi-Fi devnydhya unn portal keth"
-
-#: src/connectivity-manager.c:123
-msgid "Sign into Wi-Fi network"
-msgstr "Omgelmi yn rosweyth Wi-Fi"
-
-#: src/docked-info.c:81
-msgid "Docked"
-msgstr "Junys"
-
-#: src/docked-info.c:81 src/docked-info.c:199
-msgid "Undocked"
-msgstr "Anjunys"
-
-#: src/emergency-menu.c:97 src/ui/app-auth-prompt.ui:64
-#: src/ui/cell-broadcast-prompt.ui:18 src/ui/end-session-dialog.ui:62
-msgid "Ok"
-msgstr "Da lowr"
-
-#: src/emergency-menu.c:100
-msgid "Unable to place emergency call"
-msgstr "Anabel dhe gelwel galow goredhom"
-
-#: src/emergency-menu.c:105
-msgid "Internal error"
-msgstr "Error pervedhek"
-
-#: src/end-session-dialog.c:173
-msgid "Log Out"
-msgstr "Omdhigelmi"
-
-#: src/end-session-dialog.c:176
-#, c-format
-msgid "%s will be logged out automatically in %d second."
-msgid_plural "%s will be logged out automatically in %d seconds."
-msgstr[0] "%s a wra omdhigelmys yn awtomatek yn %d eylen."
-msgstr[1] "%s a wra omdhigelmys yn awtomatek yn %d eylennow."
-
-#: src/end-session-dialog.c:182 src/ui/power-menu.ui:72
-msgid "Power Off"
-msgstr "Marowhe"
-
-#: src/end-session-dialog.c:183
-#, c-format
-msgid "The system will power off automatically in %d second."
-msgid_plural "The system will power off automatically in %d seconds."
-msgstr[0] "An system a wra marowhe yn awtomatek yn %d eylen."
-msgstr[1] "An system a wra marowhe yn awtomatek yn %d eylennow."
-
-#: src/end-session-dialog.c:189
-msgid "Restart"
-msgstr "Dastalleth"
-
-#: src/end-session-dialog.c:190
-#, c-format
-msgid "The system will restart automatically in %d second."
-msgid_plural "The system will restart automatically in %d seconds."
-msgstr[0] "An system a wra dastalleth yn awtomatek yn %d eylen."
-msgstr[1] "An system a wra dastalleth yn awtomatek yn %d eylennow."
-
-#. Translators: quiet and silent are fbd profiles names:
-#. see https://source.puri.sm/Librem5/feedbackd#profiles
-#. for details
-#: src/feedbackinfo.c:97
-msgid "Quiet"
-msgstr "Tawel"
-
-#. Translators: quiet and silent are fbd profiles names:
-#. see https://source.puri.sm/Librem5/feedbackd#profiles
-#. for details
-#: src/feedbackinfo.c:104
-msgid "Silent"
-msgstr "Tawesek"
-
-#. Translators: Enable LED, haptic and audio feedback
-#: src/feedbackinfo.c:108
-msgctxt "feedback:enabled"
-msgid "On"
-msgstr "Byw"
-
-#: src/location-manager.c:266
-#, c-format
-msgid "Allow '%s' to access your location information?"
-msgstr "Gasa '%s' drehedhes dha kedhlow GPS?"
-
-#: src/location-manager.c:271
-msgid "Geolocation"
-msgstr "GPS"
-
-#: src/location-manager.c:272
-msgid "Yes"
-msgstr "Ea"
-
-#: src/location-manager.c:272
-msgid "No"
-msgstr "Na"
-
-#. give visual feedback on error
-#: src/lockscreen.c:396 src/ui/lockscreen.ui:282
-msgid "Enter Passcode"
-msgstr "Ynworra Kod-Tremena"
-
-#: src/lockscreen.c:1036
-msgid "Checking…"
-msgstr "Ow Checkya…"
-
-#. Translators: '%s' is the filename of a screenshot
-#: src/screenshot-manager.c:238
-#, c-format
-msgid "Screenshot saved to '%s'"
-msgstr "Skrin-imach sawys dhe '%s'"
-
-#: src/screenshot-manager.c:240
-msgid "Failed to save screenshot"
-msgstr "Y fyllis sawya skrin-imach"
-
-#: src/screenshot-manager.c:244 src/ui/power-menu.ui:199
-msgid "Screenshot"
-msgstr "Skrin-Imach"
-
-#. Translators: name of the folder beneath ~/Pictures used to store screenshots
-#: src/screenshot-manager.c:554
-msgid "Screenshots"
-msgstr "Skrin-Imajys"
-
-#. Translators: Name of a screenshot file. The first '%s' is a timestamp
-#. * like "2017-05-21 12-24-03" the 2nd '%s' is a possible suffix in case
-#. * the file already exists like '-3'
-#: src/screenshot-manager.c:574
-#, c-format
-msgid "Screenshot from %s%s.png"
-msgstr "Skrin-Imach dhyworth %s%s.png"
-
-#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
-msgid "Unknown Title"
-msgstr "Titel Ankoth"
-
-#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
-msgid "Unknown Artist"
-msgstr "Awtour Ankoth"
-
-#: src/monitor-manager.c:129
-msgid "Built-in display"
-msgstr "Skrin pervedhek"
-
-#: src/monitor-manager.c:147
-#, c-format
-msgctxt ""
-"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
-msgid "%s %s"
-msgstr "%s %s"
-
-#: src/monitor-manager.c:154
-#, c-format
-msgctxt ""
-"This is a monitor vendor name followed by product/model name where size in "
-"inches could not be calculated, e.g. Dell U2414H"
-msgid "%s %s"
-msgstr "%s %s"
-
-#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
-msgid "Unknown"
-msgstr "Ankoth"
-
-#: src/network-auth-prompt.c:202
-#, c-format
-msgid "Authentication type of Wi-Fi network “%s” not supported"
-msgstr "Eghen omgelmyans a rosweyth Wi-Fi “%s” anskoodhys"
-
-#: src/network-auth-prompt.c:207
-#, c-format
-msgid "Enter password for the Wi-Fi network “%s”"
-msgstr "Ynworra ger-tremena rag an rosweyth Wi-Fi “%s”"
-
-#: src/notifications/mount-notification.c:121
-msgid "Open"
-msgstr "Ygeri"
-
-#. We don't just set the app_info but name and icon separately to
-#. * not overwrite values set by the caller
-#: src/notifications/notification.c:422 src/notifications/notification.c:695
-#: src/notifications/notify-manager.c:1009
-msgid "Notification"
-msgstr "Gwarnyans"
-
-#. Translators: Point in time, use a short word or abbreviation
-#. Please stick to a maximum of 12 chars
-#: src/notifications/timestamp-label.c:88
-msgid "now"
-msgstr "lemmyn"
-
-#. Translators: abbreviated time difference "Less than 30 seconds"
-#. Please stick to a maximum of 12 chars
-#: src/notifications/timestamp-label.c:93
-#, c-format
-msgid "<30s"
-msgstr "<30e"
-
-#. Translators: abbreviated time difference "Less than one minute"
-#. Please stick to a maximum of 12 chars
-#: src/notifications/timestamp-label.c:98
-#, c-format
-msgid "<1m"
-msgstr "<1m"
-
-#. Translators: abbreviated time difference "About one minute"
-#. Please stick to a maximum of 12 chars
-#: src/notifications/timestamp-label.c:103
-#, c-format
-msgid "~1m"
-msgstr "~1m"
-
-#. Translators: abbreviated, exact time difference "1 minute ago"
-#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:111
-#, c-format
-msgid "%dm"
-msgid_plural "%dm"
-msgstr[0] "%dm"
-msgstr[1] "%dm"
-
-#. Translators: abbreviated time difference "About 3 hours ago"
-#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:119
-#, c-format
-msgid "~%dh"
-msgid_plural "~%dh"
-msgstr[0] "~%deur"
-msgstr[1] "~%deur"
-
-#. Translators: abbreviated time difference "About 1 day ago"
-#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:124
-#, c-format
-msgid "~1d"
-msgstr "~1d"
-
-#. Translators: abbreviated, exact time difference "3 days ago"
-#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:129
-#, c-format
-msgid "%dd"
-msgid_plural "%dd"
-msgstr[0] "%dd"
-msgstr[1] "%dd"
-
-#. Translators: abbreviated time difference "About 1 month ago"
-#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:134
-#, c-format
-msgid "~1mo"
-msgstr "~1mis"
-
-#. Translators: abbreviated, exact time difference "3 months ago"
-#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:139
-#, c-format
-msgid "%dmo"
-msgid_plural "%dmos"
-msgstr[0] "%dmis"
-msgstr[1] "%dmis"
-
-#. Translators: abbreviated time difference "About 5 years ago"
-#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:149
-#, c-format
-msgid "~%dy"
-msgid_plural "~%dy"
-msgstr[0] "~%db"
-msgstr[1] "~%db"
-
-#. Translators: abbreviated time difference "Over 5 years ago"
-#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:153
-#, c-format
-msgid "Over %dy"
-msgid_plural "Over %dy"
-msgstr[0] "Moy es %db"
-msgstr[1] "Moy es %db"
-
-#. Translators: abbreviated time difference "almost 5 years ago"
-#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:158
-#, c-format
-msgid "Almost %dy"
-msgid_plural "Almost %dy"
-msgstr[0] "Ogas %db"
-msgstr[1] "Ogas %db"
-
-#: src/polkit-auth-agent.c:275
-msgid "Authentication dialog was dismissed by the user"
-msgstr "Fenester omgelmyans yw naghys gans an usyer"
-
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
-#: src/ui/system-prompt.ui:28
-msgid "Password:"
-msgstr "Ger-tremena:"
-
-#: src/polkit-auth-prompt.c:429
-msgid "Sorry, that didn’t work. Please try again."
-msgstr "Drog yw genev, na na oberi. Mar pleg assaya arta."
-
-#: src/rotateinfo.c:102
-msgid "Portrait"
-msgstr "Plommwedhek"
-
-#: src/rotateinfo.c:105
-msgid "Landscape"
-msgstr "Gorwelyek"
-
-#: src/rotateinfo.c:125 src/rotateinfo.c:230
-msgctxt "automatic-screen-rotation-disabled"
-msgid "Off"
-msgstr "Marow"
-
-#: src/rotateinfo.c:126
-msgctxt "automatic-screen-rotation-enabled"
-msgid "On"
-msgstr "Byw"
-
-#: src/run-command-dialog.c:129
-msgid "Press ESC to close"
-msgstr "Tava ESC rag degea"
-
-#: src/run-command-manager.c:89
-#, c-format
-msgid "Running '%s' failed"
-msgstr "Owth eksekutya '%s' fyllis"
-
-#: src/system-prompt.c:376
-msgid "Passwords do not match."
-msgstr "Geryow-tremena na omdhesedha."
-
-#: src/system-prompt.c:383
-msgid "Password cannot be blank"
-msgstr "Ger-tremena a res"
-
-#: src/torch-info.c:84
-msgid "Torch"
-msgstr "Torchen"
-
-#: src/ui/app-auth-prompt.ui:43
-msgid "Remember decision"
-msgstr "Kova ervirans"
-
-#: src/ui/app-auth-prompt.ui:55 src/ui/end-session-dialog.ui:53
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:25
-msgid "Cancel"
-msgstr "Hedhi"
-
-#: src/ui/app-grid-button.ui:31
-msgid "Remove from _Favorites"
-msgstr "Remova rag _Drudh"
-
-#: src/ui/app-grid-button.ui:36
-msgid "Add to _Favorites"
-msgstr "Addya dhe _Drudh"
-
-#: src/ui/app-grid-button.ui:41
-msgid "View _Details"
-msgstr "Gweles _Manylyon"
-
-#: src/ui/app-grid-button.ui:46
-msgid "Uninstall"
-msgstr "Dilea"
-
-#: src/ui/app-grid-button.ui:53
-msgid "_Remove from Folder"
-msgstr "_Remova rag Restrenva"
-
-#: src/ui/app-grid.ui:26
-msgid "Search apps…"
-msgstr "Hwilas appys…"
-
-#: src/ui/audio-settings.ui:84
-msgid "Output Devices"
-msgstr "Devisyow Eskorrans"
-
-#: src/ui/audio-settings.ui:108
-msgid "Input Devices"
-msgstr "Devisyow Ynworrans"
-
-#: src/ui/audio-settings.ui:136
-msgid "Sound Settings"
-msgstr "Settyansow Son"
-
-#: src/ui/brightness-settings.ui:87
-msgid "Automatic Brightness"
-msgstr "Golewder Awtomatek"
-
-#: src/ui/brightness-settings.ui:120
-msgid "Brightness Settings"
-msgstr "Settyansow Golewder"
-
-#: src/ui/bt-status-page.ui:39
-msgid "Enable Bluetooth"
-msgstr "Gallosegi Bluetooth"
-
-#: src/ui/bt-status-page.ui:54
-msgid "Bluetooth Settings"
-msgstr "Settyansow Bluetooth"
-
-#: src/ui/emergency-menu.ui:26
-msgid "Close the emergency call dialog"
-msgstr "Degea an fenester galow goredhom"
-
-#: src/ui/emergency-menu.ui:52
-msgid "Emergency _Contacts"
-msgstr "_Kestavow Goredhom"
-
-#: src/ui/emergency-menu.ui:59
-msgid "Go to the emergency contacts page"
-msgstr "Mos dhe'n folen kestavow goredhom"
-
-#: src/ui/emergency-menu.ui:82
-msgid "Go back to the emergency dialpad page"
-msgstr "Dehweles dhe'n folen niverpad goredhom"
-
-#: src/ui/emergency-menu.ui:105
-msgid "Owner unknown"
-msgstr "Perghen ankoth"
-
-#: src/ui/emergency-menu.ui:123 plugins/emergency-info/emergency-info.ui:211
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:170
-msgid "Emergency Contacts"
-msgstr "Kestavow Goredhom"
-
-#: src/ui/emergency-menu.ui:142
-msgid "No emergency contacts available."
-msgstr "Kestavow goredhom vyth kavadow."
-
-#: src/ui/end-session-dialog.ui:27
-msgid "Some applications are busy or have unsaved work"
-msgstr "Nebes appys yw bysi po kavos ober ansawys"
-
-#: src/ui/feedback-status-page.ui:6
-msgid "Feedback"
-msgstr "Dasliv"
-
-#: src/ui/feedback-status-page.ui:19
-msgid "Do not disturb"
-msgstr "Na ankresya"
-
-#: src/ui/feedback-status-page.ui:53
-msgid "Feedback Settings"
-msgstr "Settyansow Dasliv"
-
-#: src/ui/gtk-mount-prompt.ui:74
-msgid "User:"
-msgstr "Usyer:"
-
-#: src/ui/gtk-mount-prompt.ui:96
-msgid "Domain:"
-msgstr "Arlotteth:"
-
-#: src/ui/gtk-mount-prompt.ui:128
-msgid "Co_nnect"
-msgstr "Ju_nya"
-
-#: src/ui/lockscreen.ui:43 src/ui/lockscreen.ui:245
-msgid "Back"
-msgstr "A-Dhelergh"
-
-#: src/ui/lockscreen.ui:95
-msgid "Slide up to unlock"
-msgstr "Skubya war-vann rag dialhwedha"
-
-#: src/ui/lockscreen.ui:332
-msgid "Unlock"
-msgstr "Dialhwedha"
-
-#: src/ui/network-auth-prompt.ui:6 src/ui/polkit-auth-prompt.ui:5
-msgid "Authentication required"
-msgstr "Omgelmyans a res"
-
-#: src/ui/network-auth-prompt.ui:37
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:75
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:212
-msgid "_Cancel"
-msgstr "_Hedhi"
-
-#: src/ui/network-auth-prompt.ui:50
-msgid "C_onnect"
-msgstr "_Junya"
-
-#: src/ui/polkit-auth-prompt.ui:96
-msgid "Authenticate"
-msgstr "Omgelmi"
-
-#: src/ui/power-menu.ui:112
-msgid "Suspend"
-msgstr "Koska"
-
-#: src/ui/power-menu.ui:158
-msgid "Lock"
-msgstr "Alhwedha"
-
-#: src/ui/power-menu.ui:240
-msgid "Emergency"
-msgstr "Goredhom"
-
-#: src/ui/run-command-dialog.ui:5
-msgid "Run Command"
-msgstr "Eksekutya Arghadow"
-
-#: src/ui/settings.ui:121
-msgid "No notifications"
-msgstr "Gwarnyansow vyth"
-
-#: src/ui/settings.ui:150
-msgid "Notifications"
-msgstr "Gwarnyansow"
-
-#: src/ui/settings.ui:159
-msgid "Clear all"
-msgstr "Dilea oll"
-
-#: src/ui/system-prompt.ui:52
-msgid "Confirm:"
-msgstr "Konfirmya:"
-
-#: src/ui/top-panel.ui:34
-msgid "_Power Off…"
-msgstr "_Marowhe…"
-
-#: src/ui/top-panel.ui:61
-msgid "_Restart…"
-msgstr "_Dastalleth…"
-
-#: src/ui/top-panel.ui:88
-msgid "_Suspend…"
-msgstr "_Koska…"
-
-#: src/ui/top-panel.ui:115
-msgid "_Log Out…"
-msgstr "_Omdhigelmi…"
-
-#: src/ui/wifi-status-page.ui:6 src/wifi-info.c:90
-msgid "Wi-Fi"
-msgstr "Wi-Fi"
-
-#: src/ui/wifi-status-page.ui:89
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:85
-msgid "Wi-Fi Settings"
-msgstr "Settyansow Wi-Fi"
-
-#: src/vpn-info.c:89
-msgid "VPN"
-msgstr "VPN"
-
-#. Translators: This is a time format for a date in
-#. long format
-#: src/wall-clock.c:248
-msgid "%A, %B %-e"
-msgstr "%A, %B %-e"
-
-#: src/widget-box.c:54
-msgid "Plugin not found"
-msgstr "Ystynnans na kavosys"
-
-#: src/widget-box.c:57
-#, c-format
-msgid "The plugin '%s' could not be loaded."
-msgstr "An ystynnans '%s' na gallos bos karga."
-
-#: src/wifi-status-page.c:53
-msgid "No Wi-Fi Device Found"
-msgstr "Devis Wi-Fi Kavosys Vyth"
-
-#: src/wifi-status-page.c:57
-msgid "Wi-Fi Disabled"
-msgstr "Wi-Fi Marow"
-
-#: src/wifi-status-page.c:58
-msgid "Enable Wi-Fi"
-msgstr "Gallosegi Wi-Fi"
-
-#: src/wifi-status-page.c:61
-msgid "Wi-Fi Hotspot Active"
-msgstr "Hotspot Wi-Fi Byw"
-
-#: src/wifi-status-page.c:62
-msgid "Turn Off"
-msgstr "Marowhe"
-
-#: src/wifi-status-page.c:65
-msgid "No Wi-Fi Hotspots"
-msgstr "Hotspotys Wi-Fi Vyth"
-
-#. Translators: Refers to the cellular wireless network
-#: src/wwan-info.c:210
-msgid "Cellular"
-msgstr "Data Kellgowser"
-
-#. Translators: Phosh prevents the session from going idle because the caffeine quick setting is toggled
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:70
-msgid "Phosh on caffeine"
-msgstr "Phosh war kaffin"
-
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:245
-msgctxt "caffeine-disabled"
-msgid "Off"
-msgstr "Marow"
-
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:250
-msgctxt "caffeine-enabled"
-msgid "On"
-msgstr "Byw"
-
-#: plugins/caffeine-quick-setting/qs.ui:15
-msgid "Caffeine timers"
-msgstr "Termynador kaffin"
-
-#: plugins/caffeine-quick-setting/qs.ui:38
-msgid "No caffeine intervals"
-msgstr "Spysow kaffin vyth"
-
-#: plugins/caffeine-quick-setting/qs.ui:55
-msgid "Caffeine Settings"
-msgstr "Settyansow Kaffin"
-
-#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
-msgid "No timeout (∞)"
-msgstr "Diwedhva vyth (∞)"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:7
-msgid "Caffeine Quick Setting Preferences"
-msgstr "Settyansow Settyans Uskis Kaffin"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:11
-msgid "Caffeine Duration"
-msgstr "Termyn Kaffin"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:15
-msgid "Manage Caffeine Duration"
-msgstr "Dyghtya Termyn Kaffin"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:16
-msgid "Add or remove custom caffeine intervals"
-msgstr "Addya po remova spysow kaffin a-vusur"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:22
-msgid "Add interval"
-msgstr "Addya spys"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:66
-msgid "Add New Interval"
-msgstr "Addya Spys Nowydh"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:83
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:220
-msgid "_Add"
-msgstr "_Addya"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:115
-msgid "Quickstart Intervals"
-msgstr "Spysow Snell-Dalleth"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:127
-msgid "5 m"
-msgstr "5 m"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:138
-msgid "15 m"
-msgstr "15 m"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:149
-msgid "30 m"
-msgstr "30 m"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:160
-msgid "1 h"
-msgstr "1 eur"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:188
-msgid "Choose Interval"
-msgstr "Dewis Spys"
-
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:34
-msgid "Default style"
-msgstr "Gis defowt"
-
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:35
-msgid "Dark mode"
-msgstr "Fordh du"
-
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:36
-msgid "Light mode"
-msgstr "Fordh gwynn"
-
-#: plugins/emergency-info/emergency-info.ui:43
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:62
-msgid "Personal Information"
-msgstr "Kedhlow Personel"
-
-#: plugins/emergency-info/emergency-info.ui:51
-msgid "Date of Birth"
-msgstr "Dedhyas Dinythyans"
-
-#: plugins/emergency-info/emergency-info.ui:71
-msgid "Preferred Language"
-msgstr "Yeth Dewisek"
-
-#: plugins/emergency-info/emergency-info.ui:91
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:85
-msgid "Home Address"
-msgstr "Trigva Tre"
-
-#: plugins/emergency-info/emergency-info.ui:99
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:100
-msgid "Medical Information"
-msgstr "Kedhlow Medhegel"
-
-#: plugins/emergency-info/emergency-info.ui:107
-msgid "Age"
-msgstr "Bloodh"
-
-#: plugins/emergency-info/emergency-info.ui:127
-msgid "Blood Type"
-msgstr "Eghen Goos"
-
-#: plugins/emergency-info/emergency-info.ui:147
-msgid "Height"
-msgstr "Ughelder"
-
-#: plugins/emergency-info/emergency-info.ui:167
-msgid "Weight"
-msgstr "Poos"
-
-#: plugins/emergency-info/emergency-info.ui:187
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:129
-msgid "Allergies"
-msgstr "Allergedhow"
-
-#: plugins/emergency-info/emergency-info.ui:195
-msgid "Medications & Conditions"
-msgstr "Medhegnethow & Studhow"
-
-#: plugins/emergency-info/emergency-info.ui:203
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:155
-msgid "Other Information"
-msgstr "Kedhlow Aral"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:6
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:16
-msgid "Emergency Info Preferences"
-msgstr "Settyansow Kedhlow Goredhom"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:36
-msgid "Done"
-msgstr "Deu"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:67
-msgid "_Owner Name"
-msgstr "_Hanow Perghen"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:73
-msgid "_Date of Birth"
-msgstr "_Dedhyas Dinythyans"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:79
-msgid "_Preferred Language"
-msgstr "_Yeth Dewisek"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:105
-msgid "_Age"
-msgstr "_Bloodh"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:111
-msgid "_Blood Type"
-msgstr "_Eghen Goos"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:117
-msgid "_Height"
-msgstr "_Ughelder"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:123
-msgid "_Weight"
-msgstr "_Poos"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:142
-msgid "Medications and Conditions"
-msgstr "Medhegnethow ha Studhow"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:179
-msgid "Add Contact"
-msgstr "Addya Kestav"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:203
-msgid "Add New Contact"
-msgstr "Addya Kestav Nowydh"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:240
-msgid "_Contact Name"
-msgstr "Hanow _Kestav"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:246
-msgid "Relationship"
-msgstr "Keskolm"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:252
-msgid "_Contact Number"
-msgstr "_Niver Kestav"
-
-#: plugins/launcher-box/launcher-box.ui:18
-msgid "No launchers configured"
-msgstr "Lonchyoryon selys vyth"
-
-#: plugins/launcher-box/launcher-box.ui:33
-msgid "Launchers"
-msgstr "Lonchyoryon"
-
-#: plugins/location-quick-setting/location-quick-setting.c:65
-msgid "Location On"
-msgstr "GPS Byw"
-
-#: plugins/location-quick-setting/location-quick-setting.c:65
-msgid "Location Off"
-msgstr "GPS Marow"
-
-#: plugins/media-players/media-players.ui:20
-msgid "No running media players"
-msgstr "Gwarioyon media ow seni vyth"
-
-#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.c:79
-msgid "Mobile Data On"
-msgstr "Data Kellgowser Byw"
-
-#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.c:79
-msgid "Mobile Data Off"
-msgstr "Data Kellgowser Marow"
-
-#: plugins/night-light-quick-setting/night-light-quick-setting.c:63
-msgid "Night Light On"
-msgstr "Golow Nos Byw"
-
-#: plugins/night-light-quick-setting/night-light-quick-setting.c:63
-msgid "Night Light Off"
-msgstr "Golow Nos Marow"
-
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:72
-msgid "Pomodoro start"
-msgstr "Dalleth pomodoro"
-
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:73
-#, c-format
-msgid "Focus on your task for %d minutes"
-msgstr "Fogella war dha oberen rag %d mynysennow"
-
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:78
-msgid "Take a break"
-msgstr "Kemeres unn powes"
-
-#. Translators: Pomodoro is a technique, no need to translate it
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:80
-#, c-format
-msgid "You have %d minutes until next Pomodoro"
-msgstr "Ty kavos %d mynysennow bys yn Pomodoro nessa"
-
-#. Translators: Pomodoro is a technique, no need to translate it
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:95
-msgid "Pomodoro Timer"
-msgstr "Termynador Pomodoro"
-
-#. Translators: Pomodoro is a technique, no need to translate it
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:118
-#, c-format
-msgid "Pomodoro Off"
-msgstr "Pomodoro Marow"
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:6
-msgid "Pomodoro Quick Setting Preferences"
-msgstr "Settyansow Settyans Uskis Pomodoro"
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:11
-msgid "Pomodoro Technique"
-msgstr "Teknek Pomodoro"
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:14
-msgid "_Active Duration"
-msgstr "Termyn _Byw"
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:15
-msgid "Duration of the focus session"
-msgstr "Termyn an esedhek fog"
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:29
-msgid "_Break Duration"
-msgstr "Termyn _Powes"
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:30
-msgid "Duration of the break between sessions"
-msgstr "Termyn an powes tredh esedhek"
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:44
-msgid "_Start on unlock"
-msgstr "_Dalleth dres dialhwedha"
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:45
-msgid "Whether to start the timer on screen unlock"
-msgstr "Mar dalleth an termynador dres skrin-dialhwedha"
-
-#: plugins/ticket-box/ticket-box.ui:18
-msgid "No documents to display"
-msgstr "Skrifow vyth rag displetyans"
-
-#: plugins/ticket-box/ticket-box.ui:82
-msgid "Tickets"
-msgstr "Toknys"
-
-#: plugins/ticket-box/prefs/ticket-box-prefs.c:94
-msgid "_Open"
-msgstr "_Ygeri"
-
-#: plugins/ticket-box/prefs/ticket-box-prefs.c:95
-msgid "Choose Folder"
-msgstr "Dewis Restrenva"
-
-#: plugins/ticket-box/prefs/ticket-box-prefs.ui:6
-msgid "Ticket Box Preferences"
-msgstr "Settyansow Boks Tokyn"
-
-#: plugins/ticket-box/prefs/ticket-box-prefs.ui:10
-msgid "Paths"
-msgstr "Tylleryow"
-
-#: plugins/ticket-box/prefs/ticket-box-prefs.ui:14
-msgid "Folder Settings"
-msgstr "Settyansow Restrenva"
-
-#: plugins/ticket-box/prefs/ticket-box-prefs.ui:15
-msgid "Where Phosh looks for your tickets"
-msgstr "Pan Phosh hwilas rag dha toknys"
-
-#: plugins/ticket-box/prefs/ticket-box-prefs.ui:18
-msgid "Ticket Folder"
-msgstr "Restrenva Toknys"
-
-#: plugins/upcoming-events/event-list.c:142
-msgid "Today"
-msgstr "Hedhyw"
-
-#: plugins/upcoming-events/event-list.c:144
-msgid "Tomorrow"
-msgstr "A-Vorow"
-
-#. Translators: The current date and weekday for display in a calendar entry
-#: plugins/upcoming-events/event-list.c:151
-#, c-format
-msgid "%x %a"
-msgstr "%x %a"
-
-#: plugins/upcoming-events/event-list.ui:26
-msgid "No events"
-msgstr "Hwarvosow vyth"
-
-#. Translators: This is the time format used in 24-hour mode.
-#: plugins/upcoming-events/upcoming-event.c:56
-msgid "%R"
-msgstr "%R"
-
-#. Translators: This is the time format used in 12-hour mode.
-#: plugins/upcoming-events/upcoming-event.c:59
-msgid "%l:%M %p"
-msgstr "%l:%M %p"
-
-#. Translators: An all day event
-#: plugins/upcoming-events/upcoming-event.c:122
-#: plugins/upcoming-events/upcoming-event.c:159
-msgid "All day"
-msgstr "Dres an jydh"
-
-#. Translators: When the event ends: Ends\r16:00
-#: plugins/upcoming-events/upcoming-event.c:148
-msgid "Ends"
-msgstr "Finsya"
-
-#: plugins/upcoming-events/upcoming-event.c:400
-msgid "Untitled event"
-msgstr "Hwarvos antitlys"
-
-#: plugins/upcoming-events/upcoming-events.c:408
-#, c-format
-msgid "No events for the next %d days"
-msgstr "Hwarvosow vyth rag an nessa %d dedhyow"
-
-#: plugins/upcoming-events/upcoming-events.ui:28
-msgid "No upcoming events"
-msgstr "Hwarvosow tost vyth"
-
-#: plugins/upcoming-events/prefs/upcoming-events-prefs.ui:6
-msgid "Upcoming Events Preferences"
-msgstr "Settyansow Hwarvosow Tost"
-
-#: plugins/upcoming-events/prefs/upcoming-events-prefs.ui:10
-#: plugins/upcoming-events/prefs/upcoming-events-prefs.ui:17
-msgid "Days"
-msgstr "Dedhyow"
-
-#: plugins/upcoming-events/prefs/upcoming-events-prefs.ui:13
-msgid "Date Range"
-msgstr "Efander Dydh"
-
-#: plugins/upcoming-events/prefs/upcoming-events-prefs.ui:14
-msgid "Number of days to show events for"
-msgstr "Niver dedhyow rag diskwedhes hwarvosow"
-
-#: plugins/scaling-quick-setting/qs.ui:14
-msgid "Monitor scales"
-msgstr "Brasterow skrin"
-
-#. Translators: This is scale factor of a monitor in percent
-#: plugins/scaling-quick-setting/scale-row.c:48
-#: plugins/scaling-quick-setting/scaling-quick-setting.c:91
-#, c-format
-msgid "%d%%"
-msgstr "%d%%"
-
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:6
-msgid "Wi-Fi Hotspot"
-msgstr "Hotspot Wi-Fi"
-
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:71
-msgid "Turn On"
-msgstr "Bywhe"
-
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:80
-msgid "Hotspot On"
-msgstr "Hotspot Byw"
-
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:82
-msgid "Hotspot Off"
-msgstr "Hotspot Marow"
diff --git a/phosh/po/nb.po b/phosh/po/nb.po
index 23ffb83e8..03e137423 100644
--- a/phosh/po/nb.po
+++ b/phosh/po/nb.po
@@ -1,547 +1,149 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR , YEAR.
-#
+# Norwegian (bokmål) translation for phosh
+# Copyright (C) 2018 THE phosh'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the phosh package.
+# Flemming Richter , 2018
+# Guido Günther , 2018. #zanata
msgid ""
msgstr ""
-"Project-Id-Version: \n"
-"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2022-11-19 05:32+0000\n"
-"PO-Revision-Date: 2022-11-19 21:16+0100\n"
-"Last-Translator: \n"
-"Language-Team: \n"
-"Language: nb\n"
+"Project-Id-Version: phosh\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2020-03-14 13:18+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
+"PO-Revision-Date: 2018-09-28 06:49+0000\n"
+"Last-Translator: Copied by Zanata \n"
+"Language-Team: none\n"
+"Language: nb\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-"X-Generator: Poedit 3.1.1\n"
+"X-Generator: Zanata 4.6.2\n"
-#. Translators: this is the session name, no need to translate it
-#: data/phosh.session.desktop.in.in:4
-msgid "Phosh"
-msgstr "Phosh"
-
-#: data/sm.puri.Phosh.desktop.in.in:4
-#, fuzzy
+#: data/mobi.phosh.Shell.desktop.in.in:4
msgid "Phone Shell"
-msgstr "Telefonskall"
+msgstr ""
-#: data/sm.puri.Phosh.desktop.in.in:5
-#, fuzzy
+#: data/mobi.phosh.Shell.desktop.in.in:5
msgid "Window management and application launching for mobile"
-msgstr "Vindusstyring og applikasjonsstart for mobiler"
-
-#: plugins/calendar/calendar.desktop.in.in:4
-msgid "Calendar"
-msgstr "Kalender"
-
-#: plugins/calendar/calendar.desktop.in.in:5
-msgid "A simple calendar widget"
-msgstr "Et enkel kalender miniprogram"
-
-# Vanskelig uten contex.
-#: plugins/ticket-box/ticket-box.desktop.in.in:4
-#: plugins/ticket-box/ticket-box.ui:14
-#, fuzzy
-msgid "Ticket Box"
-msgstr "Billett boks"
-
-#: plugins/ticket-box/ticket-box.desktop.in.in:5
-msgid ""
-"Show PDFs on the lock screen. This plugin is experimental. This plugin is "
-"experimental."
msgstr ""
-"Vis PDFer på låst skjerm. Dette programtillegget er eksperimentelt. Dette "
-"programtillegget er eksperimentelt."
-#: plugins/upcoming-events/upcoming-events.desktop.in.in:4
-msgid "Upcoming Events"
-msgstr "Kommende Arrangementer"
-
-#: plugins/upcoming-events/upcoming-events.desktop.in.in:5
-msgid "Show upcoming calendar events"
-msgstr "Vis kommende kalender arrangementer"
+#. Translators: this is the session name, no need to translate it
+#: data/phosh.session.desktop.in.in:4
+msgid "Phosh"
+msgstr ""
-#: src/app-grid-button.c:529
+#: src/app-grid-button.c:523
msgid "Application"
-msgstr "Applikasjoner"
-
-#: src/app-grid.c:137
-msgid "Show All Apps"
-msgstr "Vis alle applikasjoner"
-
-#: src/app-grid.c:140
-msgid "Show Only Mobile Friendly Apps"
-msgstr "Bare Vis Mobilvennlige Applikasjoner"
-
-#: src/bt-info.c:92 src/feedbackinfo.c:78 src/rotateinfo.c:103
-msgid "On"
-msgstr "På"
-
-#: src/bt-info.c:94
-msgid "Bluetooth"
-msgstr "Blåtann"
-
-#: src/docked-info.c:81
-#, fuzzy
-msgid "Docked"
-msgstr "Forankret"
-
-#: src/docked-info.c:81 src/docked-info.c:199
-#, fuzzy
-msgid "Undocked"
-msgstr "Ikke forankret"
-
-#: src/end-session-dialog.c:162
-msgid "Log Out"
-msgstr "Log Ut"
-
-#: src/end-session-dialog.c:165
-#, c-format
-msgid "%s will be logged out automatically in %d second."
-msgid_plural "%s will be logged out automatically in %d seconds."
-msgstr[0] "%s blir logget ut automatisk om %d sekunder."
-msgstr[1] "%s blir logget ut automatisk om %d sekunder."
-
-#: src/end-session-dialog.c:171 src/ui/top-panel.ui:36
-msgid "Power Off"
-msgstr "Slå Av"
-
-#: src/end-session-dialog.c:172
-#, c-format
-msgid "The system will power off automatically in %d second."
-msgid_plural "The system will power off automatically in %d seconds."
-msgstr[0] "Systemet blir slått av automatisk om %d sekunder."
-msgstr[1] "Systemet blir slått av automatisk om %d sekunder."
-
-#: src/end-session-dialog.c:178 src/ui/top-panel.ui:29
-msgid "Restart"
-msgstr "Omstart"
-
-#: src/end-session-dialog.c:179
-#, c-format
-msgid "The system will restart automatically in %d second."
-msgid_plural "The system will restart automatically in %d seconds."
-msgstr[0] "Systemet starter automatisk på nytt om %d sekunder."
-msgstr[1] "Systemet starter automatisk på nytt om %d sekunder."
-
-#: src/end-session-dialog.c:269
-msgid "Unknown application"
-msgstr "Ukjent applikasjon"
+msgstr ""
-#. Translators: quiet and silent are fbd profiles names:
-#. see https://source.puri.sm/Librem5/feedbackd#profiles
-#. for details
-#: src/feedbackinfo.c:69
+#: src/feedbackinfo.c:38
msgid "Quiet"
-msgstr "Stille"
+msgstr ""
-#. Translators: quiet and silent are fbd profiles names:
-#. see https://source.puri.sm/Librem5/feedbackd#profiles
-#. for details
-#: src/feedbackinfo.c:75
+#: src/feedbackinfo.c:40
msgid "Silent"
-msgstr "Stille"
-
-#: src/location-manager.c:268
-#, c-format
-msgid "Allow '%s' to access your location information?"
-msgstr "La '%s' få tilgang til stedsinformasjonen din?"
-
-#: src/location-manager.c:273
-msgid "Geolocation"
-msgstr "Geolokasjon"
-
-#: src/location-manager.c:274
-msgid "Yes"
-msgstr "Ja"
+msgstr ""
-#: src/location-manager.c:274
-msgid "No"
-msgstr "Nei"
+#: src/feedbackinfo.c:42
+msgid "On"
+msgstr ""
-#: src/lockscreen.c:169 src/ui/lockscreen.ui:232
+#: src/lockscreen.c:78 src/ui/lockscreen.ui:204
msgid "Enter Passcode"
-msgstr "Skriv kode"
+msgstr ""
-#: src/lockscreen.c:393
+#: src/lockscreen.c:257
msgid "Checking…"
-msgstr "Sjekker…"
-
-#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:322 src/ui/media-player.ui:182
-msgid "Unknown Title"
-msgstr "Ukjent Tittel"
-
-#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:330 src/ui/media-player.ui:165
-msgid "Unknown Artist"
-msgstr "Ukjent Artist"
-
-#: src/monitor-manager.c:119
-msgid "Built-in display"
-msgstr "Innebygget skjerm"
+msgstr ""
-#: src/monitor-manager.c:137
-#, c-format
-msgctxt ""
-"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
-msgid "%s %s"
+#. Translators: This is a time format for a date in
+#. long format
+#: src/lockscreen.c:334
+msgid "%A, %B %-e"
msgstr ""
-#: src/monitor-manager.c:144
-#, c-format
-msgctxt ""
-"This is a monitor vendor name followed by product/model name where size in "
-"inches could not be calculated, e.g. Dell U2414H"
-msgid "%s %s"
+#: src/monitor-manager.c:53
+msgid "Built-in display"
msgstr ""
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:153
+#: src/monitor-manager.c:57
msgid "Unknown"
-msgstr "Ukjent"
-
-#: src/network-auth-prompt.c:201
-#, c-format
-msgid "Authentication type of wifi network “%s” not supported"
-msgstr "Autentiseringstypen for trådløst nettverk “%s” er ikke støttet"
+msgstr ""
-#: src/network-auth-prompt.c:206
+#: src/network-auth-prompt.c:184
#, c-format
msgid "Enter password for the wifi network “%s”"
-msgstr "Skriv passordet for det trådløse nettverket “%s”"
-
-#: src/notifications/mount-notification.c:122
-msgid "Open"
-msgstr "Åpne"
-
-#: src/notifications/notification.c:383 src/notifications/notification.c:639
-msgid "Notification"
-msgstr "Varsel"
-
-#. Translators: Timestamp seconds suffix
-#: src/notifications/timestamp-label.c:84
-msgctxt "timestamp-suffix-seconds"
-msgid "s"
-msgstr "s"
-
-#. Translators: Timestamp minute suffix
-#: src/notifications/timestamp-label.c:86
-msgctxt "timestamp-suffix-minute"
-msgid "m"
-msgstr "m"
-
-#. Translators: Timestamp minutes suffix
-#: src/notifications/timestamp-label.c:88
-msgctxt "timestamp-suffix-minutes"
-msgid "m"
-msgstr "m"
-
-#. Translators: Timestamp hour suffix
-#: src/notifications/timestamp-label.c:90
-msgctxt "timestamp-suffix-hour"
-msgid "h"
-msgstr "h"
-
-#. Translators: Timestamp hours suffix
-#: src/notifications/timestamp-label.c:92
-msgctxt "timestamp-suffix-hours"
-msgid "h"
-msgstr "h"
-
-#. Translators: Timestamp day suffix
-#: src/notifications/timestamp-label.c:94
-msgctxt "timestamp-suffix-day"
-msgid "d"
-msgstr "d"
-
-#. Translators: Timestamp days suffix
-#: src/notifications/timestamp-label.c:96
-msgctxt "timestamp-suffix-days"
-msgid "d"
-msgstr "d"
-
-#. Translators: Timestamp month suffix
-#: src/notifications/timestamp-label.c:98
-msgctxt "timestamp-suffix-month"
-msgid "mo"
msgstr ""
-#. Translators: Timestamp months suffix
-#: src/notifications/timestamp-label.c:100
-msgctxt "timestamp-suffix-months"
-msgid "mos"
-msgstr ""
-
-#. Translators: Timestamp year suffix
-#: src/notifications/timestamp-label.c:102
-msgctxt "timestamp-suffix-year"
-msgid "y"
-msgstr "år"
-
-#. Translators: Timestamp years suffix
-#: src/notifications/timestamp-label.c:104
-msgctxt "timestamp-suffix-years"
-msgid "y"
-msgstr "år"
-
-#: src/notifications/timestamp-label.c:121
-msgid "now"
-msgstr "nå"
-
-#. Translators: time difference "Over 5 years"
-#: src/notifications/timestamp-label.c:189
-#, c-format
-msgid "Over %dy"
-msgstr "Over %dy"
-
-#. Translators: time difference "almost 5 years"
-#: src/notifications/timestamp-label.c:193
-#, c-format
-msgid "Almost %dy"
-msgstr "Nesten %dy"
-
-#. Translators: a time difference like '<5m', if in doubt leave untranslated
-#: src/notifications/timestamp-label.c:200
-#, c-format
-msgid "%s%d%s"
-msgstr "%s%d%s"
-
-#: src/polkit-auth-agent.c:228
+#: src/polkit-auth-agent.c:229
msgid "Authentication dialog was dismissed by the user"
-msgstr "Autentiseringsdialogen ble avvist av brukeren"
+msgstr ""
-#: src/polkit-auth-prompt.c:278 src/ui/gtk-mount-prompt.ui:20
-#: src/ui/network-auth-prompt.ui:82 src/ui/polkit-auth-prompt.ui:56
-#: src/ui/system-prompt.ui:32
+#: src/polkit-auth-prompt.c:276 src/ui/network-auth-prompt.ui:128
+#: src/ui/polkit-auth-prompt.ui:41 src/ui/system-prompt.ui:39
msgid "Password:"
-msgstr "Passord:"
+msgstr ""
-#: src/polkit-auth-prompt.c:325
+#: src/polkit-auth-prompt.c:322
msgid "Sorry, that didn’t work. Please try again."
-msgstr "Beklager, det fungerte ikke. Vennligst forsøk på nytt."
-
-#: src/rotateinfo.c:81
-msgid "Portrait"
-msgstr "Portrett"
-
-#: src/rotateinfo.c:84
-msgid "Landscape"
-msgstr "Landskap"
-
-#. Translators: Automatic screen orientation is either on (enabled) or off (locked/disabled)
-#. Translators: Automatic screen orientation is off (locked/disabled)
-#: src/rotateinfo.c:103 src/rotateinfo.c:186
-msgid "Off"
-msgstr "Av"
-
-#: src/run-command-dialog.c:129
-msgid "Press ESC to close"
-msgstr "Trykk på ESC for å lukke"
+msgstr ""
-#: src/run-command-manager.c:94
-#, c-format
-msgid "Running '%s' failed"
-msgstr "Kjøring av '%s' feilet"
+#: src/polkit-auth-prompt.c:488
+msgid "Authenticate"
+msgstr ""
-#: src/system-prompt.c:365
+#: src/system-prompt.c:371
msgid "Passwords do not match."
-msgstr "Passordene er ikke like."
+msgstr ""
-#: src/system-prompt.c:372
+#: src/system-prompt.c:378
msgid "Password cannot be blank"
-msgstr "Passordet kan ikke være tomt"
-
-#: src/torch-info.c:80
-msgid "Torch"
-msgstr "Lommelykt"
-
-#: src/ui/app-auth-prompt.ui:49
-msgid "Remember decision"
-msgstr "Husk avgjørelse"
-
-#: src/ui/app-auth-prompt.ui:62 src/ui/end-session-dialog.ui:53
-msgid "Cancel"
-msgstr "Avbryt"
+msgstr ""
-#: src/ui/app-auth-prompt.ui:71 src/ui/end-session-dialog.ui:62
-msgid "Ok"
-msgstr "Ok"
+#: src/wifiinfo.c:55
+msgid "Wi-Fi"
+msgstr ""
-#: src/ui/app-grid-button.ui:55
+#: src/ui/app-grid-button.ui:48
msgid "App"
-msgstr "Applikasjon"
+msgstr ""
-#: src/ui/app-grid-button.ui:79
+#: src/ui/app-grid-button.ui:75
msgid "Remove from _Favorites"
-msgstr "Fjern fra _Favoritter"
+msgstr ""
-#: src/ui/app-grid-button.ui:84
+#: src/ui/app-grid-button.ui:80
msgid "Add to _Favorites"
-msgstr "Legg til _Favoritter"
-
-#: src/ui/app-grid-button.ui:89
-msgid "View _Details"
-msgstr "Se _Detaljer"
+msgstr ""
#: src/ui/app-grid.ui:21
msgid "Search apps…"
-msgstr "Søk etter applikasjoner…"
-
-#: src/ui/end-session-dialog.ui:31
-#, fuzzy
-msgid "Some applications are busy or have unsaved work"
-msgstr "Noen applikasjoner kjører eller har ikke lagret data"
-
-#: src/ui/gtk-mount-prompt.ui:94
-msgid "User:"
-msgstr "Bruker:"
-
-#: src/ui/gtk-mount-prompt.ui:117
-msgid "Domain:"
-msgstr "Domene:"
-
-# hmm
-#: src/ui/gtk-mount-prompt.ui:150
-#, fuzzy
-msgid "Co_nnect"
-msgstr "Ko_ble til"
-
-#: src/ui/lockscreen.ui:39 src/ui/lockscreen.ui:340
-msgid "Back"
-msgstr "Tilbake"
+msgstr ""
-#: src/ui/lockscreen.ui:93
+#: src/ui/lockscreen.ui:36
msgid "Slide up to unlock"
-msgstr "Skyv opp for å låse opp"
+msgstr "Trekk bildet opp for å låse opp"
-#: src/ui/lockscreen.ui:282
+#: src/ui/lockscreen.ui:250
msgid "Emergency"
-msgstr "Nødsituasjon"
+msgstr ""
-#: src/ui/lockscreen.ui:298
+#: src/ui/lockscreen.ui:266
msgid "Unlock"
-msgstr "Lås opp"
-
-#: src/ui/network-auth-prompt.ui:5 src/ui/polkit-auth-prompt.ui:6
-msgid "Authentication required"
-msgstr "Autentisering kreves"
+msgstr ""
-#: src/ui/network-auth-prompt.ui:40
+#: src/ui/network-auth-prompt.ui:90
msgid "_Cancel"
-msgstr "_Avbryt"
+msgstr ""
-#: src/ui/network-auth-prompt.ui:58
+#: src/ui/network-auth-prompt.ui:106
msgid "C_onnect"
-msgstr "K_oble til"
-
-#: src/ui/polkit-auth-prompt.ui:122
-msgid "Authenticate"
-msgstr "Autentiser"
-
-#: src/ui/run-command-dialog.ui:6
-msgid "Run Command"
-msgstr "Kjør Kommando"
-
-#: src/ui/settings.ui:301
-msgid "No notifications"
-msgstr "Ingen varsler"
+msgstr ""
-#: src/ui/settings.ui:342
-msgid "Clear all"
-msgstr "Slett alt"
+#: src/ui/polkit-auth-prompt.ui:105
+msgid "User:"
+msgstr ""
-#: src/ui/system-prompt.ui:62
+#: src/ui/system-prompt.ui:69
msgid "Confirm:"
-msgstr "Bekreft:"
-
-#: src/ui/top-panel.ui:15
-msgid "Lock Screen"
-msgstr "Lås Skjerm"
-
-#: src/ui/top-panel.ui:22
-msgid "Logout"
-msgstr "Logg ut"
-
-#. Translators: This is a time format for a date in
-#. long format
-#: src/util.c:345
-msgid "%A, %B %-e"
-msgstr "%A, %B %-e"
-
-#: src/vpn-info.c:89
-msgid "VPN"
-msgstr "VPN"
-
-#: src/widget-box.c:54
-msgid "Plugin not found"
-msgstr "Programtillegg ikke funnet"
-
-#: src/widget-box.c:57
-#, c-format
-msgid "The plugin '%s' could not be loaded."
-msgstr "Programtillegget '%s' kunne ikke lastes."
-
-#: src/wifiinfo.c:90
-msgid "Wi-Fi"
-msgstr "Trådløst Nettverk"
-
-#. Translators: Refers to the cellular wireless network
-#: src/wwan-info.c:200
-msgid "Cellular"
-msgstr "Mobilt nett"
-
-#: plugins/ticket-box/ticket-box.ui:15
-msgid "No documents to display"
-msgstr "Ingen dokumenter å vise"
-
-#: plugins/ticket-box/ticket-box.ui:83
-msgid "Tickets"
-msgstr "Billetter"
-
-#: plugins/upcoming-events/event-list.c:142
-msgid "Today"
-msgstr "Idag"
-
-#: plugins/upcoming-events/event-list.c:144
-msgid "Tomorrow"
-msgstr "I morgen"
-
-#: plugins/upcoming-events/event-list.c:150
-#, c-format
-msgid "In %d day"
-msgid_plural "In %d days"
-msgstr[0] "Om %d dag"
-msgstr[1] "Om %d dager"
-
-#: plugins/upcoming-events/event-list.ui:26
-msgid "No events"
-msgstr "Ingen arrangementer"
-
-#. Translators: This is the time format used in 24-hour mode.
-#: plugins/upcoming-events/upcoming-event.c:56
-msgid "%R"
-msgstr "%R"
-
-#. Translators: This is the time format used in 12-hour mode.
-#: plugins/upcoming-events/upcoming-event.c:59
-msgid "%l:%M %p"
-msgstr "%l:%M %p"
-
-#. Translators: An all day event
-#: plugins/upcoming-events/upcoming-event.c:122
-#: plugins/upcoming-events/upcoming-event.c:159
-msgid "All day"
-msgstr "Hele dagen"
-
-#. Translators: When the event ends: Ends\r16:00
-#: plugins/upcoming-events/upcoming-event.c:148
-msgid "Ends"
-msgstr "Avslutter"
-
-#: plugins/upcoming-events/upcoming-event.c:398
-msgid "Untitled event"
-msgstr "Ikke navngitt arrangement"
+msgstr ""
diff --git a/phosh/po/oc.po b/phosh/po/oc.po
index 465c74e15..3bdbafd00 100644
--- a/phosh/po/oc.po
+++ b/phosh/po/oc.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: phosh main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-10 17:02+0000\n"
-"PO-Revision-Date: 2026-02-14 17:46+0100\n"
+"POT-Creation-Date: 2024-05-03 14:06+0000\n"
+"PO-Revision-Date: 2024-05-07 14:55+0200\n"
"Last-Translator: Quentin PAGÈS\n"
"Language-Team: Occitan \n"
"Language: oc\n"
@@ -16,192 +16,118 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-"X-Generator: Poedit 3.8\n"
+"X-Generator: Poedit 3.4.2\n"
-#: data/mobi.phosh.Shell.desktop.in.in:3 data/wayland-sessions/phosh.desktop:3
+#. Translators: this is the session name, no need to translate it
+#: data/phosh.session.desktop.in.in:4 data/wayland-sessions/phosh.desktop:3
+msgid "Phosh"
+msgstr "Phosh"
+
+#: data/mobi.phosh.Shell.desktop.in.in:4 data/wayland-sessions/phosh.desktop:4
msgid "Phone Shell"
msgstr ""
-#: data/mobi.phosh.Shell.desktop.in.in:4
+#: data/mobi.phosh.Shell.desktop.in.in:5
msgid "Window management and application launching for mobile"
msgstr "Gestion de fenèstra e aviada d’aplicacions per mobil"
-#. Translators: this is the session name, no need to translate it
-#: data/phosh.session.desktop.in.in:3 data/wayland-sessions/phosh.desktop:2
-msgid "Phosh"
-msgstr "Phosh"
-
-#: data/wayland-sessions/phosh.desktop:4
+#: data/wayland-sessions/phosh.desktop:5
msgid "This session logs you into Phosh"
msgstr ""
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.desktop.in.in:4
+#: plugins/caffeine-quick-setting/caffeine-quick-setting.desktop.in.in:5
msgid "Caffeine Quick Setting"
msgstr ""
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.desktop.in.in:6
+#: plugins/caffeine-quick-setting/caffeine-quick-setting.desktop.in.in:7
msgid "Prevent the session from going idle"
msgstr ""
-#: plugins/calendar/calendar.desktop.in.in:4
+#: plugins/calendar/calendar.desktop.in.in:5
msgid "Calendar"
msgstr "Agenda"
-#: plugins/calendar/calendar.desktop.in.in:6
+#: plugins/calendar/calendar.desktop.in.in:7
msgid "A simple calendar widget"
msgstr ""
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.desktop.in.in:4
-msgid "Dark Mode / Color Scheme Quick Setting"
-msgstr ""
-
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.desktop.in.in:6
-msgid "Toggle dark mode"
-msgstr "Bascular al mòde escur"
-
-#: plugins/emergency-info/emergency-info.desktop.in.in:4
+#: plugins/emergency-info/emergency-info.desktop.in.in:5
msgid "Emergency Info"
msgstr "Informacions d'urgéncia"
-#: plugins/emergency-info/emergency-info.desktop.in.in:6
+#: plugins/emergency-info/emergency-info.desktop.in.in:7
msgid "Show emergency information and contacts"
msgstr ""
-#: plugins/launcher-box/launcher-box.desktop.in.in:3
-#: plugins/launcher-box/launcher-box.ui:17
+#: plugins/launcher-box/launcher-box.desktop.in.in:4
+#: plugins/launcher-box/launcher-box.ui:14
msgid "Launcher Box"
msgstr ""
-#: plugins/launcher-box/launcher-box.desktop.in.in:5
+#: plugins/launcher-box/launcher-box.desktop.in.in:6
msgid "Add launchers to the lock screen. This plugin is experimental."
msgstr ""
-#: plugins/location-quick-setting/location-quick-setting.desktop.in.in:4
-msgid "Location Quick Setting"
-msgstr ""
-
-#: plugins/location-quick-setting/location-quick-setting.desktop.in.in:6
-msgid "Toggle location services on/off"
-msgstr ""
-
-#: plugins/media-players/media-players.desktop.in.in:3
-#: plugins/media-players/media-players.ui:19
-#: plugins/media-players/media-players.ui:35
-msgid "Media Players"
-msgstr "Lectors multimèdia"
-
-#: plugins/media-players/media-players.desktop.in.in:5
-msgid "Track currently running media players"
-msgstr ""
-
-#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.desktop.in.in:4
-msgid "Mobile Data Quick Setting"
-msgstr ""
-
-#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.desktop.in.in:6
-msgid "Toggle mobile data on/off"
-msgstr ""
-
-#: plugins/night-light-quick-setting/night-light-quick-setting.desktop.in.in:4
+#: plugins/night-light-quick-setting/night-light-quick-setting.desktop.in.in:5
msgid "Night Light Quick Setting"
msgstr ""
-#: plugins/night-light-quick-setting/night-light-quick-setting.desktop.in.in:6
+#: plugins/night-light-quick-setting/night-light-quick-setting.desktop.in.in:7
msgid "Toggle night light on/off"
msgstr ""
-#. Translators: "Pomodoro" is a technique, no need to translate it
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.desktop.in.in:5
-msgid "Pomodoro Quick Setting"
-msgstr ""
-
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.desktop.in.in:7
-msgid "Simple Pomodoro Timer"
-msgstr ""
-
-#: plugins/ticket-box/ticket-box.desktop.in.in:3
-#: plugins/ticket-box/ticket-box.ui:17
+#: plugins/ticket-box/ticket-box.desktop.in.in:4
+#: plugins/ticket-box/ticket-box.ui:14
msgid "Ticket Box"
msgstr ""
-#: plugins/ticket-box/ticket-box.desktop.in.in:5
+#: plugins/ticket-box/ticket-box.desktop.in.in:6
msgid "Show PDFs on the lock screen. This plugin is experimental."
msgstr ""
-#: plugins/upcoming-events/upcoming-events.desktop.in.in:3
+#: plugins/upcoming-events/upcoming-events.desktop.in.in:4
msgid "Upcoming Events"
msgstr ""
-#: plugins/upcoming-events/upcoming-events.desktop.in.in:5
+#: plugins/upcoming-events/upcoming-events.desktop.in.in:6
msgid "Show upcoming calendar events"
msgstr ""
-#: src/app-grid-button.c:144
+#: src/app-grid-button.c:153
msgid "Add to Folder"
msgstr "Apondre al dossièr"
-#: src/app-grid-button.c:168
+#: src/app-grid-button.c:177
msgid "Create new folder"
msgstr "Crear un dossièr novèl"
-#: src/app-grid-button.c:694 src/app-grid-button.c:748
+#: src/app-grid-button.c:692 src/app-grid-button.c:749
msgid "Application"
msgstr "Aplicacion"
-#: src/app-grid.c:264
+#: src/app-grid.c:263
msgid "Show All Apps"
msgstr "Afichar totas las aplicacions"
-#: src/app-grid.c:267
+#: src/app-grid.c:266
msgid "Show Only Mobile Friendly Apps"
msgstr "Afichar sonque las aplicacions per mobil"
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr ""
-
-#. Translators: a battery level in percent
-#: src/bt-device-row.c:81
-#, c-format
-msgid "Battery %.0f%%"
-msgstr "Batariá %.0f%%"
-
-#: src/bt-info.c:95 src/ui/bt-status-page.ui:6
-msgid "Bluetooth"
-msgstr "Bluetooth"
-
-#: src/bt-info.c:123
+#: src/bt-info.c:92
#, fuzzy
#| msgid "On"
msgctxt "bluetooth:enabled"
msgid "On"
msgstr "Alucat"
-#: src/bt-status-page.c:123
-msgid "No connectable Bluetooth Devices found"
-msgstr ""
-
-#: src/bt-status-page.c:127
-msgid "Bluetooth disabled"
-msgstr "Bluetooth desactivat"
+#: src/bt-info.c:94
+msgid "Bluetooth"
+msgstr "Bluetooth"
#: src/call-notification.c:63
msgid "Unknown caller"
msgstr "Sonaire anonim"
-#: src/connectivity-manager.c:114
-#, c-format
-msgid "Wi-Fi network '%s' uses a captive portal"
-msgstr "Lo ret Wi-Fi « %s » utiliza un portal captiu"
-
-#: src/connectivity-manager.c:116
-msgid "The Wi-Fi network uses a captive portal"
-msgstr "Lo ret Wi-Fi utiliza un portal captiu"
-
-#: src/connectivity-manager.c:123
-msgid "Sign into Wi-Fi network"
-msgstr "S’inscriure sul ret Wi-Fi"
-
#: src/docked-info.c:81
msgid "Docked"
msgstr ""
@@ -210,8 +136,8 @@ msgstr ""
msgid "Undocked"
msgstr ""
-#: src/emergency-menu.c:97 src/ui/app-auth-prompt.ui:64
-#: src/ui/cell-broadcast-prompt.ui:18 src/ui/end-session-dialog.ui:62
+#: src/emergency-menu.c:97 src/ui/app-auth-prompt.ui:71
+#: src/ui/end-session-dialog.ui:71
msgid "Ok"
msgstr "D’acòrdi"
@@ -223,33 +149,33 @@ msgstr ""
msgid "Internal error"
msgstr "Error intèrna"
-#: src/end-session-dialog.c:173
+#: src/end-session-dialog.c:174
msgid "Log Out"
msgstr "Se desconnectar"
-#: src/end-session-dialog.c:176
+#: src/end-session-dialog.c:177
#, c-format
msgid "%s will be logged out automatically in %d second."
msgid_plural "%s will be logged out automatically in %d seconds."
msgstr[0] "%s serà desconnectat automaticament d’aquí %d segonda."
msgstr[1] "%s serà desconnectat automaticament d’aquí %d segondas."
-#: src/end-session-dialog.c:182 src/ui/power-menu.ui:72
+#: src/end-session-dialog.c:183 src/ui/power-menu.ui:69
msgid "Power Off"
msgstr "Atudar"
-#: src/end-session-dialog.c:183
+#: src/end-session-dialog.c:184
#, c-format
msgid "The system will power off automatically in %d second."
msgid_plural "The system will power off automatically in %d seconds."
msgstr[0] "Lo sistèma s'atudarà automaticament d’aquí %d segonda."
msgstr[1] "Lo sistèma s'atudarà automaticament d’aquí %d segondas."
-#: src/end-session-dialog.c:189
+#: src/end-session-dialog.c:190
msgid "Restart"
msgstr "Reaviar"
-#: src/end-session-dialog.c:190
+#: src/end-session-dialog.c:191
#, c-format
msgid "The system will restart automatically in %d second."
msgid_plural "The system will restart automatically in %d seconds."
@@ -278,81 +204,61 @@ msgctxt "feedback:enabled"
msgid "On"
msgstr "Alucat"
-#: src/location-manager.c:266
+#: src/location-manager.c:268
#, c-format
msgid "Allow '%s' to access your location information?"
msgstr ""
-#: src/location-manager.c:271
+#: src/location-manager.c:273
msgid "Geolocation"
msgstr "Geolocalizacion"
-#: src/location-manager.c:272
+#: src/location-manager.c:274
msgid "Yes"
msgstr "Òc"
-#: src/location-manager.c:272
+#: src/location-manager.c:274
msgid "No"
msgstr "Non"
-#. give visual feedback on error
-#: src/lockscreen.c:396 src/ui/lockscreen.ui:282
+#: src/lockscreen.c:172 src/ui/lockscreen.ui:245
msgid "Enter Passcode"
msgstr ""
-#: src/lockscreen.c:1036
+#: src/lockscreen.c:398
msgid "Checking…"
msgstr "Verificacion…"
-#. Translators: '%s' is the filename of a screenshot
-#: src/screenshot-manager.c:238
-#, c-format
-msgid "Screenshot saved to '%s'"
-msgstr ""
-
-#: src/screenshot-manager.c:240
-msgid "Failed to save screenshot"
-msgstr ""
-
-#: src/screenshot-manager.c:244 src/ui/power-menu.ui:199
+#: src/screenshot-manager.c:215 src/ui/power-menu.ui:147
msgid "Screenshot"
msgstr "Captura d'ecran"
-#. Translators: name of the folder beneath ~/Pictures used to store screenshots
-#: src/screenshot-manager.c:554
-msgid "Screenshots"
-msgstr "Capturas d'ecran"
-
-#. Translators: Name of a screenshot file. The first '%s' is a timestamp
-#. * like "2017-05-21 12-24-03" the 2nd '%s' is a possible suffix in case
-#. * the file already exists like '-3'
-#: src/screenshot-manager.c:574
-#, c-format
-msgid "Screenshot from %s%s.png"
+#: src/screenshot-manager.c:216
+msgid "Screenshot copied to clipboard"
msgstr ""
#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
+#: src/media-player.c:324 src/ui/media-player.ui:161
msgid "Unknown Title"
msgstr "Títol desconegut"
#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
+#: src/media-player.c:332 src/ui/media-player.ui:148
msgid "Unknown Artist"
msgstr "Artista desconegut"
-#: src/monitor-manager.c:129
+#: src/monitor-manager.c:127
msgid "Built-in display"
msgstr "Afichatge integrat"
-#: src/monitor-manager.c:147
+#: src/monitor-manager.c:145
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
-#: src/monitor-manager.c:154
+#: src/monitor-manager.c:152
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -361,7 +267,7 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
+#: src/monitor-manager.c:161
msgid "Unknown"
msgstr "Desconegut"
@@ -379,102 +285,99 @@ msgstr ""
msgid "Open"
msgstr "Dobrir"
-#. We don't just set the app_info but name and icon separately to
-#. * not overwrite values set by the caller
-#: src/notifications/notification.c:422 src/notifications/notification.c:695
-#: src/notifications/notify-manager.c:1009
+#: src/notifications/notification.c:405 src/notifications/notification.c:678
msgid "Notification"
msgstr "Notificacion"
#. Translators: Point in time, use a short word or abbreviation
-#. Please stick to a maximum of 12 chars
-#: src/notifications/timestamp-label.c:88
+#. Please stick to a maximum of 7 chars
+#: src/notifications/timestamp-label.c:86
msgid "now"
msgstr "ara"
#. Translators: abbreviated time difference "Less than 30 seconds"
-#. Please stick to a maximum of 12 chars
-#: src/notifications/timestamp-label.c:93
+#. Please stick to a maximum of 7 chars
+#: src/notifications/timestamp-label.c:91
#, c-format
msgid "<30s"
-msgstr "<30s"
+msgstr ""
#. Translators: abbreviated time difference "Less than one minute"
-#. Please stick to a maximum of 12 chars
-#: src/notifications/timestamp-label.c:98
+#. Please stick to a maximum of 7 chars
+#: src/notifications/timestamp-label.c:96
#, c-format
msgid "<1m"
-msgstr "<1min"
+msgstr ""
#. Translators: abbreviated time difference "About one minute"
-#. Please stick to a maximum of 12 chars
-#: src/notifications/timestamp-label.c:103
+#. Please stick to a maximum of 7 chars
+#: src/notifications/timestamp-label.c:101
#, c-format
msgid "~1m"
-msgstr "~1min"
+msgstr ""
#. Translators: abbreviated, exact time difference "1 minute ago"
#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:111
+#: src/notifications/timestamp-label.c:109
#, c-format
msgid "%dm"
msgid_plural "%dm"
-msgstr[0] "%d min"
-msgstr[1] "%d min"
+msgstr[0] ""
+msgstr[1] ""
#. Translators: abbreviated time difference "About 3 hours ago"
#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:119
+#: src/notifications/timestamp-label.c:117
#, c-format
msgid "~%dh"
msgid_plural "~%dh"
-msgstr[0] "~%dh"
-msgstr[1] "~%dh"
+msgstr[0] ""
+msgstr[1] ""
#. Translators: abbreviated time difference "About 1 day ago"
#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:124
+#: src/notifications/timestamp-label.c:122
#, c-format
msgid "~1d"
-msgstr "~1d"
+msgstr ""
#. Translators: abbreviated, exact time difference "3 days ago"
#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:129
+#: src/notifications/timestamp-label.c:127
#, c-format
msgid "%dd"
msgid_plural "%dd"
-msgstr[0] "%dd"
-msgstr[1] "%dd"
+msgstr[0] ""
+msgstr[1] ""
#. Translators: abbreviated time difference "About 1 month ago"
#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:134
+#: src/notifications/timestamp-label.c:132
#, c-format
msgid "~1mo"
-msgstr "~1 mes"
+msgstr ""
#. Translators: abbreviated, exact time difference "3 months ago"
#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:139
+#: src/notifications/timestamp-label.c:137
#, c-format
msgid "%dmo"
msgid_plural "%dmos"
-msgstr[0] "%d mes"
-msgstr[1] "%d meses"
+msgstr[0] ""
+msgstr[1] ""
#. Translators: abbreviated time difference "About 5 years ago"
#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:149
+#: src/notifications/timestamp-label.c:147
#, c-format
msgid "~%dy"
msgid_plural "~%dy"
-msgstr[0] "~%d an"
-msgstr[1] "~%d ans"
+msgstr[0] ""
+msgstr[1] ""
#. Translators: abbreviated time difference "Over 5 years ago"
#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:153
+#: src/notifications/timestamp-label.c:151
#, fuzzy, c-format
#| msgid "Over %dy"
msgid "Over %dy"
@@ -484,24 +387,24 @@ msgstr[1] "Mai de %d ans"
#. Translators: abbreviated time difference "almost 5 years ago"
#. Please stick to a maximum of 4 chars for the time unit
-#: src/notifications/timestamp-label.c:158
+#: src/notifications/timestamp-label.c:156
#, c-format
msgid "Almost %dy"
msgid_plural "Almost %dy"
msgstr[0] "Gaireben %d ans"
msgstr[1] "Gaireben %d ans"
-#: src/polkit-auth-agent.c:275
+#: src/polkit-auth-agent.c:227
msgid "Authentication dialog was dismissed by the user"
msgstr ""
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
-#: src/ui/system-prompt.ui:28
+#: src/polkit-auth-prompt.c:278 src/ui/gtk-mount-prompt.ui:20
+#: src/ui/network-auth-prompt.ui:82 src/ui/polkit-auth-prompt.ui:56
+#: src/ui/system-prompt.ui:32
msgid "Password:"
msgstr "Senhal :"
-#: src/polkit-auth-prompt.c:429
+#: src/polkit-auth-prompt.c:325
msgid "Sorry, that didn’t work. Please try again."
msgstr ""
@@ -536,50 +439,51 @@ msgstr "Quichatz Escap. per quitar"
msgid "Running '%s' failed"
msgstr ""
-#: src/system-prompt.c:376
+#: src/settings/audio-settings.c:376
+msgid "Phone Shell Volume Control"
+msgstr ""
+
+#: src/system-prompt.c:365
msgid "Passwords do not match."
msgstr "Los senhals correspondon pas."
-#: src/system-prompt.c:383
+#: src/system-prompt.c:372
msgid "Password cannot be blank"
msgstr "Lo senhal pòt pas èsser void"
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "Lampa de pòcha"
-#: src/ui/app-auth-prompt.ui:43
+#: src/ui/app-auth-prompt.ui:49
msgid "Remember decision"
msgstr "Se remembrar de la causida"
-#: src/ui/app-auth-prompt.ui:55 src/ui/end-session-dialog.ui:53
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:25
+#: src/ui/app-auth-prompt.ui:62 src/ui/end-session-dialog.ui:62
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:29
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:293
msgid "Cancel"
msgstr "Anullar"
-#: src/ui/app-grid-button.ui:31
+#: src/ui/app-grid-button.ui:23
msgid "Remove from _Favorites"
msgstr "Tirar dels _favorits"
-#: src/ui/app-grid-button.ui:36
+#: src/ui/app-grid-button.ui:28
msgid "Add to _Favorites"
msgstr "Apondre als _favorits"
-#: src/ui/app-grid-button.ui:41
+#: src/ui/app-grid-button.ui:33
msgid "View _Details"
msgstr "_Veire los detalhs"
-#: src/ui/app-grid-button.ui:46
-msgid "Uninstall"
-msgstr "Desinstallar"
-
-#: src/ui/app-grid-button.ui:53
+#: src/ui/app-grid-button.ui:41
#, fuzzy
#| msgid "Remove from _Favorites"
msgid "_Remove from Folder"
msgstr "Tirar dels _favorits"
-#: src/ui/app-grid.ui:26
+#: src/ui/app-grid.ui:24
msgid "Search apps…"
msgstr "Cercar aplicacions…"
@@ -595,22 +499,6 @@ msgstr "Periferics d'entrada"
msgid "Sound Settings"
msgstr "Paramètres del son"
-#: src/ui/brightness-settings.ui:87
-msgid "Automatic Brightness"
-msgstr "Luminositat automatica"
-
-#: src/ui/brightness-settings.ui:120
-msgid "Brightness Settings"
-msgstr "Paramètres de luminositat"
-
-#: src/ui/bt-status-page.ui:39
-msgid "Enable Bluetooth"
-msgstr "Activar lo Bluetooth"
-
-#: src/ui/bt-status-page.ui:54
-msgid "Bluetooth Settings"
-msgstr "Paramètres Bluetooth"
-
#: src/ui/emergency-menu.ui:26
msgid "Close the emergency call dialog"
msgstr ""
@@ -623,16 +511,16 @@ msgstr "Contacte d’urgéncia"
msgid "Go to the emergency contacts page"
msgstr ""
-#: src/ui/emergency-menu.ui:82
+#: src/ui/emergency-menu.ui:83
msgid "Go back to the emergency dialpad page"
msgstr ""
-#: src/ui/emergency-menu.ui:105
+#: src/ui/emergency-menu.ui:106
msgid "Owner unknown"
msgstr "Proprietari desconegut"
-#: src/ui/emergency-menu.ui:123 plugins/emergency-info/emergency-info.ui:211
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:170
+#: src/ui/emergency-menu.ui:124 plugins/emergency-info/emergency-info.ui:195
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:234
msgid "Emergency Contacts"
msgstr "Contacte d’urgéncia"
@@ -640,103 +528,80 @@ msgstr "Contacte d’urgéncia"
msgid "No emergency contacts available."
msgstr ""
-#: src/ui/end-session-dialog.ui:27
+#: src/ui/end-session-dialog.ui:31
msgid "Some applications are busy or have unsaved work"
msgstr "D'unas aplicacions son ocupadas o an de prèt pas salvats"
-#: src/ui/feedback-status-page.ui:6
-msgid "Feedback"
-msgstr ""
-
-#: src/ui/feedback-status-page.ui:19
-msgid "Do not disturb"
-msgstr "Destorbar pas"
-
-#: src/ui/feedback-status-page.ui:53
-#, fuzzy
-#| msgid "Sound Settings"
-msgid "Feedback Settings"
-msgstr "Paramètres del son"
-
-#: src/ui/gtk-mount-prompt.ui:74
+#: src/ui/gtk-mount-prompt.ui:88
msgid "User:"
msgstr "Utilizaire :"
-#: src/ui/gtk-mount-prompt.ui:96
+#: src/ui/gtk-mount-prompt.ui:111
msgid "Domain:"
msgstr "Domeni :"
-#: src/ui/gtk-mount-prompt.ui:128
+#: src/ui/gtk-mount-prompt.ui:144
msgid "Co_nnect"
msgstr "Se co_nnectar"
-#: src/ui/lockscreen.ui:43 src/ui/lockscreen.ui:245
+#: src/ui/lockscreen.ui:36 src/ui/lockscreen.ui:334
msgid "Back"
msgstr "Tornar"
-#: src/ui/lockscreen.ui:95
+#: src/ui/lockscreen.ui:97
msgid "Slide up to unlock"
msgstr ""
-#: src/ui/lockscreen.ui:332
+#: src/ui/lockscreen.ui:297
msgid "Unlock"
msgstr "Desverrolhar"
-#: src/ui/network-auth-prompt.ui:6 src/ui/polkit-auth-prompt.ui:5
+#: src/ui/network-auth-prompt.ui:5 src/ui/polkit-auth-prompt.ui:6
msgid "Authentication required"
msgstr "Autentificacion requesida"
-#: src/ui/network-auth-prompt.ui:37
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:75
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:212
+#: src/ui/network-auth-prompt.ui:40
+#: plugins/ticket-box/prefs/ticket-box-prefs.c:90
msgid "_Cancel"
msgstr "_Anullar"
-#: src/ui/network-auth-prompt.ui:50
+#: src/ui/network-auth-prompt.ui:58
msgid "C_onnect"
msgstr "Se _connectar"
-#: src/ui/polkit-auth-prompt.ui:96
+#: src/ui/polkit-auth-prompt.ui:117
msgid "Authenticate"
msgstr "S'autentificar"
-#: src/ui/power-menu.ui:112
-msgid "Suspend"
-msgstr "Metre en velha"
-
-#: src/ui/power-menu.ui:158
+#: src/ui/power-menu.ui:108
msgid "Lock"
msgstr "Verrolhar"
-#: src/ui/power-menu.ui:240
+#: src/ui/power-menu.ui:186
msgid "Emergency"
msgstr "Urgéncia"
-#: src/ui/run-command-dialog.ui:5
+#: src/ui/run-command-dialog.ui:6
msgid "Run Command"
msgstr "Executar la comanda"
-#: src/ui/settings.ui:121
+#: src/ui/settings.ui:327
msgid "No notifications"
msgstr "Cap de notificacions"
-#: src/ui/settings.ui:150
-msgid "Notifications"
-msgstr "Notificacions"
-
-#: src/ui/settings.ui:159
+#: src/ui/settings.ui:367
msgid "Clear all"
msgstr "Tot escafar"
-#: src/ui/system-prompt.ui:52
+#: src/ui/system-prompt.ui:57
msgid "Confirm:"
msgstr "Confirmar :"
-#: src/ui/top-panel.ui:34
+#: src/ui/top-panel.ui:32
msgid "_Power Off…"
msgstr "_Atudar…"
-#: src/ui/top-panel.ui:61
+#: src/ui/top-panel.ui:60
msgid "_Restart…"
msgstr "_Reaviar…"
@@ -744,16 +609,31 @@ msgstr "_Reaviar…"
msgid "_Suspend…"
msgstr "_Metre en velha…"
-#: src/ui/top-panel.ui:115
+#: src/ui/top-panel.ui:116
msgid "_Log Out…"
msgstr "Se _desconnectar…"
-#: src/ui/wifi-status-page.ui:6 src/wifi-info.c:90
-msgid "Wi-Fi"
-msgstr "Wi-Fi"
+#: src/ui/wifi-status-page.ui:32
+msgid "No Wi-Fi Device Found"
+msgstr "Cap de periferic Wi-Fi pas trobat"
+
+#: src/ui/wifi-status-page.ui:60
+msgid "Wi-Fi Disabled"
+msgstr "Wi-Fi desactivat"
+
+#: src/ui/wifi-status-page.ui:97
+msgid "Wi-Fi Hotspot Active"
+msgstr "Punt d’accès Wi-Fi activat"
+
+#: src/ui/wifi-status-page.ui:133
+msgid "No Wi-Fi Hotspots Found"
+msgstr "Cap de punt d’accès Wi-Fi pas trobat"
+
+#: src/ui/wifi-status-page.ui:144
+msgid "Scan"
+msgstr ""
-#: src/ui/wifi-status-page.ui:89
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:85
+#: src/ui/wifi-status-page.ui:176
msgid "Wi-Fi Settings"
msgstr "Paramètres Wi-Fi"
@@ -763,7 +643,7 @@ msgstr "VPN"
#. Translators: This is a time format for a date in
#. long format
-#: src/wall-clock.c:248
+#: src/wall-clock.c:218
msgid "%A, %B %-e"
msgstr "%A %e %B"
@@ -776,29 +656,9 @@ msgstr ""
msgid "The plugin '%s' could not be loaded."
msgstr ""
-#: src/wifi-status-page.c:53
-msgid "No Wi-Fi Device Found"
-msgstr "Cap de periferic Wi-Fi pas trobat"
-
-#: src/wifi-status-page.c:57
-msgid "Wi-Fi Disabled"
-msgstr "Wi-Fi desactivat"
-
-#: src/wifi-status-page.c:58
-msgid "Enable Wi-Fi"
-msgstr "Activar lo Wifi"
-
-#: src/wifi-status-page.c:61
-msgid "Wi-Fi Hotspot Active"
-msgstr "Punt d’accès Wi-Fi activat"
-
-#: src/wifi-status-page.c:62
-msgid "Turn Off"
-msgstr "Atudar"
-
-#: src/wifi-status-page.c:65
-msgid "No Wi-Fi Hotspots"
-msgstr "Cap de punt d’accès Wi-Fi"
+#: src/wifi-info.c:90
+msgid "Wi-Fi"
+msgstr "Wi-Fi"
#. Translators: Refers to the cellular wireless network
#: src/wwan-info.c:210
@@ -806,356 +666,167 @@ msgid "Cellular"
msgstr "Mobil"
#. Translators: Phosh prevents the session from going idle because the caffeine quick setting is toggled
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:70
+#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:52
msgid "Phosh on caffeine"
msgstr ""
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:245
-#, fuzzy
-#| msgid "Off"
-msgctxt "caffeine-disabled"
-msgid "Off"
-msgstr "Atudat"
-
-#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:250
-#, fuzzy
-#| msgid "On"
-msgctxt "caffeine-enabled"
+#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:131
msgid "On"
msgstr "Alucat"
-#: plugins/caffeine-quick-setting/qs.ui:15
-msgid "Caffeine timers"
-msgstr ""
-
-#: plugins/caffeine-quick-setting/qs.ui:38
-msgid "No caffeine intervals"
-msgstr ""
-
-#: plugins/caffeine-quick-setting/qs.ui:55
-#, fuzzy
-#| msgid "Sound Settings"
-msgid "Caffeine Settings"
-msgstr "Paramètres del son"
-
-#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
-msgid "No timeout (∞)"
-msgstr ""
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:7
-msgid "Caffeine Quick Setting Preferences"
-msgstr ""
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:11
-msgid "Caffeine Duration"
-msgstr ""
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:15
-msgid "Manage Caffeine Duration"
-msgstr ""
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:16
-msgid "Add or remove custom caffeine intervals"
-msgstr ""
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:22
-msgid "Add interval"
-msgstr "Apondre un interval"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:66
-msgid "Add New Interval"
-msgstr "Apondre un interval novèl"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:83
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:220
-msgid "_Add"
-msgstr "_Apondre"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:115
-msgid "Quickstart Intervals"
-msgstr ""
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:127
-msgid "5 m"
-msgstr "5 min"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:138
-msgid "15 m"
-msgstr "15 min"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:149
-msgid "30 m"
-msgstr "30 min"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:160
-msgid "1 h"
-msgstr "1h"
-
-#: plugins/caffeine-quick-setting/prefs/prefs.ui:188
-msgid "Choose Interval"
-msgstr "Causir l’interval"
-
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:34
-msgid "Default style"
-msgstr "Estil per defaut"
-
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:35
-msgid "Dark mode"
-msgstr "Mòde escur"
-
-#: plugins/dark-mode-quick-setting/dark-mode-quick-setting.c:36
-msgid "Light mode"
-msgstr "Mòde clar"
+#: plugins/caffeine-quick-setting/caffeine-quick-setting.c:131
+msgid "Off"
+msgstr "Atudat"
-#: plugins/emergency-info/emergency-info.ui:43
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:62
+#: plugins/emergency-info/emergency-info.ui:39
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:70
msgid "Personal Information"
msgstr "Informacions personalas"
-#: plugins/emergency-info/emergency-info.ui:51
+#: plugins/emergency-info/emergency-info.ui:47
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:88
msgid "Date of Birth"
msgstr "Data de naissença"
-#: plugins/emergency-info/emergency-info.ui:71
+#: plugins/emergency-info/emergency-info.ui:65
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:100
msgid "Preferred Language"
msgstr "Lenga preferida"
-#: plugins/emergency-info/emergency-info.ui:91
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:85
+#: plugins/emergency-info/emergency-info.ui:83
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:112
msgid "Home Address"
msgstr "Adreça personala"
-#: plugins/emergency-info/emergency-info.ui:99
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:100
+#: plugins/emergency-info/emergency-info.ui:91
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:130
msgid "Medical Information"
msgstr "Informacions medicalas"
-#: plugins/emergency-info/emergency-info.ui:107
+#: plugins/emergency-info/emergency-info.ui:99
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:136
msgid "Age"
msgstr "Atge"
-#: plugins/emergency-info/emergency-info.ui:127
+#: plugins/emergency-info/emergency-info.ui:117
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:148
msgid "Blood Type"
msgstr "Grop sanguin"
-#: plugins/emergency-info/emergency-info.ui:147
+#: plugins/emergency-info/emergency-info.ui:135
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:160
msgid "Height"
msgstr "Talha"
-#: plugins/emergency-info/emergency-info.ui:167
+#: plugins/emergency-info/emergency-info.ui:153
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:172
msgid "Weight"
msgstr "Pes"
-#: plugins/emergency-info/emergency-info.ui:187
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:129
+#: plugins/emergency-info/emergency-info.ui:171
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:184
msgid "Allergies"
msgstr "Allergias"
-#: plugins/emergency-info/emergency-info.ui:195
+#: plugins/emergency-info/emergency-info.ui:179
msgid "Medications & Conditions"
msgstr "Tractaments e utilizacion"
-#: plugins/emergency-info/emergency-info.ui:203
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:155
+#: plugins/emergency-info/emergency-info.ui:187
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:216
msgid "Other Information"
msgstr "Autras informacions"
#: plugins/emergency-info/prefs/emergency-info-prefs.ui:6
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:16
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:19
msgid "Emergency Info Preferences"
msgstr "Preferéncias d'informacion d'urgéncia"
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:36
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:40
msgid "Done"
msgstr "Terminat"
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:67
-msgid "_Owner Name"
-msgstr "_Nom del proprietari"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:73
-msgid "_Date of Birth"
-msgstr "_Data de naissença"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:79
-msgid "_Preferred Language"
-msgstr "_Lenga preferida"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:105
-msgid "_Age"
-msgstr "_Atge"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:111
-msgid "_Blood Type"
-msgstr "_Grop sanguin"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:117
-msgid "_Height"
-msgstr "_Nautor"
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:76
+msgid "Owner Name"
+msgstr "Nom del proprietari"
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:123
-#, fuzzy
-#| msgid "Weight"
-msgid "_Weight"
-msgstr "Pes"
-
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:142
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:200
msgid "Medications and Conditions"
msgstr ""
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:179
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:243
msgid "Add Contact"
msgstr "Apondre un contacte"
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:203
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:288
msgid "Add New Contact"
msgstr "Apondre contacte novèl"
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:240
-msgid "_Contact Name"
-msgstr "_Nom del contacte"
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:298
+msgid "Add"
+msgstr "Apondre"
+
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:319
+msgid "New Contact Name"
+msgstr "Nom del contacte novèl"
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:246
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:333
msgid "Relationship"
msgstr "Relacion"
-#: plugins/emergency-info/prefs/emergency-info-prefs.ui:252
-msgid "_Contact Number"
-msgstr "_Numèro del contacte"
+#: plugins/emergency-info/prefs/emergency-info-prefs.ui:346
+msgid "Number"
+msgstr "Numèro"
-#: plugins/launcher-box/launcher-box.ui:18
+#: plugins/launcher-box/launcher-box.ui:15
msgid "No launchers configured"
msgstr ""
-#: plugins/launcher-box/launcher-box.ui:33
+#: plugins/launcher-box/launcher-box.ui:32
msgid "Launchers"
-msgstr "Aviadors"
-
-#: plugins/location-quick-setting/location-quick-setting.c:65
-msgid "Location On"
-msgstr "Geolocalizacion activa"
-
-#: plugins/location-quick-setting/location-quick-setting.c:65
-msgid "Location Off"
-msgstr "Geolocalizacion desactivada"
-
-#: plugins/media-players/media-players.ui:20
-msgid "No running media players"
msgstr ""
-#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.c:79
-msgid "Mobile Data On"
-msgstr "Donadas mobilas activas"
-
-#: plugins/mobile-data-quick-setting/mobile-data-quick-setting.c:79
-msgid "Mobile Data Off"
-msgstr "Donadas mobilas desactivas"
-
-#: plugins/night-light-quick-setting/night-light-quick-setting.c:63
+#: plugins/night-light-quick-setting/night-light-quick-setting.c:64
msgid "Night Light On"
msgstr "Mòde nuèch activat"
-#: plugins/night-light-quick-setting/night-light-quick-setting.c:63
+#: plugins/night-light-quick-setting/night-light-quick-setting.c:64
msgid "Night Light Off"
msgstr "Mòde nuèch desactivat"
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:72
-msgid "Pomodoro start"
-msgstr ""
-
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:73
-#, c-format
-msgid "Focus on your task for %d minutes"
-msgstr ""
-
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:78
-msgid "Take a break"
-msgstr ""
-
-#. Translators: Pomodoro is a technique, no need to translate it
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:80
-#, c-format
-msgid "You have %d minutes until next Pomodoro"
-msgstr ""
-
-#. Translators: Pomodoro is a technique, no need to translate it
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:95
-msgid "Pomodoro Timer"
-msgstr ""
-
-#. Translators: Pomodoro is a technique, no need to translate it
-#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:118
-#, fuzzy, c-format
-#| msgid "Power Off"
-msgid "Pomodoro Off"
-msgstr "Atudar"
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:6
-msgid "Pomodoro Quick Setting Preferences"
-msgstr ""
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:11
-msgid "Pomodoro Technique"
-msgstr ""
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:14
-msgid "_Active Duration"
-msgstr ""
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:15
-msgid "Duration of the focus session"
-msgstr ""
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:29
-msgid "_Break Duration"
-msgstr ""
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:30
-msgid "Duration of the break between sessions"
-msgstr ""
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:44
-msgid "_Start on unlock"
-msgstr ""
-
-#: plugins/pomodoro-quick-setting/prefs/prefs.ui:45
-msgid "Whether to start the timer on screen unlock"
-msgstr ""
-
-#: plugins/ticket-box/ticket-box.ui:18
+#: plugins/ticket-box/ticket-box.ui:15
msgid "No documents to display"
msgstr ""
-#: plugins/ticket-box/ticket-box.ui:82
+#: plugins/ticket-box/ticket-box.ui:83
msgid "Tickets"
msgstr "Tiquets"
-#: plugins/ticket-box/prefs/ticket-box-prefs.c:94
+#: plugins/ticket-box/prefs/ticket-box-prefs.c:86
+msgid "Choose Folder"
+msgstr ""
+
+#: plugins/ticket-box/prefs/ticket-box-prefs.c:89
msgid "_Open"
msgstr "_Dobrir"
-#: plugins/ticket-box/prefs/ticket-box-prefs.c:95
-msgid "Choose Folder"
-msgstr "Causir un dossièr"
-
#: plugins/ticket-box/prefs/ticket-box-prefs.ui:6
msgid "Ticket Box Preferences"
msgstr ""
-#: plugins/ticket-box/prefs/ticket-box-prefs.ui:10
+#: plugins/ticket-box/prefs/ticket-box-prefs.ui:13
msgid "Paths"
msgstr ""
-#: plugins/ticket-box/prefs/ticket-box-prefs.ui:14
+#: plugins/ticket-box/prefs/ticket-box-prefs.ui:18
msgid "Folder Settings"
msgstr ""
-#: plugins/ticket-box/prefs/ticket-box-prefs.ui:15
+#: plugins/ticket-box/prefs/ticket-box-prefs.ui:19
msgid "Where Phosh looks for your tickets"
msgstr ""
-#: plugins/ticket-box/prefs/ticket-box-prefs.ui:18
+#: plugins/ticket-box/prefs/ticket-box-prefs.ui:22
msgid "Ticket Folder"
msgstr ""
@@ -1167,11 +838,12 @@ msgstr "Uèi"
msgid "Tomorrow"
msgstr "Deman"
-#. Translators: The current date and weekday for display in a calendar entry
-#: plugins/upcoming-events/event-list.c:151
+#: plugins/upcoming-events/event-list.c:150
#, c-format
-msgid "%x %a"
-msgstr ""
+msgid "In %d day"
+msgid_plural "In %d days"
+msgstr[0] "D’aquí %d jorn"
+msgstr[1] "D’aquí %d jorns"
#: plugins/upcoming-events/event-list.ui:26
msgid "No events"
@@ -1202,75 +874,6 @@ msgstr "S'acaba"
msgid "Untitled event"
msgstr "Eveniment sens títol"
-#: plugins/upcoming-events/upcoming-events.c:408
-#, c-format
-msgid "No events for the next %d days"
-msgstr ""
-
-#: plugins/upcoming-events/upcoming-events.ui:28
-#, fuzzy
-#| msgid "No events"
-msgid "No upcoming events"
-msgstr "Cap d’eveniment"
-
-#: plugins/upcoming-events/prefs/upcoming-events-prefs.ui:6
-#, fuzzy
-#| msgid "Emergency Info Preferences"
-msgid "Upcoming Events Preferences"
-msgstr "Preferéncias d'informacion d'urgéncia"
-
-#: plugins/upcoming-events/prefs/upcoming-events-prefs.ui:10
-#: plugins/upcoming-events/prefs/upcoming-events-prefs.ui:17
-msgid "Days"
-msgstr "Jorns"
-
-#: plugins/upcoming-events/prefs/upcoming-events-prefs.ui:13
-msgid "Date Range"
-msgstr ""
-
-#: plugins/upcoming-events/prefs/upcoming-events-prefs.ui:14
-msgid "Number of days to show events for"
-msgstr ""
-
-#: plugins/scaling-quick-setting/qs.ui:14
-msgid "Monitor scales"
-msgstr ""
-
-#. Translators: This is scale factor of a monitor in percent
-#: plugins/scaling-quick-setting/scale-row.c:48
-#: plugins/scaling-quick-setting/scaling-quick-setting.c:91
-#, c-format
-msgid "%d%%"
-msgstr ""
-
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:6
-msgid "Wi-Fi Hotspot"
-msgstr "Punt d’accès Wi-Fi"
-
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:71
-msgid "Turn On"
-msgstr ""
-
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:80
-msgid "Hotspot On"
-msgstr ""
-
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:82
-msgid "Hotspot Off"
-msgstr ""
-
-#~ msgid "Add"
-#~ msgstr "Apondre"
-
-#~ msgid "Number"
-#~ msgstr "Numèro"
-
-#, c-format
-#~ msgid "In %d day"
-#~ msgid_plural "In %d days"
-#~ msgstr[0] "D’aquí %d jorn"
-#~ msgstr[1] "D’aquí %d jorns"
-
#~ msgid "Unknown application"
#~ msgstr "Aplicacion desconeguda"
diff --git a/phosh/po/pt_BR.po b/phosh/po/pt_BR.po
index ecb5ae6a0..0629ee9e6 100644
--- a/phosh/po/pt_BR.po
+++ b/phosh/po/pt_BR.po
@@ -3,17 +3,17 @@
# This file is distributed under the same license as the phosh package.
# Luís Fernando Stürmer da Rosa , 2018-2020.
# Matheus Barbosa , 2022.
+# Álvaro Burns <>, 2025.
# Rafael Fontenelle , 2020-2025.
# Juliano de Souza Camargo , 2024-2025.
-# Álvaro Burns <>, 2025-2026.
#
msgid ""
msgstr ""
"Project-Id-Version: phosh\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-09 12:22+0000\n"
-"PO-Revision-Date: 2026-02-09 18:07-0300\n"
-"Last-Translator: Álvaro Burns <>\n"
+"POT-Creation-Date: 2025-11-27 21:54+0000\n"
+"PO-Revision-Date: 2025-11-28 08:42-0300\n"
+"Last-Translator: Juliano de Souza Camargo \n"
"Language-Team: Brazilian Portuguese \n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
@@ -153,18 +153,14 @@ msgstr "Criar uma nova pasta"
msgid "Application"
msgstr "Aplicativo"
-#: src/app-grid.c:264
+#: src/app-grid.c:261
msgid "Show All Apps"
msgstr "Mostrar todos os aplicativos"
-#: src/app-grid.c:267
+#: src/app-grid.c:264
msgid "Show Only Mobile Friendly Apps"
msgstr "Mostrar apenas os aplicativos para dispositivos móveis"
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr "Shell do controle de volume do telefone"
-
#. Translators: a battery level in percent
#: src/bt-device-row.c:81
#, c-format
@@ -297,11 +293,11 @@ msgid "No"
msgstr "Não"
#. give visual feedback on error
-#: src/lockscreen.c:396 src/ui/lockscreen.ui:282
+#: src/lockscreen.c:313 src/ui/lockscreen.ui:282
msgid "Enter Passcode"
msgstr "Insira a senha"
-#: src/lockscreen.c:1036
+#: src/lockscreen.c:956
msgid "Checking…"
msgstr "Verificando…"
@@ -333,27 +329,27 @@ msgid "Screenshot from %s%s.png"
msgstr "Captura de tela de %s%s.png"
#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
+#: src/media-player.c:690 src/ui/media-player.ui:208
msgid "Unknown Title"
msgstr "Título desconhecido"
#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
+#: src/media-player.c:698 src/ui/media-player.ui:196
msgid "Unknown Artist"
msgstr "Artista desconhecido"
-#: src/monitor-manager.c:129
+#: src/monitor-manager.c:128
msgid "Built-in display"
msgstr "Tela integrada"
-#: src/monitor-manager.c:147
+#: src/monitor-manager.c:146
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
-#: src/monitor-manager.c:154
+#: src/monitor-manager.c:153
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -362,7 +358,7 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
+#: src/monitor-manager.c:162
msgid "Unknown"
msgstr "Desconhecido"
@@ -491,17 +487,17 @@ msgid_plural "Almost %dy"
msgstr[0] "Quase %dy"
msgstr[1] "Quase %dy"
-#: src/polkit-auth-agent.c:275
+#: src/polkit-auth-agent.c:271
msgid "Authentication dialog was dismissed by the user"
msgstr "Diálogo de autenticação dispensado pelo usuário"
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
+#: src/polkit-auth-prompt.c:275 src/ui/gtk-mount-prompt.ui:17
+#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:45
#: src/ui/system-prompt.ui:28
msgid "Password:"
msgstr "Senha:"
-#: src/polkit-auth-prompt.c:429
+#: src/polkit-auth-prompt.c:322
msgid "Sorry, that didn’t work. Please try again."
msgstr "Ops! Não deu! Tente novamente."
@@ -532,6 +528,10 @@ msgstr "Pressione ESC para fechar"
msgid "Running '%s' failed"
msgstr "Falha ao execução de “%s”"
+#: src/settings/audio-settings.c:376
+msgid "Phone Shell Volume Control"
+msgstr "Shell do controle de volume do telefone"
+
#: src/system-prompt.c:376
msgid "Passwords do not match."
msgstr "As senhas não conferem."
@@ -540,7 +540,7 @@ msgstr "As senhas não conferem."
msgid "Password cannot be blank"
msgstr "A senha não pode ficar em branco"
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "Tocha"
@@ -646,7 +646,7 @@ msgstr "Feedback"
msgid "Do not disturb"
msgstr "Não perturbe"
-#: src/ui/feedback-status-page.ui:53
+#: src/ui/feedback-status-page.ui:52
msgid "Feedback Settings"
msgstr "Configurações de feedback"
@@ -688,7 +688,7 @@ msgstr "_Cancelar"
msgid "C_onnect"
msgstr "C_onectar"
-#: src/ui/polkit-auth-prompt.ui:96
+#: src/ui/polkit-auth-prompt.ui:97
msgid "Authenticate"
msgstr "Autenticar"
@@ -745,7 +745,7 @@ msgid "Wi-Fi"
msgstr "Wi-Fi"
#: src/ui/wifi-status-page.ui:89
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:85
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:73
msgid "Wi-Fi Settings"
msgstr "Configurações de Wi-Fi"
@@ -816,14 +816,10 @@ msgstr "Ligada"
msgid "Caffeine timers"
msgstr "Temporizadores caffeine"
-#: plugins/caffeine-quick-setting/qs.ui:38
+#: plugins/caffeine-quick-setting/qs.ui:37
msgid "No caffeine intervals"
msgstr "Sem intervalos caffeine"
-#: plugins/caffeine-quick-setting/qs.ui:55
-msgid "Caffeine Settings"
-msgstr "Configurações do Caffeine"
-
#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
msgid "No timeout (∞)"
@@ -1185,7 +1181,7 @@ msgstr "Termina"
msgid "Untitled event"
msgstr "Evento sem título"
-#: plugins/upcoming-events/upcoming-events.c:408
+#: plugins/upcoming-events/upcoming-events.c:372
#, c-format
msgid "No events for the next %d days"
msgstr "Nenhum evento para os próximos %d dias"
@@ -1226,15 +1222,15 @@ msgstr "%d%%"
msgid "Wi-Fi Hotspot"
msgstr "Ponto de acesso Wi-Fi"
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:71
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:59
msgid "Turn On"
msgstr "Ativar"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:80
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:76
msgid "Hotspot On"
msgstr "Ponto de acesso ligado"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:82
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:78
msgid "Hotspot Off"
msgstr "Ponto de acesso desligado"
diff --git a/phosh/po/ro.po b/phosh/po/ro.po
index 9ac6f9a11..be984d58d 100644
--- a/phosh/po/ro.po
+++ b/phosh/po/ro.po
@@ -1,14 +1,14 @@
# Romanian translation for phosh.
# Copyright (C) 2020 phosh's COPYRIGHT HOLDER
# This file is distributed under the same license as the phosh package.
-# Antonio Marin , 2024-2026.
+# Antonio Marin , 2024-2025.
#
msgid ""
msgstr ""
"Project-Id-Version: phosh master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-04 11:02+0000\n"
-"PO-Revision-Date: 2026-02-04 17:32+0100\n"
+"POT-Creation-Date: 2025-11-27 21:54+0000\n"
+"PO-Revision-Date: 2025-11-28 15:35+0100\n"
"Last-Translator: Antonio Marin \n"
"Language-Team: Romanian \n"
"Language: ro\n"
@@ -153,18 +153,14 @@ msgstr "Creează un dosar nou"
msgid "Application"
msgstr "Aplicație"
-#: src/app-grid.c:264
+#: src/app-grid.c:261
msgid "Show All Apps"
msgstr "Arată toate aplicațiile"
-#: src/app-grid.c:267
+#: src/app-grid.c:264
msgid "Show Only Mobile Friendly Apps"
msgstr "Arată numai aplicații pentru mobil"
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr "Controlul sunetului"
-
#. Translators: a battery level in percent
#: src/bt-device-row.c:81
#, c-format
@@ -246,9 +242,9 @@ msgstr "Oprește"
#, c-format
msgid "The system will power off automatically in %d second."
msgid_plural "The system will power off automatically in %d seconds."
-msgstr[0] "Sistemul se va opri automat după %d secundă."
-msgstr[1] "Sistemul se va opri automat după %d secunde."
-msgstr[2] "Sistemul se va opri automat după %d de secunde."
+msgstr[0] "Sistemul se va opri automat în %d secundă."
+msgstr[1] "Sistemul se va opri automat în %d secunde."
+msgstr[2] "Sistemul se va opri automat în %d de secunde."
#: src/end-session-dialog.c:189
msgid "Restart"
@@ -258,9 +254,9 @@ msgstr "Repornește"
#, c-format
msgid "The system will restart automatically in %d second."
msgid_plural "The system will restart automatically in %d seconds."
-msgstr[0] "Sistemul va reporni automat după %d secundă."
-msgstr[1] "Sistemul va reporni automat după %d secunde."
-msgstr[2] "Sistemul va reporni automat după %d de secunde."
+msgstr[0] "Sistemul va reporni automat în %d secundă."
+msgstr[1] "Sistemul va reporni automat în %d secunde."
+msgstr[2] "Sistemul va reporni automat în %d de secunde."
#. Translators: quiet and silent are fbd profiles names:
#. see https://source.puri.sm/Librem5/feedbackd#profiles
@@ -300,11 +296,11 @@ msgid "No"
msgstr "Nu"
#. give visual feedback on error
-#: src/lockscreen.c:396 src/ui/lockscreen.ui:282
+#: src/lockscreen.c:313 src/ui/lockscreen.ui:282
msgid "Enter Passcode"
msgstr "Introdu codul de acces"
-#: src/lockscreen.c:1036
+#: src/lockscreen.c:956
msgid "Checking…"
msgstr "Se verifică…"
@@ -316,16 +312,16 @@ msgstr "Instantaneu de ecran salvat ca „%s”"
#: src/screenshot-manager.c:240
msgid "Failed to save screenshot"
-msgstr "Nu s-a putut salva instantaneul de ecran"
+msgstr "Nu s-a putut salva instantaneul"
#: src/screenshot-manager.c:244 src/ui/power-menu.ui:199
msgid "Screenshot"
-msgstr "Instantaneu de ecran"
+msgstr "Instantaneu"
#. Translators: name of the folder beneath ~/Pictures used to store screenshots
#: src/screenshot-manager.c:554
msgid "Screenshots"
-msgstr "Instantanee de ecran"
+msgstr "Instantanee"
#. Translators: Name of a screenshot file. The first '%s' is a timestamp
#. * like "2017-05-21 12-24-03" the 2nd '%s' is a possible suffix in case
@@ -333,30 +329,30 @@ msgstr "Instantanee de ecran"
#: src/screenshot-manager.c:574
#, c-format
msgid "Screenshot from %s%s.png"
-msgstr "Imagine %s%s.png"
+msgstr "Instantaneu de ecran %s%s.png"
#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
+#: src/media-player.c:690 src/ui/media-player.ui:208
msgid "Unknown Title"
msgstr "Titlu necunoscut"
#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
+#: src/media-player.c:698 src/ui/media-player.ui:196
msgid "Unknown Artist"
msgstr "Artist necunoscut"
-#: src/monitor-manager.c:129
+#: src/monitor-manager.c:128
msgid "Built-in display"
msgstr "Ecran integrat"
-#: src/monitor-manager.c:147
+#: src/monitor-manager.c:146
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
-#: src/monitor-manager.c:154
+#: src/monitor-manager.c:153
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -365,7 +361,7 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
+#: src/monitor-manager.c:162
msgid "Unknown"
msgstr "Necunoscut"
@@ -501,17 +497,17 @@ msgstr[0] "Aproape %d an"
msgstr[1] "Aproape %d ani"
msgstr[2] "Aproape %d ani"
-#: src/polkit-auth-agent.c:275
+#: src/polkit-auth-agent.c:271
msgid "Authentication dialog was dismissed by the user"
msgstr "Fereastra de autentificare a fost închisă de utilizator"
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
+#: src/polkit-auth-prompt.c:275 src/ui/gtk-mount-prompt.ui:17
+#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:45
#: src/ui/system-prompt.ui:28
msgid "Password:"
msgstr "Parola:"
-#: src/polkit-auth-prompt.c:429
+#: src/polkit-auth-prompt.c:322
msgid "Sorry, that didn’t work. Please try again."
msgstr "Nu a funcționat. Încearcă din nou."
@@ -542,6 +538,10 @@ msgstr "Apasă ESC pentru a închide"
msgid "Running '%s' failed"
msgstr "Executarea „%s” a eșuat"
+#: src/settings/audio-settings.c:376
+msgid "Phone Shell Volume Control"
+msgstr "Controlul sunetului"
+
#: src/system-prompt.c:376
msgid "Passwords do not match."
msgstr "Parolele nu se potrivesc."
@@ -550,7 +550,7 @@ msgstr "Parolele nu se potrivesc."
msgid "Password cannot be blank"
msgstr "Parola nu poate fi goală"
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "Lanternă"
@@ -656,7 +656,7 @@ msgstr "Reacții"
msgid "Do not disturb"
msgstr "Nu deranja"
-#: src/ui/feedback-status-page.ui:53
+#: src/ui/feedback-status-page.ui:52
msgid "Feedback Settings"
msgstr "Opțiuni pentru reacții"
@@ -698,7 +698,7 @@ msgstr "_Anulează"
msgid "C_onnect"
msgstr "C_onectează"
-#: src/ui/polkit-auth-prompt.ui:96
+#: src/ui/polkit-auth-prompt.ui:97
msgid "Authenticate"
msgstr "Autentificare"
@@ -755,7 +755,7 @@ msgid "Wi-Fi"
msgstr "Wi-Fi"
#: src/ui/wifi-status-page.ui:89
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:85
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:73
msgid "Wi-Fi Settings"
msgstr "Opțiuni Wi-Fi"
@@ -826,14 +826,10 @@ msgstr "Pornit"
msgid "Caffeine timers"
msgstr "Timpi Cafeină"
-#: plugins/caffeine-quick-setting/qs.ui:38
+#: plugins/caffeine-quick-setting/qs.ui:37
msgid "No caffeine intervals"
msgstr "Niciun interval Cafeină"
-#: plugins/caffeine-quick-setting/qs.ui:55
-msgid "Caffeine Settings"
-msgstr "Opțiuni Cafeină"
-
#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
msgid "No timeout (∞)"
@@ -1195,7 +1191,7 @@ msgstr "Se termină"
msgid "Untitled event"
msgstr "Eveniment fără titlu"
-#: plugins/upcoming-events/upcoming-events.c:408
+#: plugins/upcoming-events/upcoming-events.c:372
#, c-format
msgid "No events for the next %d days"
msgstr "Niciun eveniment pentru următoarele %d zile"
@@ -1236,14 +1232,14 @@ msgstr "%d%%"
msgid "Wi-Fi Hotspot"
msgstr "Punct de acces Wi-Fi"
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:71
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:59
msgid "Turn On"
msgstr "Pornește"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:80
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:76
msgid "Hotspot On"
msgstr "Punct de acces Activ"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:82
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:78
msgid "Hotspot Off"
msgstr "Punct de acces Oprit"
diff --git a/phosh/po/ru.po b/phosh/po/ru.po
index 789c5ae41..a2109458a 100644
--- a/phosh/po/ru.po
+++ b/phosh/po/ru.po
@@ -5,8 +5,8 @@ msgid ""
msgstr ""
"Project-Id-Version: phosh\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-04 11:02+0000\n"
-"PO-Revision-Date: 2026-02-07 22:08+0300\n"
+"POT-Creation-Date: 2025-11-28 12:32+0000\n"
+"PO-Revision-Date: 2025-11-28 18:03+0300\n"
"Last-Translator: Artur So \n"
"Language-Team: Russian\n"
"Language: ru\n"
@@ -151,18 +151,14 @@ msgstr "Создать новую папку"
msgid "Application"
msgstr "Приложение"
-#: src/app-grid.c:264
+#: src/app-grid.c:261
msgid "Show All Apps"
msgstr "Показать все приложения"
-#: src/app-grid.c:267
+#: src/app-grid.c:264
msgid "Show Only Mobile Friendly Apps"
msgstr "Показать приложения только для мобильных устройств"
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr "Регулятор громкости оболочки телефона"
-
#. Translators: a battery level in percent
#: src/bt-device-row.c:81
#, c-format
@@ -298,11 +294,11 @@ msgid "No"
msgstr "Нет"
#. give visual feedback on error
-#: src/lockscreen.c:396 src/ui/lockscreen.ui:282
+#: src/lockscreen.c:313 src/ui/lockscreen.ui:282
msgid "Enter Passcode"
msgstr "Введите код доступа"
-#: src/lockscreen.c:1036
+#: src/lockscreen.c:956
msgid "Checking…"
msgstr "Проверка…"
@@ -334,27 +330,27 @@ msgid "Screenshot from %s%s.png"
msgstr "Снимок экрана от %s%s.png"
#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
+#: src/media-player.c:690 src/ui/media-player.ui:208
msgid "Unknown Title"
msgstr "Неизвестное название"
#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
+#: src/media-player.c:698 src/ui/media-player.ui:196
msgid "Unknown Artist"
msgstr "Неизвестный исполнитель"
-#: src/monitor-manager.c:129
+#: src/monitor-manager.c:128
msgid "Built-in display"
msgstr "Встроенный дисплей"
-#: src/monitor-manager.c:147
+#: src/monitor-manager.c:146
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
-#: src/monitor-manager.c:154
+#: src/monitor-manager.c:153
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -363,7 +359,7 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
+#: src/monitor-manager.c:162
msgid "Unknown"
msgstr "Неизвестный"
@@ -499,17 +495,17 @@ msgstr[0] "Почти %d г"
msgstr[1] "Почти %d г"
msgstr[2] "Почти %d л"
-#: src/polkit-auth-agent.c:275
+#: src/polkit-auth-agent.c:271
msgid "Authentication dialog was dismissed by the user"
msgstr "Диалог аутентификации был отклонен пользователем"
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
+#: src/polkit-auth-prompt.c:275 src/ui/gtk-mount-prompt.ui:17
+#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:45
#: src/ui/system-prompt.ui:28
msgid "Password:"
msgstr "Пароль:"
-#: src/polkit-auth-prompt.c:429
+#: src/polkit-auth-prompt.c:322
msgid "Sorry, that didn’t work. Please try again."
msgstr "Извините, это не сработало. Попробуйте снова."
@@ -540,6 +536,10 @@ msgstr "Нажмите Esc чтобы закрыть"
msgid "Running '%s' failed"
msgstr "Выполнение '%s' не удалось"
+#: src/settings/audio-settings.c:376
+msgid "Phone Shell Volume Control"
+msgstr "Регулятор громкости оболочки телефона"
+
#: src/system-prompt.c:376
msgid "Passwords do not match."
msgstr "Пароли не совпадают."
@@ -548,7 +548,7 @@ msgstr "Пароли не совпадают."
msgid "Password cannot be blank"
msgstr "Пароль не может быть пустым"
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "Фонарик"
@@ -654,7 +654,7 @@ msgstr "Обратная связь"
msgid "Do not disturb"
msgstr "Не беспокоить"
-#: src/ui/feedback-status-page.ui:53
+#: src/ui/feedback-status-page.ui:52
msgid "Feedback Settings"
msgstr "Настройки обратной связи"
@@ -696,7 +696,7 @@ msgstr "_Отменить"
msgid "C_onnect"
msgstr "П_одключить"
-#: src/ui/polkit-auth-prompt.ui:96
+#: src/ui/polkit-auth-prompt.ui:97
msgid "Authenticate"
msgstr "Подтвердить"
@@ -753,7 +753,7 @@ msgid "Wi-Fi"
msgstr "Wi-Fi"
#: src/ui/wifi-status-page.ui:89
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:85
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:73
msgid "Wi-Fi Settings"
msgstr "Настройки Wi-Fi"
@@ -824,14 +824,10 @@ msgstr "Вкл"
msgid "Caffeine timers"
msgstr "Таймеры кофеина"
-#: plugins/caffeine-quick-setting/qs.ui:38
+#: plugins/caffeine-quick-setting/qs.ui:37
msgid "No caffeine intervals"
msgstr "Нет интервалов кофеина"
-#: plugins/caffeine-quick-setting/qs.ui:55
-msgid "Caffeine Settings"
-msgstr "Настройки кофеина"
-
#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
msgid "No timeout (∞)"
@@ -1059,7 +1055,7 @@ msgstr "Запустить Pomodoro"
#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:73
#, c-format
msgid "Focus on your task for %d minutes"
-msgstr "Сфокусироваться на задаче на %d мин"
+msgstr "Сфокусироваться на задаче на %d мин."
#: plugins/pomodoro-quick-setting/pomodoro-quick-setting.c:78
msgid "Take a break"
@@ -1193,7 +1189,7 @@ msgstr "Конец"
msgid "Untitled event"
msgstr "Безымянное событие"
-#: plugins/upcoming-events/upcoming-events.c:408
+#: plugins/upcoming-events/upcoming-events.c:372
#, c-format
msgid "No events for the next %d days"
msgstr "Нет событий в течение следующих %d дней"
@@ -1234,15 +1230,15 @@ msgstr "%d%%"
msgid "Wi-Fi Hotspot"
msgstr "Точка доступа Wi-Fi"
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:71
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:59
msgid "Turn On"
msgstr "Включить"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:80
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:76
msgid "Hotspot On"
msgstr "Точка доступа включена"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:82
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:78
msgid "Hotspot Off"
msgstr "Точка доступа выключена"
diff --git a/phosh/po/sl.po b/phosh/po/sl.po
index c40032f52..8eac36d84 100644
--- a/phosh/po/sl.po
+++ b/phosh/po/sl.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: phosh main\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-04 11:02+0000\n"
-"PO-Revision-Date: 2026-02-04 21:09+0100\n"
+"POT-Creation-Date: 2025-11-27 16:38+0000\n"
+"PO-Revision-Date: 2025-11-27 22:53+0100\n"
"Last-Translator: Martin Srebotnjak \n"
"Language-Team: Slovenian \n"
"Language: sl\n"
@@ -151,18 +151,14 @@ msgstr "Ustvari novo mapo"
msgid "Application"
msgstr "Program"
-#: src/app-grid.c:264
+#: src/app-grid.c:261
msgid "Show All Apps"
msgstr "Pokaži vse programe"
-#: src/app-grid.c:267
+#: src/app-grid.c:264
msgid "Show Only Mobile Friendly Apps"
msgstr "Pokaži le na nabilnih napravah podprte programe"
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr "Gum za glasnost lupine telefona"
-
#. Translators: a battery level in percent
#: src/bt-device-row.c:81
#, c-format
@@ -301,11 +297,11 @@ msgid "No"
msgstr "Ne"
#. give visual feedback on error
-#: src/lockscreen.c:396 src/ui/lockscreen.ui:282
+#: src/lockscreen.c:313 src/ui/lockscreen.ui:282
msgid "Enter Passcode"
msgstr "Vnesite geslo"
-#: src/lockscreen.c:1036
+#: src/lockscreen.c:956
msgid "Checking…"
msgstr "Preverjanje …"
@@ -337,27 +333,27 @@ msgid "Screenshot from %s%s.png"
msgstr "Zaslonska slika iz %s%s.png"
#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
+#: src/media-player.c:690 src/ui/media-player.ui:208
msgid "Unknown Title"
msgstr "Neznan naslov"
#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
+#: src/media-player.c:698 src/ui/media-player.ui:196
msgid "Unknown Artist"
msgstr "Neznan izvajalec"
-#: src/monitor-manager.c:129
+#: src/monitor-manager.c:128
msgid "Built-in display"
msgstr "Vgrajen zaslon"
-#: src/monitor-manager.c:147
+#: src/monitor-manager.c:146
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
-#: src/monitor-manager.c:154
+#: src/monitor-manager.c:153
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -366,7 +362,7 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
+#: src/monitor-manager.c:162
msgid "Unknown"
msgstr "Neznano"
@@ -509,17 +505,17 @@ msgstr[1] "Skoraj %d leti"
msgstr[2] "Skoraj %d leta"
msgstr[3] "Skoraj %d let"
-#: src/polkit-auth-agent.c:275
+#: src/polkit-auth-agent.c:271
msgid "Authentication dialog was dismissed by the user"
msgstr "Uporabnik je opustil pogovorno okno za preverjanje pristnosti"
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
+#: src/polkit-auth-prompt.c:275 src/ui/gtk-mount-prompt.ui:17
+#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:45
#: src/ui/system-prompt.ui:28
msgid "Password:"
msgstr "Geslo:"
-#: src/polkit-auth-prompt.c:429
+#: src/polkit-auth-prompt.c:322
msgid "Sorry, that didn’t work. Please try again."
msgstr "Žal to ne deluje. Poskusite znova."
@@ -550,6 +546,10 @@ msgstr "Pritisnite ESC, da zaprete"
msgid "Running '%s' failed"
msgstr "Zagon »%s« ni uspel"
+#: src/settings/audio-settings.c:376
+msgid "Phone Shell Volume Control"
+msgstr "Gum za glasnost lupine telefona"
+
#: src/system-prompt.c:376
msgid "Passwords do not match."
msgstr "Gesli se ne ujemata."
@@ -558,7 +558,7 @@ msgstr "Gesli se ne ujemata."
msgid "Password cannot be blank"
msgstr "Geslo ne sme biti prazno."
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "Svetilka"
@@ -664,7 +664,7 @@ msgstr "Povratne informacije"
msgid "Do not disturb"
msgstr "Ne moti"
-#: src/ui/feedback-status-page.ui:53
+#: src/ui/feedback-status-page.ui:52
msgid "Feedback Settings"
msgstr "Nastavitve povratnih informacij"
@@ -706,7 +706,7 @@ msgstr "Pre_kliči"
msgid "C_onnect"
msgstr "_Poveži"
-#: src/ui/polkit-auth-prompt.ui:96
+#: src/ui/polkit-auth-prompt.ui:97
msgid "Authenticate"
msgstr "Overi"
@@ -763,7 +763,7 @@ msgid "Wi-Fi"
msgstr "Wi-Fi"
#: src/ui/wifi-status-page.ui:89
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:85
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:73
msgid "Wi-Fi Settings"
msgstr "Nastavitve za Wi-Fi"
@@ -834,14 +834,10 @@ msgstr "Vključeno"
msgid "Caffeine timers"
msgstr "Kofeinski časovniki"
-#: plugins/caffeine-quick-setting/qs.ui:38
+#: plugins/caffeine-quick-setting/qs.ui:37
msgid "No caffeine intervals"
msgstr "Brez intervalov kofeina"
-#: plugins/caffeine-quick-setting/qs.ui:55
-msgid "Caffeine Settings"
-msgstr "Nastavitve za Caffeine"
-
#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
msgid "No timeout (∞)"
@@ -1203,7 +1199,7 @@ msgstr "Konča se"
msgid "Untitled event"
msgstr "Neimenovan dogodek"
-#: plugins/upcoming-events/upcoming-events.c:408
+#: plugins/upcoming-events/upcoming-events.c:372
#, c-format
msgid "No events for the next %d days"
msgstr "Ni dogodkov v naslednjih %d dneh"
@@ -1244,14 +1240,14 @@ msgstr "%d %%"
msgid "Wi-Fi Hotspot"
msgstr "Dostopna točka Wi-Fi"
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:71
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:59
msgid "Turn On"
msgstr "Vklopi"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:80
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:76
msgid "Hotspot On"
msgstr "Dostopna točka je vklopljena"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:82
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:78
msgid "Hotspot Off"
msgstr "Dostopna točka je izklopljena"
diff --git a/phosh/po/sv.po b/phosh/po/sv.po
index 92700b2ee..47061d792 100644
--- a/phosh/po/sv.po
+++ b/phosh/po/sv.po
@@ -1,14 +1,14 @@
# Ludwig Johnson , 2018. #zanata
# Nami , 2019. #zanata
-# Anders Jonsson , 2020, 2021, 2022, 2023, 2024, 2025, 2026.
+# Anders Jonsson , 2020, 2021, 2022, 2023, 2024, 2025.
# Luna Jernberg , 2021, 2022, 2023.
#
msgid ""
msgstr ""
"Project-Id-Version: phosh\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-04 11:02+0000\n"
-"PO-Revision-Date: 2026-02-05 22:46+0100\n"
+"POT-Creation-Date: 2025-12-24 16:01+0000\n"
+"PO-Revision-Date: 2025-12-25 00:09+0100\n"
"Last-Translator: Anders Jonsson \n"
"Language-Team: Swedish \n"
"Language: sv\n"
@@ -159,10 +159,6 @@ msgstr "Visa alla appar"
msgid "Show Only Mobile Friendly Apps"
msgstr "Visa endast mobilanpassade appar"
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr "Volymkontroll för Phone Shell"
-
#. Translators: a battery level in percent
#: src/bt-device-row.c:81
#, c-format
@@ -300,7 +296,7 @@ msgstr "Nej"
msgid "Enter Passcode"
msgstr "Ange lösenord"
-#: src/lockscreen.c:1036
+#: src/lockscreen.c:1040
msgid "Checking…"
msgstr "Kontrollerar…"
@@ -332,27 +328,27 @@ msgid "Screenshot from %s%s.png"
msgstr "Skärmbild från %s%s.png"
#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
+#: src/media-player.c:690 src/ui/media-player.ui:208
msgid "Unknown Title"
msgstr "Okänd titel"
#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
+#: src/media-player.c:698 src/ui/media-player.ui:196
msgid "Unknown Artist"
msgstr "Okänd artist"
-#: src/monitor-manager.c:129
+#: src/monitor-manager.c:128
msgid "Built-in display"
msgstr "Inbyggd skärm"
-#: src/monitor-manager.c:147
+#: src/monitor-manager.c:146
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
-#: src/monitor-manager.c:154
+#: src/monitor-manager.c:153
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -361,7 +357,7 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
+#: src/monitor-manager.c:162
msgid "Unknown"
msgstr "Okänd"
@@ -490,17 +486,17 @@ msgid_plural "Almost %dy"
msgstr[0] "Nästan %dår"
msgstr[1] "Nästan %dår"
-#: src/polkit-auth-agent.c:275
+#: src/polkit-auth-agent.c:271
msgid "Authentication dialog was dismissed by the user"
msgstr "Autentiseringsdialogen avvisades av användaren"
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
+#: src/polkit-auth-prompt.c:275 src/ui/gtk-mount-prompt.ui:17
+#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:45
#: src/ui/system-prompt.ui:28
msgid "Password:"
msgstr "Lösenord:"
-#: src/polkit-auth-prompt.c:429
+#: src/polkit-auth-prompt.c:322
msgid "Sorry, that didn’t work. Please try again."
msgstr "Tyvärr, det fungerade inte. Var god försök igen."
@@ -531,6 +527,10 @@ msgstr "Tryck Esc för att stänga"
msgid "Running '%s' failed"
msgstr "Körning av ”%s” misslyckades"
+#: src/settings/audio-settings.c:376
+msgid "Phone Shell Volume Control"
+msgstr "Volymkontroll för Phone Shell"
+
#: src/system-prompt.c:376
msgid "Passwords do not match."
msgstr "Lösenorden matchar inte."
@@ -539,7 +539,7 @@ msgstr "Lösenorden matchar inte."
msgid "Password cannot be blank"
msgstr "Lösenordet får inte vara tomt"
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "Ficklampa"
@@ -645,7 +645,7 @@ msgstr "Återkoppling"
msgid "Do not disturb"
msgstr "Stör ej"
-#: src/ui/feedback-status-page.ui:53
+#: src/ui/feedback-status-page.ui:52
msgid "Feedback Settings"
msgstr "Återkopplingsinställningar"
@@ -687,7 +687,7 @@ msgstr "A_vbryt"
msgid "C_onnect"
msgstr "A_nslut"
-#: src/ui/polkit-auth-prompt.ui:96
+#: src/ui/polkit-auth-prompt.ui:97
msgid "Authenticate"
msgstr "Godkänn"
@@ -815,14 +815,10 @@ msgstr "På"
msgid "Caffeine timers"
msgstr "Koffeintidtagare"
-#: plugins/caffeine-quick-setting/qs.ui:38
+#: plugins/caffeine-quick-setting/qs.ui:37
msgid "No caffeine intervals"
msgstr "Inga koffeinintervall"
-#: plugins/caffeine-quick-setting/qs.ui:55
-msgid "Caffeine Settings"
-msgstr "Koffeininställningar"
-
#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
msgid "No timeout (∞)"
diff --git a/phosh/po/tr.po b/phosh/po/tr.po
index a78492ac4..881b6f47b 100644
--- a/phosh/po/tr.po
+++ b/phosh/po/tr.po
@@ -9,9 +9,9 @@ msgid ""
msgstr ""
"Project-Id-Version: phosh\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-04 11:02+0000\n"
-"PO-Revision-Date: 2026-02-06 00:18+0300\n"
-"Last-Translator: Sabri Ünal \n"
+"POT-Creation-Date: 2025-12-14 14:33+0000\n"
+"PO-Revision-Date: 2025-11-16 08:00+0300\n"
+"Last-Translator: Emin Tufan Çetin \n"
"Language-Team: Turkish \n"
"Language: tr\n"
"MIME-Version: 1.0\n"
@@ -150,18 +150,14 @@ msgstr "Yeni klasör oluştur"
msgid "Application"
msgstr "Uygulama"
-#: src/app-grid.c:264
+#: src/app-grid.c:261
msgid "Show All Apps"
msgstr "Tüm Uygulamaları Göster"
-#: src/app-grid.c:267
+#: src/app-grid.c:264
msgid "Show Only Mobile Friendly Apps"
msgstr "Yalnızca Mobil Uyumluları Göster"
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr "Telefon Kabuğu Ses Denetimi"
-
#. Translators: a battery level in percent
#: src/bt-device-row.c:81
#, c-format
@@ -295,7 +291,7 @@ msgstr "Hayır"
msgid "Enter Passcode"
msgstr "Parolayı Gir"
-#: src/lockscreen.c:1036
+#: src/lockscreen.c:1040
msgid "Checking…"
msgstr "Denetleniyor…"
@@ -327,27 +323,27 @@ msgid "Screenshot from %s%s.png"
msgstr "Ekran görüntüsü %s%s.png"
#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
+#: src/media-player.c:690 src/ui/media-player.ui:208
msgid "Unknown Title"
msgstr "Bilinmeyen Başlık"
#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
+#: src/media-player.c:698 src/ui/media-player.ui:196
msgid "Unknown Artist"
msgstr "Bilinmeyen Sanatçı"
-#: src/monitor-manager.c:129
+#: src/monitor-manager.c:128
msgid "Built-in display"
msgstr "İç ekran"
-#: src/monitor-manager.c:147
+#: src/monitor-manager.c:146
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
-#: src/monitor-manager.c:154
+#: src/monitor-manager.c:153
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -356,7 +352,7 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
+#: src/monitor-manager.c:162
msgid "Unknown"
msgstr "Bilinmeyen"
@@ -478,17 +474,17 @@ msgid "Almost %dy"
msgid_plural "Almost %dy"
msgstr[0] "Neredeyse %d yıl"
-#: src/polkit-auth-agent.c:275
+#: src/polkit-auth-agent.c:271
msgid "Authentication dialog was dismissed by the user"
msgstr "Kullanıcı, kimlik doğrulama kutusunu görmezden geldi"
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
+#: src/polkit-auth-prompt.c:275 src/ui/gtk-mount-prompt.ui:17
+#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:45
#: src/ui/system-prompt.ui:28
msgid "Password:"
msgstr "Parola:"
-#: src/polkit-auth-prompt.c:429
+#: src/polkit-auth-prompt.c:322
msgid "Sorry, that didn’t work. Please try again."
msgstr "Üzgünüz, işe yaramadı. Lütfen yeniden deneyin."
@@ -519,6 +515,10 @@ msgstr "ESC’ye basarak kapat"
msgid "Running '%s' failed"
msgstr "'%s' çalıştırılamadı"
+#: src/settings/audio-settings.c:376
+msgid "Phone Shell Volume Control"
+msgstr "Telefon Kabuğu Ses Denetimi"
+
#: src/system-prompt.c:376
msgid "Passwords do not match."
msgstr "Parolalar eşleşmiyor."
@@ -527,7 +527,7 @@ msgstr "Parolalar eşleşmiyor."
msgid "Password cannot be blank"
msgstr "Parola boş olamaz"
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "Fener"
@@ -633,7 +633,7 @@ msgstr "Geri Bildirim"
msgid "Do not disturb"
msgstr "Rahatsız etme"
-#: src/ui/feedback-status-page.ui:53
+#: src/ui/feedback-status-page.ui:52
msgid "Feedback Settings"
msgstr "Geri Bildirim Ayarları"
@@ -675,7 +675,7 @@ msgstr "İ_ptal"
msgid "C_onnect"
msgstr "_Bağlan"
-#: src/ui/polkit-auth-prompt.ui:96
+#: src/ui/polkit-auth-prompt.ui:97
msgid "Authenticate"
msgstr "Kimlik Doğrula"
@@ -803,14 +803,10 @@ msgstr "Açık"
msgid "Caffeine timers"
msgstr "Kafein zamanlayıcıları"
-#: plugins/caffeine-quick-setting/qs.ui:38
+#: plugins/caffeine-quick-setting/qs.ui:37
msgid "No caffeine intervals"
msgstr "Kafein aralıkları yok"
-#: plugins/caffeine-quick-setting/qs.ui:55
-msgid "Caffeine Settings"
-msgstr "Kafein Ayarları"
-
#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
msgid "No timeout (∞)"
diff --git a/phosh/po/uk.po b/phosh/po/uk.po
index 38042931c..ad2162983 100644
--- a/phosh/po/uk.po
+++ b/phosh/po/uk.po
@@ -3,13 +3,13 @@
# This file is distributed under the same license as the phosh package.
#
# Roman Riabenko , 2020. #zanata.
-# Yuri Chornoivan , 2020, 2021, 2022, 2023, 2024, 2025, 2026.
+# Yuri Chornoivan , 2020, 2021, 2022, 2023, 2024, 2025.
msgid ""
msgstr ""
"Project-Id-Version: phosh\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/World/Phosh/phosh/issues\n"
-"POT-Creation-Date: 2026-02-04 11:02+0000\n"
-"PO-Revision-Date: 2026-02-04 22:09+0200\n"
+"POT-Creation-Date: 2025-11-28 12:32+0000\n"
+"PO-Revision-Date: 2025-11-28 20:47+0200\n"
"Last-Translator: Yuri Chornoivan \n"
"Language-Team: Ukrainian \n"
"Language: uk\n"
@@ -151,18 +151,14 @@ msgstr "Створити теку"
msgid "Application"
msgstr "Програма"
-#: src/app-grid.c:264
+#: src/app-grid.c:261
msgid "Show All Apps"
msgstr "Показати усі програми"
-#: src/app-grid.c:267
+#: src/app-grid.c:264
msgid "Show Only Mobile Friendly Apps"
msgstr "Показати лише програми для мобільних"
-#: src/audio-manager.c:74
-msgid "Phone Shell Volume Control"
-msgstr "Керування гучністю оболонки телефону"
-
#. Translators: a battery level in percent
#: src/bt-device-row.c:81
#, c-format
@@ -298,11 +294,11 @@ msgid "No"
msgstr "Ні"
#. give visual feedback on error
-#: src/lockscreen.c:396 src/ui/lockscreen.ui:282
+#: src/lockscreen.c:313 src/ui/lockscreen.ui:282
msgid "Enter Passcode"
msgstr "Уведіть пароль"
-#: src/lockscreen.c:1036
+#: src/lockscreen.c:956
msgid "Checking…"
msgstr "Звіряю…"
@@ -334,27 +330,27 @@ msgid "Screenshot from %s%s.png"
msgstr "Знімок вікна %s%s.png"
#. Translators: Used when the title of a song is unknown
-#: src/media-player.c:691 src/ui/media-player.ui:208
+#: src/media-player.c:690 src/ui/media-player.ui:208
msgid "Unknown Title"
msgstr "Невідома назва"
#. Translators: Used when the artist of a song is unknown
-#: src/media-player.c:699 src/ui/media-player.ui:196
+#: src/media-player.c:698 src/ui/media-player.ui:196
msgid "Unknown Artist"
msgstr "Невідомий виконавець"
-#: src/monitor-manager.c:129
+#: src/monitor-manager.c:128
msgid "Built-in display"
msgstr "Вбудований дисплей"
-#: src/monitor-manager.c:147
+#: src/monitor-manager.c:146
#, c-format
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
-#: src/monitor-manager.c:154
+#: src/monitor-manager.c:153
#, c-format
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
@@ -363,7 +359,7 @@ msgid "%s %s"
msgstr "%s %s"
#. Translators: An unknown monitor type
-#: src/monitor-manager.c:163
+#: src/monitor-manager.c:162
msgid "Unknown"
msgstr "Нетиповий"
@@ -499,17 +495,17 @@ msgstr[0] "Майже %dр."
msgstr[1] "Майже %dр."
msgstr[2] "Майже %dр."
-#: src/polkit-auth-agent.c:275
+#: src/polkit-auth-agent.c:271
msgid "Authentication dialog was dismissed by the user"
msgstr "Користувач перервав діалог автентифікації"
-#: src/polkit-auth-prompt.c:382 src/ui/gtk-mount-prompt.ui:17
-#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:44
+#: src/polkit-auth-prompt.c:275 src/ui/gtk-mount-prompt.ui:17
+#: src/ui/network-auth-prompt.ui:69 src/ui/polkit-auth-prompt.ui:45
#: src/ui/system-prompt.ui:28
msgid "Password:"
msgstr "Пароль:"
-#: src/polkit-auth-prompt.c:429
+#: src/polkit-auth-prompt.c:322
msgid "Sorry, that didn’t work. Please try again."
msgstr "На жаль, це не спрацювало. Будь ласка, спробуйте ще."
@@ -540,6 +536,10 @@ msgstr "Натисніть клавішу «Esc», щоб закрити"
msgid "Running '%s' failed"
msgstr "Не вдалося запустити «%s»"
+#: src/settings/audio-settings.c:376
+msgid "Phone Shell Volume Control"
+msgstr "Керування гучністю оболонки телефону"
+
#: src/system-prompt.c:376
msgid "Passwords do not match."
msgstr "Паролі не збігаються."
@@ -548,7 +548,7 @@ msgstr "Паролі не збігаються."
msgid "Password cannot be blank"
msgstr "Пароль не може бути порожнім"
-#: src/torch-info.c:84
+#: src/torch-info.c:80
msgid "Torch"
msgstr "Факел"
@@ -654,7 +654,7 @@ msgstr "Відгук"
msgid "Do not disturb"
msgstr "Не турбувати"
-#: src/ui/feedback-status-page.ui:53
+#: src/ui/feedback-status-page.ui:52
msgid "Feedback Settings"
msgstr "Параметри відгуку"
@@ -696,7 +696,7 @@ msgstr "_Скасувати"
msgid "C_onnect"
msgstr "З'_єднатися"
-#: src/ui/polkit-auth-prompt.ui:96
+#: src/ui/polkit-auth-prompt.ui:97
msgid "Authenticate"
msgstr "Автентифікуватися"
@@ -753,7 +753,7 @@ msgid "Wi-Fi"
msgstr "Wi-Fi"
#: src/ui/wifi-status-page.ui:89
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:85
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:73
msgid "Wi-Fi Settings"
msgstr "Параметри Wi-Fi"
@@ -824,15 +824,10 @@ msgstr "❙"
msgid "Caffeine timers"
msgstr "Таймери caffeine"
-#: plugins/caffeine-quick-setting/qs.ui:38
+#: plugins/caffeine-quick-setting/qs.ui:37
msgid "No caffeine intervals"
msgstr "Немає інтервалів caffeine"
-#: plugins/caffeine-quick-setting/qs.ui:55
-#| msgid "Caffeine Quick Setting"
-msgid "Caffeine Settings"
-msgstr "Параметри Caffeine"
-
#: plugins/caffeine-quick-setting/prefs/caffeine-quick-setting-prefs.c:253
#: plugins/caffeine-quick-setting/prefs/prefs.ui:171
msgid "No timeout (∞)"
@@ -1194,7 +1189,7 @@ msgstr "Завершується"
msgid "Untitled event"
msgstr "Подія без назви"
-#: plugins/upcoming-events/upcoming-events.c:408
+#: plugins/upcoming-events/upcoming-events.c:372
#, c-format
msgid "No events for the next %d days"
msgstr "Немає подій протягом наступних %d днів"
@@ -1232,18 +1227,20 @@ msgid "%d%%"
msgstr "%d%%"
#: plugins/wifi-hotspot-quick-setting/status-page.ui:6
+#| msgid "No Wi-Fi Hotspots"
msgid "Wi-Fi Hotspot"
msgstr "Хот-спот Wi-Fi"
-#: plugins/wifi-hotspot-quick-setting/status-page.ui:71
+#: plugins/wifi-hotspot-quick-setting/status-page.ui:59
+#| msgid "Turn Off"
msgid "Turn On"
msgstr "Увімкнути"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:80
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:76
msgid "Hotspot On"
msgstr "Точку доступу увімкнено"
-#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:82
+#: plugins/wifi-hotspot-quick-setting/wifi-hotspot-quick-setting.c:78
msgid "Hotspot Off"
msgstr "Точку доступу вимкнено"
diff --git a/phosh/run.in b/phosh/run.in
index 091d4fb0e..144edfc5d 100755
--- a/phosh/run.in
+++ b/phosh/run.in
@@ -23,7 +23,14 @@ elif [ "${PHOSH_AUTO_GDB}" = 1 ]; then
WRAPPER="gdb -batch -ex run -ex bt --args"
fi
-GSETTINGS_SCHEMA_DIR=${ABS_BUILDDIR}/data:@PLUGIN_SCHEMA_PATH@:${GSETTINGS_SCHEMA_DIR}
+SCHEMAS=(
+ "${ABS_BUILDDIR}/data:"
+ "${ABS_BUILDDIR}/plugins/launcher-box:"
+ "${ABS_BUILDDIR}/plugins/pomodoro-quick-setting"
+ "${ABS_BUILDDIR}/plugins/ticket-box:"
+ "${ABS_BUILDDIR}/plugins/upcoming-events:"
+ )
+GSETTINGS_SCHEMA_DIR=$(echo "${SCHEMAS[*]}" | tr -d ' ')${GSETTINGS_SCHEMA_DIR}
export GSETTINGS_SCHEMA_DIR
[ -n "${G_MESSAGES_DEBUG}" ] || G_MESSAGES_DEBUG=all
diff --git a/phosh/src/activity.c b/phosh/src/activity.c
index 7cc4055b9..817e0d170 100644
--- a/phosh/src/activity.c
+++ b/phosh/src/activity.c
@@ -17,6 +17,8 @@
#include "util.h"
#include "app-grid-button.h"
+#include
+
/**
* PhoshActivity:
*
@@ -39,14 +41,12 @@ static guint signals[N_SIGNALS] = { 0 };
enum {
PROP_0,
- PROP_APP_INFO,
PROP_APP_ID,
PROP_PARENT_APP_ID,
PROP_MAXIMIZED,
PROP_FULLSCREEN,
PROP_WIN_WIDTH,
PROP_WIN_HEIGHT,
- PROP_HAS_THUMBNAIL,
LAST_PROP,
};
static GParamSpec *props[LAST_PROP];
@@ -59,9 +59,8 @@ typedef struct {
GtkWidget *revealer_unfullscreen;
GtkWidget *btn_close;
GtkWidget *btn_unfullscreen;
- GtkWidget *preview;
+ GtkPicture *preview;
GtkWidget *button;
- GtkWidget *spinner;
gboolean maximized;
gboolean fullscreen;
@@ -71,22 +70,19 @@ typedef struct {
char *app_id;
char *parent_app_id;
- cairo_surface_t *surface;
- PhoshThumbnail *thumbnail;
+ GdkTexture *texture;
gboolean hovering;
guint remove_timeout_id;
GtkAllocation allocation;
-
- GAppInfo *app_info;
} PhoshActivityPrivate;
struct _PhoshActivity {
- GtkEventBox parent;
+ GtkWidget parent;
};
-G_DEFINE_TYPE_WITH_PRIVATE (PhoshActivity, phosh_activity, GTK_TYPE_EVENT_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE(PhoshActivity, phosh_activity, GTK_TYPE_WIDGET)
static void
@@ -139,9 +135,6 @@ phosh_activity_set_property (GObject *object,
PhoshActivityPrivate *priv = phosh_activity_get_instance_private (self);
switch (property_id) {
- case PROP_APP_INFO:
- g_set_object (&priv->app_info, g_value_get_object (value));
- break;
case PROP_APP_ID:
g_free (priv->app_id);
priv->app_id = g_value_dup_string (value);
@@ -180,11 +173,8 @@ phosh_activity_get_property (GObject *object,
PhoshActivityPrivate *priv = phosh_activity_get_instance_private (self);
switch (property_id) {
- case PROP_APP_INFO:
- g_value_set_object (value, phosh_activity_get_app_info (self));
- break;
case PROP_APP_ID:
- g_value_set_string (value, phosh_activity_get_app_id (self));
+ g_value_set_string (value, priv->app_id);
break;
case PROP_PARENT_APP_ID:
g_value_set_string (value, priv->parent_app_id);
@@ -201,9 +191,6 @@ phosh_activity_get_property (GObject *object,
case PROP_WIN_HEIGHT:
g_value_set_int (value, priv->win_height);
break;
- case PROP_HAS_THUMBNAIL:
- g_value_set_boolean (value, phosh_activity_get_has_thumbnail (self));
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -270,86 +257,21 @@ get_scale (PhoshActivity *self)
PhoshActivityPrivate *priv;
priv = phosh_activity_get_instance_private (self);
- width = gtk_widget_get_allocated_width (priv->preview);
- height = gtk_widget_get_allocated_height (priv->preview);
+ width = gtk_widget_get_width (GTK_WIDGET (priv->preview));
+ height = gtk_widget_get_height (GTK_WIDGET (priv->preview));
- if (!priv->surface)
+ if (!priv->texture)
return 1.0;
- image_width = cairo_image_surface_get_width (priv->surface);
- image_height = cairo_image_surface_get_height (priv->surface);
-
- scale = MIN (width / (float)image_width, height / (float)image_height);
-
- return scale;
-}
-
-
-static void
-draw_rounded_rect (cairo_t *ctx, double x, double y, double width, double height, double radius)
-{
- cairo_new_sub_path (ctx);
- cairo_arc (ctx, x + width - radius, y + radius, radius, -0.5 * M_PI, 0);
- cairo_arc (ctx, x + width - radius, y + height - radius, radius, 0, 0.5 * M_PI);
- cairo_arc (ctx, x + radius, y + height - radius, radius, 0.5 * M_PI, M_PI);
- cairo_arc (ctx, x + radius, y + radius, radius, M_PI, 1.5 * M_PI);
- cairo_close_path (ctx);
-}
-
-
-static gboolean
-draw_cb (PhoshActivity *self, cairo_t *cairo, GtkDrawingArea *area)
-{
- int width, height, image_width, image_height, border_radius, x, y = 0;
- float scale;
- PhoshActivityPrivate *priv;
- GtkStyleContext *context;
-
- g_return_val_if_fail (PHOSH_IS_ACTIVITY (self), FALSE);
- g_return_val_if_fail (GTK_IS_DRAWING_AREA (area), FALSE);
-
- priv = phosh_activity_get_instance_private (self);
+ image_width = gdk_texture_get_width (priv->texture);
+ image_height = gdk_texture_get_height (priv->texture);
- context = gtk_widget_get_style_context (GTK_WIDGET (area));
- width = gtk_widget_get_allocated_width (GTK_WIDGET (area));
- height = gtk_widget_get_allocated_height (GTK_WIDGET (area));
+ scale = width / (float)image_width;
- gtk_render_background (context, cairo, 0, 0, width, height);
-
- if (!priv->surface)
- return FALSE;
-
- image_width = cairo_image_surface_get_width (priv->surface);
- image_height = cairo_image_surface_get_height (priv->surface);
-
- scale = get_scale (self);
- cairo_scale (cairo, scale, scale);
-
- x = (width - image_width * scale) / 2.0 / scale;
-
- gtk_style_context_get (context,
- gtk_style_context_get_state (context),
- GTK_STYLE_PROPERTY_BORDER_RADIUS, &border_radius,
- NULL);
- draw_rounded_rect (cairo, x, y, image_width, image_height, border_radius);
- cairo_set_source_surface (cairo, priv->surface, x, y);
- cairo_fill (cairo);
-
- return FALSE;
-}
+ if (height / (float)image_height < scale)
+ scale = height / (float)image_height;
-
-static void
-size_allocate_cb (PhoshActivity *self, GtkAllocation *alloc, GtkDrawingArea *area)
-{
- PhoshActivityPrivate *priv = phosh_activity_get_instance_private (self);
- gboolean changed = alloc->width != priv->allocation.width ||
- alloc->height != priv->allocation.height;
-
- priv->allocation = *alloc;
-
- if (changed)
- g_signal_emit (self, signals[RESIZED], 0, alloc);
+ return scale;
}
@@ -358,30 +280,26 @@ phosh_activity_constructed (GObject *object)
{
PhoshActivity *self = PHOSH_ACTIVITY (object);
PhoshActivityPrivate *priv = phosh_activity_get_instance_private (self);
+ g_autoptr (GDesktopAppInfo) app_info = NULL;
GIcon *icon = NULL;
- if (priv->app_info == NULL)
- priv->app_info = G_APP_INFO (phosh_get_desktop_app_info_for_app_id (priv->app_id));
-
- if (priv->app_info)
- icon = g_app_info_get_icon (priv->app_info);
+ app_info = phosh_get_desktop_app_info_for_app_id (priv->app_id);
+ if (app_info)
+ icon = g_app_info_get_icon (G_APP_INFO (app_info));
if (!icon && priv->parent_app_id) {
- priv->app_info = G_APP_INFO (phosh_get_desktop_app_info_for_app_id (priv->parent_app_id));
- if (priv->app_info)
- icon = g_app_info_get_icon (priv->app_info);
+ app_info = phosh_get_desktop_app_info_for_app_id (priv->parent_app_id);
+ if (app_info)
+ icon = g_app_info_get_icon (G_APP_INFO (app_info));
}
if (icon) {
- gtk_image_set_from_gicon (GTK_IMAGE (priv->icon), icon, ACTIVITY_ICON_SIZE);
+ gtk_image_set_from_gicon (GTK_IMAGE (priv->icon), icon);
} else {
- gtk_image_set_from_icon_name (GTK_IMAGE (priv->icon),
- PHOSH_APP_UNKNOWN_ICON,
- ACTIVITY_ICON_SIZE);
+ gtk_image_set_from_icon_name (GTK_IMAGE (priv->icon), PHOSH_APP_UNKNOWN_ICON);
+ gtk_widget_add_css_class (GTK_WIDGET (self), "phosh-empty");
}
- phosh_util_toggle_style_class (GTK_WIDGET (self), "phosh-empty", TRUE);
-
G_OBJECT_CLASS (phosh_activity_parent_class)->constructed (object);
}
@@ -392,14 +310,10 @@ phosh_activity_dispose (GObject *object)
PhoshActivity *self = PHOSH_ACTIVITY (object);
PhoshActivityPrivate *priv = phosh_activity_get_instance_private (self);
- g_clear_pointer (&priv->surface, cairo_surface_destroy);
- g_clear_object (&priv->thumbnail);
- g_clear_object (&priv->app_info);
+ g_clear_object (&priv->texture);
+ g_clear_handle_id (&priv->remove_timeout_id, g_source_remove);
- if (priv->remove_timeout_id) {
- g_source_remove (priv->remove_timeout_id);
- priv->remove_timeout_id = 0;
- }
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_ACTIVITY);
G_OBJECT_CLASS (phosh_activity_parent_class)->dispose (object);
}
@@ -431,6 +345,7 @@ phosh_activity_get_preferred_height (GtkWidget *widget,
int *nat)
{
PhoshActivityPrivate *priv;
+ GtkWidget *child;
int smallest = 0;
int box_smallest = 0;
int parent_nat;
@@ -438,10 +353,10 @@ phosh_activity_get_preferred_height (GtkWidget *widget,
g_return_if_fail (PHOSH_IS_ACTIVITY (widget));
priv = phosh_activity_get_instance_private (PHOSH_ACTIVITY (widget));
- GTK_WIDGET_CLASS (phosh_activity_parent_class)->get_preferred_height (widget,
- &smallest,
- &parent_nat);
- gtk_widget_get_preferred_width (priv->box, &box_smallest, NULL);
+ child = gtk_widget_get_first_child (widget);
+ if (child)
+ gtk_widget_measure (child, GTK_ORIENTATION_VERTICAL, -1, &smallest, &parent_nat, NULL, NULL);
+ gtk_widget_measure (priv->box, GTK_ORIENTATION_HORIZONTAL, -1, &box_smallest, NULL, NULL, NULL);
smallest = MAX (smallest, box_smallest);
@@ -453,6 +368,43 @@ phosh_activity_get_preferred_height (GtkWidget *widget,
}
+static void
+phosh_activity_get_preferred_width (GtkWidget *widget,
+ int *min,
+ int *nat)
+{
+ PhoshActivityPrivate *priv;
+ GtkWidget *child;
+ int smallest = 0;
+ int box_smallest = 0;
+ int size;
+ int parent_nat;
+ int margin_start, margin_end;
+
+ g_return_if_fail (PHOSH_IS_ACTIVITY (widget));
+ priv = phosh_activity_get_instance_private (PHOSH_ACTIVITY (widget));
+
+ child = gtk_widget_get_first_child (widget);
+ if (child)
+ gtk_widget_measure (child, GTK_ORIENTATION_HORIZONTAL, -1, &smallest, &parent_nat, NULL, NULL);
+
+ gtk_widget_measure (priv->box, GTK_ORIENTATION_HORIZONTAL, -1, &box_smallest, NULL, NULL, NULL);
+
+ smallest = MAX (smallest, box_smallest);
+
+ margin_start = gtk_widget_get_margin_start (GTK_WIDGET (priv->preview));
+ margin_end = gtk_widget_get_margin_end (GTK_WIDGET (priv->preview));
+
+ size = smallest + margin_start + margin_end;
+
+ if (min)
+ *min = size;
+
+ if (nat)
+ *nat = size;
+}
+
+
static void
phosh_activity_get_preferred_width_for_height (GtkWidget *widget,
int height,
@@ -460,6 +412,7 @@ phosh_activity_get_preferred_width_for_height (GtkWidget *widget,
int *nat)
{
PhoshActivityPrivate *priv;
+ GtkWidget *child;
int smallest = 0;
int box_smallest = 0;
int size;
@@ -470,18 +423,18 @@ phosh_activity_get_preferred_width_for_height (GtkWidget *widget,
g_return_if_fail (PHOSH_IS_ACTIVITY (widget));
priv = phosh_activity_get_instance_private (PHOSH_ACTIVITY (widget));
- GTK_WIDGET_CLASS (phosh_activity_parent_class)->get_preferred_width_for_height (widget,
- height,
- &smallest,
- &parent_nat);
- gtk_widget_get_preferred_width_for_height (priv->box, height, &box_smallest, NULL);
+ child = gtk_widget_get_first_child (widget);
+ if (child)
+ gtk_widget_measure (child, GTK_ORIENTATION_HORIZONTAL, height, &smallest, &parent_nat, NULL, NULL);
+
+ gtk_widget_measure (priv->box, GTK_ORIENTATION_HORIZONTAL, height, &box_smallest, NULL, NULL, NULL);
smallest = MAX (smallest, box_smallest);
- margin_start = gtk_widget_get_margin_start (priv->preview);
- margin_end = gtk_widget_get_margin_end (priv->preview);
- margin_top = gtk_widget_get_margin_top (priv->preview);
- margin_bottom = gtk_widget_get_margin_bottom (priv->preview);
+ margin_start = gtk_widget_get_margin_start (GTK_WIDGET (priv->preview));
+ margin_end = gtk_widget_get_margin_end (GTK_WIDGET (priv->preview));
+ margin_top = gtk_widget_get_margin_top (GTK_WIDGET (priv->preview));
+ margin_bottom = gtk_widget_get_margin_bottom (GTK_WIDGET (priv->preview));
aspect_ratio = (double) priv->win_width / priv->win_height;
size = MAX (smallest,
@@ -505,15 +458,54 @@ phosh_activity_get_preferred_height_for_width (GtkWidget *widget,
}
+static void
+phosh_activity_measure (GtkWidget *widget,
+ GtkOrientation orientation,
+ int for_size,
+ int *minimum,
+ int *natural,
+ int *minimum_baseline,
+ int *natural_baseline)
+{
+ if (orientation == GTK_ORIENTATION_HORIZONTAL && for_size != -1)
+ phosh_activity_get_preferred_width_for_height (widget, for_size, minimum, natural);
+ else if (orientation == GTK_ORIENTATION_HORIZONTAL && for_size == -1)
+ phosh_activity_get_preferred_width (widget, minimum, natural);
+ else if (orientation == GTK_ORIENTATION_VERTICAL && for_size != -1)
+ phosh_activity_get_preferred_height_for_width (widget, for_size, minimum, natural);
+ else if (orientation == GTK_ORIENTATION_VERTICAL && for_size == -1)
+ phosh_activity_get_preferred_height (widget, minimum, natural);
+ else
+ g_assert_not_reached ();
+}
+
+
+static void
+phosh_activity_size_allocate (GtkWidget *widget, int width, int height, int baseline)
+{
+ GtkWidget *child = gtk_widget_get_first_child (widget);
+ GtkAllocation allocation = {0, 0, width, height};
+ PhoshActivity *self = PHOSH_ACTIVITY (widget);
+ PhoshActivityPrivate *priv = phosh_activity_get_instance_private (self);
+ gboolean changed = width != priv->allocation.width || height != priv->allocation.height;
+
+ priv->allocation.width = width;
+ priv->allocation.height = height;
+
+ if (changed)
+ g_signal_emit (self, signals[RESIZED], 0, &priv->allocation);
+
+ if (child)
+ gtk_widget_size_allocate (child, &allocation, baseline);
+}
+
+
static void
set_hovering (PhoshActivity *self,
gboolean hovering)
{
PhoshActivityPrivate *priv = phosh_activity_get_instance_private (self);
- if (!phosh_activity_get_has_thumbnail (self))
- return;
-
if (hovering == priv->hovering)
return;
@@ -527,51 +519,49 @@ set_hovering (PhoshActivity *self,
}
-static gboolean
-phosh_activity_enter_notify_event (GtkWidget *widget,
- GdkEventCrossing *event)
+static void
+on_motion_enter (PhoshActivity *self,
+ double x,
+ double y,
+ GtkEventController *controller)
{
- if (event->window != gtk_widget_get_window (widget) ||
- event->detail == GDK_NOTIFY_INFERIOR)
- return GDK_EVENT_PROPAGATE;
-
/* enter-notify never happens on touch, so we don't need to check it */
- set_hovering (PHOSH_ACTIVITY (widget), TRUE);
-
- return GDK_EVENT_PROPAGATE;
+ set_hovering (self, TRUE);
}
-static gboolean
-phosh_activity_leave_notify_event (GtkWidget *widget,
- GdkEventCrossing *event)
+static void
+on_motion_leave (PhoshActivity *self,
+ double x,
+ double y,
+ GtkEventController *controller)
{
- if (event->window != gtk_widget_get_window (widget) ||
- event->detail == GDK_NOTIFY_INFERIOR)
- return GDK_EVENT_PROPAGATE;
-
- set_hovering (PHOSH_ACTIVITY (widget), FALSE);
-
- return GDK_EVENT_PROPAGATE;
+ set_hovering (self, FALSE);
}
-static gboolean
-phosh_activity_motion_notify_event (GtkWidget *widget,
- GdkEventMotion *event)
+static void
+on_motion (PhoshActivity *self,
+ double x,
+ double y,
+ GtkEventController *controller)
{
- GdkDevice *source_device = gdk_event_get_source_device ((GdkEvent *) event);
- GdkInputSource input_source = gdk_device_get_source (source_device);
+ GdkDevice *device = gtk_event_controller_get_current_event_device (controller);
+ GdkInputSource source = gdk_device_get_source (device);
- if (input_source != GDK_SOURCE_TOUCHSCREEN)
- set_hovering (PHOSH_ACTIVITY (widget), TRUE);
+ if (source == GDK_SOURCE_TOUCHSCREEN)
+ return;
- return GDK_EVENT_PROPAGATE;
+ set_hovering (self, TRUE);
}
static gboolean
-phosh_activity_key_press_event (GtkWidget *self, GdkEventKey *event)
+on_key_pressed (GtkWidget *self,
+ guint keyval,
+ guint keycode,
+ GdkModifierType *state,
+ GtkEventController *controller)
{
gboolean handled = FALSE;
PhoshActivityPrivate *priv;
@@ -579,9 +569,9 @@ phosh_activity_key_press_event (GtkWidget *self, GdkEventKey *event)
g_return_val_if_fail (PHOSH_IS_ACTIVITY (self), FALSE);
priv = phosh_activity_get_instance_private (PHOSH_ACTIVITY (self));
- switch (event->keyval) {
+ switch (keyval) {
case GDK_KEY_Return:
- gtk_button_clicked (GTK_BUTTON (priv->button));
+ g_signal_emit_by_name (priv->button, "clicked");
handled = TRUE;
break;
default:
@@ -616,24 +606,10 @@ phosh_activity_class_init (PhoshActivityClass *klass)
object_class->get_property = phosh_activity_get_property;
widget_class->get_request_mode = phosh_activity_get_request_mode;
- widget_class->get_preferred_height = phosh_activity_get_preferred_height;
- widget_class->get_preferred_height_for_width = phosh_activity_get_preferred_height_for_width;
- widget_class->get_preferred_width_for_height = phosh_activity_get_preferred_width_for_height;
- widget_class->enter_notify_event = phosh_activity_enter_notify_event;
- widget_class->leave_notify_event = phosh_activity_leave_notify_event;
- widget_class->motion_notify_event = phosh_activity_motion_notify_event;
- widget_class->key_press_event = phosh_activity_key_press_event;
+ widget_class->measure = phosh_activity_measure;
+ widget_class->size_allocate = phosh_activity_size_allocate;
widget_class->unmap = phosh_activity_unmap;
- /**
- * PhoshActivity:app-info:
- *
- * The app-info of the activity
- */
- props[PROP_APP_INFO] =
- g_param_spec_object ("app-info", "", "",
- G_TYPE_APP_INFO,
- G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* PhoshActivity:app-id:
*
@@ -642,7 +618,7 @@ phosh_activity_class_init (PhoshActivityClass *klass)
props[PROP_APP_ID] =
g_param_spec_string ("app-id", "", "",
"",
- G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* PhoshActivity:parent-app-id:
*
@@ -651,7 +627,7 @@ phosh_activity_class_init (PhoshActivityClass *klass)
props[PROP_PARENT_APP_ID] =
g_param_spec_string ("parent-app-id", "", "",
NULL,
- G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
/**
* PhoshActivity:maximized:
*
@@ -688,15 +664,6 @@ phosh_activity_class_init (PhoshActivityClass *klass)
g_param_spec_int ("win-height", "", "",
0, G_MAXINT, 300,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- /**
- * PhoshActivity:has-thumbnail:
- *
- * Whether the activity is backed by a thumbnail
- */
- props[PROP_HAS_THUMBNAIL] =
- g_param_spec_boolean ("has-thumbnail", "", "",
- FALSE,
- G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (object_class, LAST_PROP, props);
@@ -749,13 +716,14 @@ phosh_activity_class_init (PhoshActivityClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, PhoshActivity, box);
gtk_widget_class_bind_template_child_private (widget_class, PhoshActivity, revealer_close);
gtk_widget_class_bind_template_child_private (widget_class, PhoshActivity, revealer_unfullscreen);
- gtk_widget_class_bind_template_child_private (widget_class, PhoshActivity, spinner);
gtk_widget_class_bind_template_callback (widget_class, clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, closed_cb);
- gtk_widget_class_bind_template_callback (widget_class, draw_cb);
gtk_widget_class_bind_template_callback (widget_class, on_unfullscreen_clicked);
gtk_widget_class_bind_template_callback (widget_class, removed_cb);
- gtk_widget_class_bind_template_callback (widget_class, size_allocate_cb);
+ gtk_widget_class_bind_template_callback (widget_class, on_key_pressed);
+ gtk_widget_class_bind_template_callback (widget_class, on_motion_enter);
+ gtk_widget_class_bind_template_callback (widget_class, on_motion_leave);
+ gtk_widget_class_bind_template_callback (widget_class, on_motion);
gtk_widget_class_set_css_name (widget_class, "phosh-activity");
}
@@ -790,19 +758,13 @@ phosh_activity_get_app_id (PhoshActivity *self)
g_return_val_if_fail (PHOSH_IS_ACTIVITY (self), NULL);
priv = phosh_activity_get_instance_private (self);
- if (priv->app_id)
- return priv->app_id;
-
- if (priv->app_info)
- return g_app_info_get_id (priv->app_info);
-
- return NULL;
+ return priv->app_id;
}
/**
* phosh_activity_set_thumbnail:
* @self: the activity
- * @thumbnail:(transfer full): the thumbnail
+ * @thumbnail:(transfer none): the thumbnail
*
* Sets the given thumbnail
*/
@@ -812,37 +774,31 @@ phosh_activity_set_thumbnail (PhoshActivity *self, PhoshThumbnail *thumbnail)
PhoshActivityPrivate *priv;
gpointer data;
guint w, width, height, stride, margin;
+ gsize size;
+ g_autoptr (GBytes) bytes = NULL;
float scale;
- gboolean has_thumbnail;
g_return_if_fail (PHOSH_IS_ACTIVITY (self));
priv = phosh_activity_get_instance_private (self);
- has_thumbnail = !!priv->thumbnail;
- g_clear_object (&priv->thumbnail);
- priv->thumbnail = thumbnail;
-
data = phosh_thumbnail_get_image (thumbnail);
phosh_thumbnail_get_size (thumbnail, &width, &height, &stride);
- g_clear_pointer (&priv->surface, cairo_surface_destroy);
- priv->surface = cairo_image_surface_create_for_data (data,
- CAIRO_FORMAT_ARGB32,
- width, height, stride);
+ size = stride * height;
+ /* TODO: pass shm directly */
+ bytes = g_bytes_new_take (g_memdup2 (data, size), size);
+ g_clear_object (&priv->texture);
+ priv->texture = GDK_TEXTURE (gdk_memory_texture_new (width, height, GDK_MEMORY_A8R8G8B8, bytes, stride));
+ gtk_picture_set_paintable (priv->preview, GDK_PAINTABLE (priv->texture));
phosh_util_toggle_style_class (GTK_WIDGET (self), "phosh-empty", FALSE);
/* Make sure buttons are over the thumbnail */
- w = gtk_widget_get_allocated_width (GTK_WIDGET (self));
+ w = gtk_widget_get_width (GTK_WIDGET (self));
scale = get_scale (self);
margin = w ? (w - (width * scale)) / 2 : 0;
gtk_widget_set_margin_start (priv->btn_unfullscreen, margin);
gtk_widget_set_margin_end (priv->btn_close, margin);
-
- gtk_widget_queue_draw (GTK_WIDGET (self));
-
- if (has_thumbnail != !!priv->thumbnail)
- g_object_notify_by_pspec (G_OBJECT (self), props[PROP_HAS_THUMBNAIL]);
}
void
@@ -856,25 +812,3 @@ phosh_activity_get_thumbnail_allocation (PhoshActivity *self, GtkAllocation *all
*allocation = priv->allocation;
}
-
-
-gboolean
-phosh_activity_get_has_thumbnail (PhoshActivity *self)
-{
- PhoshActivityPrivate *priv = phosh_activity_get_instance_private (self);
-
- g_return_val_if_fail (PHOSH_IS_ACTIVITY (self), FALSE);
-
- return !!priv->thumbnail;
-}
-
-
-GAppInfo *
-phosh_activity_get_app_info (PhoshActivity *self)
-{
- PhoshActivityPrivate *priv = phosh_activity_get_instance_private (self);
-
- g_return_val_if_fail (PHOSH_IS_ACTIVITY (self), NULL);
-
- return priv->app_info;
-}
diff --git a/phosh/src/activity.h b/phosh/src/activity.h
index bfc6921d6..51ad9a815 100644
--- a/phosh/src/activity.h
+++ b/phosh/src/activity.h
@@ -5,15 +5,12 @@
*/
#pragma once
-#include "thumbnail.h"
-
-#include
-
#include
+#include "thumbnail.h"
-#define PHOSH_TYPE_ACTIVITY (phosh_activity_get_type ())
+#define PHOSH_TYPE_ACTIVITY (phosh_activity_get_type())
-G_DECLARE_FINAL_TYPE (PhoshActivity, phosh_activity, PHOSH, ACTIVITY, GtkEventBox)
+G_DECLARE_FINAL_TYPE (PhoshActivity, phosh_activity, PHOSH, ACTIVITY, GtkWidget)
GtkWidget *phosh_activity_new (const char *app_id);
const char *phosh_activity_get_app_id (PhoshActivity *self);
@@ -21,5 +18,3 @@ void phosh_activity_set_thumbnail (PhoshActivity *self,
PhoshThumbnail *thumbnail);
void phosh_activity_get_thumbnail_allocation (PhoshActivity *self,
GtkAllocation *allocation);
-gboolean phosh_activity_get_has_thumbnail (PhoshActivity *self);
-GAppInfo * phosh_activity_get_app_info (PhoshActivity *self);
diff --git a/phosh/src/animation.c b/phosh/src/animation.c
index 560d67a76..731d6409a 100644
--- a/phosh/src/animation.c
+++ b/phosh/src/animation.c
@@ -9,7 +9,7 @@
#include "phosh-config.h"
#include "animation.h"
-#include
+#include
G_DEFINE_BOXED_TYPE (PhoshAnimation, phosh_animation, phosh_animation_ref, phosh_animation_unref)
@@ -93,7 +93,7 @@ interpolate (PhoshAnimationType type, double t)
{
switch (type) {
case PHOSH_ANIMATION_TYPE_EASE_OUT_CUBIC:
- return hdy_ease_out_cubic (t);
+ return adw_easing_ease (ADW_EASE_OUT_CUBIC, t);
case PHOSH_ANIMATION_TYPE_EASE_IN_QUINTIC:
return ease_in_quintic (t);
@@ -220,7 +220,7 @@ phosh_animation_start (PhoshAnimation *self)
{
g_return_if_fail (self != NULL);
- if (!hdy_get_enable_animations (self->widget) ||
+ if (!adw_get_enable_animations (self->widget) ||
!gtk_widget_get_mapped (self->widget) ||
self->duration <= 0) {
set_value (self, self->value_to);
diff --git a/phosh/src/app-auth-prompt.c b/phosh/src/app-auth-prompt.c
index 19dadd320..655bdeb82 100644
--- a/phosh/src/app-auth-prompt.c
+++ b/phosh/src/app-auth-prompt.c
@@ -13,7 +13,7 @@
#include "app-auth-prompt.h"
#include "auth-prompt-option.h"
-#include
+#include
#include
/**
@@ -181,7 +181,7 @@ add_switch_option ( PhoshAppAuthPrompt *self,
GtkWidget *action_row_choice;
GtkWidget *switch_choice;
- action_row_choice = g_object_new (HDY_TYPE_ACTION_ROW,
+ action_row_choice = g_object_new (ADW_TYPE_ACTION_ROW,
"visible", TRUE,
"title", choice_label,
"activatable", TRUE,
@@ -189,23 +189,17 @@ add_switch_option ( PhoshAppAuthPrompt *self,
NULL);
g_object_set_data_full (G_OBJECT (action_row_choice), "choice-id", g_strdup (choice_id), g_free);
gtk_widget_set_visible (action_row_choice, TRUE);
- hdy_preferences_row_set_title (HDY_PREFERENCES_ROW (action_row_choice), choice_label);
+ adw_preferences_row_set_title (ADW_PREFERENCES_ROW (action_row_choice), choice_label);
switch_choice = g_object_new (GTK_TYPE_SWITCH,
"visible", TRUE,
"halign", GTK_ALIGN_CENTER,
"valign", GTK_ALIGN_CENTER,
NULL);
- hdy_action_row_set_activatable_widget (HDY_ACTION_ROW (action_row_choice), switch_choice);
- gtk_container_add (GTK_CONTAINER (action_row_choice), switch_choice);
+ adw_action_row_set_activatable_widget (ADW_ACTION_ROW (action_row_choice), switch_choice);
+ adw_action_row_add_suffix (ADW_ACTION_ROW (action_row_choice), switch_choice);
- gtk_container_add (GTK_CONTAINER (self->list_box_choices), action_row_choice);
-}
-
-static char *
-get_choice_option_name (gpointer item, gpointer unused) {
- PhoshAuthPromptOption *option = PHOSH_AUTH_PROMPT_OPTION (item);
- return g_strdup (phosh_auth_prompt_option_get_label (option));
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_choices), action_row_choice);
}
static void
@@ -221,11 +215,12 @@ add_combo_option (PhoshAppAuthPrompt *self,
char *option_label;
GListStore *store;
GtkWidget *combo_row_options;
+ g_autoptr (GtkExpression) expr = NULL;
- combo_row_options = hdy_combo_row_new ();
+ combo_row_options = adw_combo_row_new ();
g_object_set_data_full (G_OBJECT (combo_row_options), "choice-id", g_strdup (choice_id), g_free);
gtk_widget_set_visible (combo_row_options, TRUE);
- hdy_preferences_row_set_title (HDY_PREFERENCES_ROW (combo_row_options), choice_label);
+ adw_preferences_row_set_title (ADW_PREFERENCES_ROW (combo_row_options), choice_label);
gtk_list_box_row_set_activatable (GTK_LIST_BOX_ROW (combo_row_options), TRUE);
gtk_list_box_row_set_selectable (GTK_LIST_BOX_ROW (combo_row_options), FALSE);
@@ -243,13 +238,12 @@ add_combo_option (PhoshAppAuthPrompt *self,
g_object_unref (option);
index += 1;
}
- hdy_combo_row_bind_name_model (HDY_COMBO_ROW (combo_row_options),
- G_LIST_MODEL (store),
- get_choice_option_name,
- NULL,
- NULL);
- hdy_combo_row_set_selected_index (HDY_COMBO_ROW (combo_row_options), selected_index);
- gtk_container_add (GTK_CONTAINER (self->list_box_choices), combo_row_options);
+ expr = gtk_property_expression_new (G_TYPE_STRING, NULL, "label");
+ adw_combo_row_set_expression (ADW_COMBO_ROW (combo_row_options), expr);
+ adw_combo_row_set_model (ADW_COMBO_ROW (combo_row_options),
+ G_LIST_MODEL (store));
+ adw_combo_row_set_selected (ADW_COMBO_ROW (combo_row_options), selected_index);
+ gtk_list_box_append (GTK_LIST_BOX (self->list_box_choices), combo_row_options);
}
@@ -259,18 +253,18 @@ add_choice_to_gvariant (GtkWidget *child, gpointer builder)
GVariant *choice[2];
choice[0] = g_variant_new_string (g_object_get_data (G_OBJECT (child), "choice-id"));
- if (HDY_IS_COMBO_ROW (child)) {
- HdyComboRow *row = HDY_COMBO_ROW (child);
- GListModel *model = hdy_combo_row_get_model (row);
- gint selected_index = hdy_combo_row_get_selected_index (row);
+ if (ADW_IS_COMBO_ROW (child)) {
+ AdwComboRow *row = ADW_COMBO_ROW (child);
+ GListModel *model = adw_combo_row_get_model (row);
+ gint selected_index = adw_combo_row_get_selected (row);
PhoshAuthPromptOption *option = (PhoshAuthPromptOption*) g_list_model_get_item (model, selected_index);
if (option != NULL) {
choice[1] = g_variant_new_string (phosh_auth_prompt_option_get_id (option));
}
} else {
- HdyActionRow *row = HDY_ACTION_ROW (child);
- GtkSwitch *gtk_switch = GTK_SWITCH (hdy_action_row_get_activatable_widget (row));
+ AdwActionRow *row = ADW_ACTION_ROW (child);
+ GtkSwitch *gtk_switch = GTK_SWITCH (adw_action_row_get_activatable_widget (row));
choice[1] = g_variant_new_string (gtk_switch_get_state(gtk_switch) ? "true" : "false");
}
@@ -278,6 +272,15 @@ add_choice_to_gvariant (GtkWidget *child, gpointer builder)
}
+static void
+phosh_app_auth_prompt_dispose (GObject *obj)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (obj), PHOSH_TYPE_APP_AUTH_PROMPT);
+
+ G_OBJECT_CLASS (phosh_app_auth_prompt_parent_class)->dispose (obj);
+}
+
+
static void
phosh_app_auth_prompt_finalize (GObject *obj)
{
@@ -300,8 +303,6 @@ phosh_app_auth_prompt_constructed (GObject *object)
G_OBJECT_CLASS (phosh_app_auth_prompt_parent_class)->constructed (object);
- gtk_widget_grab_default (self->btn_grant);
-
if (self->choices != NULL) {
GVariantIter iter_choices;
char *choice_id;
@@ -339,6 +340,7 @@ phosh_app_auth_prompt_class_init (PhoshAppAuthPromptClass *klass)
object_class->get_property = phosh_app_auth_prompt_get_property;
object_class->set_property = phosh_app_auth_prompt_set_property;
object_class->constructed = phosh_app_auth_prompt_constructed;
+ object_class->dispose = phosh_app_auth_prompt_dispose;
object_class->finalize = phosh_app_auth_prompt_finalize;
props[PROP_ICON] =
@@ -466,13 +468,21 @@ phosh_app_auth_prompt_get_grant_access (GtkWidget *self)
GVariant* phosh_app_auth_prompt_get_selected_choices (GtkWidget *self)
{
GVariantBuilder builder;
+ guint i;
+ GtkListBoxRow *row;
+ GtkWidget *child;
g_return_val_if_fail (PHOSH_IS_APP_AUTH_PROMPT (self), NULL);
g_variant_builder_init (&builder, G_VARIANT_TYPE ("a(ss)"));
- gtk_container_foreach (
- GTK_CONTAINER ( PHOSH_APP_AUTH_PROMPT (self)->list_box_choices),
- add_choice_to_gvariant,
- &builder
- );
+
+ i = 0;
+ row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (PHOSH_APP_AUTH_PROMPT (self)->list_box_choices), i);
+ while (row != NULL) {
+ child = gtk_list_box_row_get_child (row);
+ add_choice_to_gvariant (child, &builder);
+ i += 1;
+ row = gtk_list_box_get_row_at_index (GTK_LIST_BOX (PHOSH_APP_AUTH_PROMPT (self)->list_box_choices), i);
+ }
+
return g_variant_builder_end (&builder);
}
diff --git a/phosh/src/app-grid-base-button.c b/phosh/src/app-grid-base-button.c
index bc6b31ac1..aa2f73df2 100644
--- a/phosh/src/app-grid-base-button.c
+++ b/phosh/src/app-grid-base-button.c
@@ -82,30 +82,33 @@ phosh_app_grid_base_button_get_property (GObject *object,
static void
-on_clicked_cb (PhoshAppGridBaseButton *self)
+phosh_app_grid_base_button_dispose (GObject *object)
{
- g_signal_emit_by_name (self, "activate", NULL);
+ PhoshAppGridBaseButton *self = PHOSH_APP_GRID_BASE_BUTTON (object);
+
+ phosh_app_grid_base_button_set_child (self, NULL);
+
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_APP_GRID_BASE_BUTTON);
+
+ G_OBJECT_CLASS (phosh_app_grid_base_button_parent_class)->dispose (object);
}
static void
-phosh_app_grid_base_button_destroy (GtkWidget *widget)
+on_clicked_cb (PhoshAppGridBaseButton *self)
{
- PhoshAppGridBaseButton *self = PHOSH_APP_GRID_BASE_BUTTON (widget);
-
- phosh_app_grid_base_button_set_child (self, NULL);
-
- GTK_WIDGET_CLASS (phosh_app_grid_base_button_parent_class)->destroy (widget);
+ g_signal_emit_by_name (self, "activate", NULL);
}
-static void
+static gboolean
phosh_app_grid_base_button_grab_focus (GtkWidget *widget)
{
PhoshAppGridBaseButton *self = PHOSH_APP_GRID_BASE_BUTTON (widget);
PhoshAppGridBaseButtonPrivate *priv = phosh_app_grid_base_button_get_instance_private (self);
gtk_widget_grab_focus (priv->button);
+ return TRUE;
}
@@ -117,8 +120,8 @@ phosh_app_grid_base_button_class_init (PhoshAppGridBaseButtonClass *klass)
object_class->set_property = phosh_app_grid_base_button_set_property;
object_class->get_property = phosh_app_grid_base_button_get_property;
+ object_class->dispose = phosh_app_grid_base_button_dispose;
- widget_class->destroy = phosh_app_grid_base_button_destroy;
widget_class->grab_focus = phosh_app_grid_base_button_grab_focus;
/**
@@ -216,14 +219,12 @@ phosh_app_grid_base_button_set_child (PhoshAppGridBaseButton *self, GtkWidget *c
return;
if (priv->child)
- gtk_container_remove (GTK_CONTAINER (priv->box), priv->child);
+ gtk_box_remove (priv->box, priv->child);
priv->child = child;
- if (priv->child) {
- gtk_box_pack_start (priv->box, priv->child, FALSE, FALSE, 0);
- gtk_box_reorder_child (priv->box, priv->child, 0);
- }
+ if (priv->child)
+ gtk_box_prepend (priv->box, priv->child);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_CHILD]);
}
diff --git a/phosh/src/app-grid-button.c b/phosh/src/app-grid-button.c
index 9c9ced2f5..eda38fdef 100644
--- a/phosh/src/app-grid-button.c
+++ b/phosh/src/app-grid-button.c
@@ -115,6 +115,20 @@ phosh_app_grid_button_get_property (GObject *object,
}
+static void
+phosh_app_grid_button_dispose (GObject *object)
+{
+ PhoshAppGridButton *self = PHOSH_APP_GRID_BUTTON (object);
+ PhoshAppGridButtonPrivate *priv = phosh_app_grid_button_get_instance_private (self);
+
+ gtk_widget_unparent (priv->popover);
+
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_APP_GRID_BUTTON);
+
+ G_OBJECT_CLASS (phosh_app_grid_button_parent_class)->dispose (object);
+}
+
+
static void
phosh_app_grid_button_finalize (GObject *object)
{
@@ -190,7 +204,7 @@ static void
on_right_pressed (GtkWidget *self, int n_press, double x, double y, GtkGesture *gesture)
{
const GdkEvent *event = gtk_gesture_get_last_event (gesture, NULL);
- if (gdk_event_triggers_context_menu (event))
+ if (gdk_event_triggers_context_menu ((GdkEvent *) event))
context_menu (self, (GdkEvent *) event);
}
@@ -223,6 +237,7 @@ phosh_app_grid_button_class_init (PhoshAppGridButtonClass *klass)
object_class->set_property = phosh_app_grid_button_set_property;
object_class->get_property = phosh_app_grid_button_get_property;
+ object_class->dispose = phosh_app_grid_button_dispose;
object_class->finalize = phosh_app_grid_button_finalize;
props[PROP_APP_INFO] =
@@ -549,9 +564,9 @@ phosh_app_grid_button_init (PhoshAppGridButton *self)
gtk_widget_init_template (GTK_WIDGET (self));
- gtk_popover_bind_model (GTK_POPOVER (priv->popover),
- G_MENU_MODEL (priv->menu),
- NULL);
+ gtk_popover_menu_set_menu_model (GTK_POPOVER_MENU (priv->popover),
+ G_MENU_MODEL (priv->menu));
+ gtk_widget_set_parent (priv->popover, GTK_WIDGET (self));
}
@@ -646,13 +661,13 @@ phosh_app_grid_button_set_app_info (PhoshAppGridButton *self,
icon = g_app_info_get_icon (priv->info);
if (G_UNLIKELY (icon == NULL)) {
- gtk_image_set_from_icon_name (GTK_IMAGE (priv->icon), PHOSH_APP_UNKNOWN_ICON, -1);
+ gtk_image_set_from_icon_name (GTK_IMAGE (priv->icon), PHOSH_APP_UNKNOWN_ICON);
} else {
if (G_IS_THEMED_ICON (icon)) {
g_themed_icon_append_name (G_THEMED_ICON (icon),
PHOSH_APP_UNKNOWN_ICON);
}
- gtk_image_set_from_gicon (GTK_IMAGE (priv->icon), icon, -1);
+ gtk_image_set_from_gicon (GTK_IMAGE (priv->icon), icon);
}
gtk_widget_set_sensitive (GTK_WIDGET (self), TRUE);
@@ -692,7 +707,7 @@ phosh_app_grid_button_set_app_info (PhoshAppGridButton *self,
}
} else {
phosh_app_grid_base_button_set_label (PHOSH_APP_GRID_BASE_BUTTON (self), _("Application"));
- gtk_image_set_from_icon_name (GTK_IMAGE (priv->icon), PHOSH_APP_UNKNOWN_ICON, -1);
+ gtk_image_set_from_icon_name (GTK_IMAGE (priv->icon), PHOSH_APP_UNKNOWN_ICON);
gtk_widget_set_sensitive (GTK_WIDGET (self), FALSE);
}
diff --git a/phosh/src/app-grid-folder-button.c b/phosh/src/app-grid-folder-button.c
index ad105a239..a7bd2305e 100644
--- a/phosh/src/app-grid-folder-button.c
+++ b/phosh/src/app-grid-folder-button.c
@@ -106,13 +106,13 @@ build_2x2_grid_icon (PhoshAppGridFolderButton *self)
icon = g_app_info_get_icon (app_info);
if (icon == NULL) {
- image = gtk_image_new_from_icon_name (PHOSH_APP_UNKNOWN_ICON, -1);
+ image = gtk_image_new_from_icon_name (PHOSH_APP_UNKNOWN_ICON);
} else {
if (G_IS_THEMED_ICON (icon)) {
g_themed_icon_append_name (G_THEMED_ICON (icon),
PHOSH_APP_UNKNOWN_ICON);
}
- image = gtk_image_new_from_gicon (icon, -1);
+ image = gtk_image_new_from_gicon (icon);
}
/* app-grid-button uses 64px for its icon.
@@ -133,6 +133,8 @@ phosh_app_grid_folder_button_dispose (GObject *object)
g_clear_object (&self->folder_info);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_APP_GRID_FOLDER_BUTTON);
+
G_OBJECT_CLASS (phosh_app_grid_folder_button_parent_class)->dispose (object);
}
diff --git a/phosh/src/app-grid.c b/phosh/src/app-grid.c
index cc2fe6fbd..0a74262ca 100644
--- a/phosh/src/app-grid.c
+++ b/phosh/src/app-grid.c
@@ -17,9 +17,7 @@
#include "shell-priv.h"
#include "util.h"
-#include "gtk-list-models/gtksortlistmodel.h"
-#include "gtk-list-models/gtkfilterlistmodel.h"
-
+#include
#include
#define ACTIVE_SEARCH_CLASS "search-active"
@@ -42,6 +40,7 @@ static guint signals[N_SIGNALS] = { 0 };
typedef struct _PhoshAppGridPrivate PhoshAppGridPrivate;
struct _PhoshAppGridPrivate {
+ GtkFilter *filter;
GtkFilterListModel *model;
GtkWidget *deck;
@@ -120,7 +119,7 @@ show_main_grid (PhoshAppGrid *self)
{
PhoshAppGridPrivate *priv = phosh_app_grid_get_instance_private (self);
GtkFlowBoxChild *button = NULL;
- hdy_deck_set_visible_child_name (HDY_DECK (priv->deck), "main_grid");
+ adw_navigation_view_pop (ADW_NAVIGATION_VIEW (priv->deck));
if (priv->open_folder == NULL)
return;
@@ -217,7 +216,7 @@ folder_launched_cb (GtkWidget *widget,
PhoshAppGridPrivate *priv = phosh_app_grid_get_instance_private (self);
GListModel *model = phosh_folder_info_get_app_infos (info);
- hdy_deck_set_visible_child_name (HDY_DECK (priv->deck), "folder_page");
+ adw_navigation_view_push_by_tag (ADW_NAVIGATION_VIEW (priv->deck), "folder_page");
g_object_bind_property (info, "name", priv->folder_name_label, "label", G_BINDING_SYNC_CREATE);
priv->folder_model = model;
g_set_object (&priv->open_folder, info);
@@ -227,7 +226,7 @@ folder_launched_cb (GtkWidget *widget,
G_CALLBACK (show_folder_page),
self,
G_CONNECT_SWAPPED);
- gtk_entry_set_text (GTK_ENTRY (priv->folder_name_entry), "");
+ gtk_editable_set_text (GTK_EDITABLE (priv->folder_name_entry), "");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->folder_name_btn), FALSE);
show_folder_page (self);
@@ -269,7 +268,7 @@ update_filter_adaptive_button (PhoshAppGrid *self)
}
gtk_label_set_label (GTK_LABEL (priv->btn_adaptive_lbl), label);
- gtk_image_set_from_icon_name (GTK_IMAGE (priv->btn_adaptive_img), icon_name, -1);
+ gtk_image_set_from_icon_name (GTK_IMAGE (priv->btn_adaptive_img), icon_name);
}
@@ -292,7 +291,7 @@ on_filter_setting_changed (PhoshAppGrid *self,
show = !!(priv->filter_mode & PHOSH_APP_FILTER_MODE_FLAGS_ADAPTIVE);
gtk_widget_set_visible (priv->btn_adaptive, show);
- gtk_filter_list_model_refilter (priv->model);
+ gtk_filter_changed (priv->filter, GTK_FILTER_CHANGE_DIFFERENT);
}
@@ -396,7 +395,7 @@ favorites_changed (GListModel *list, guint pos, guint removed, guint added, Phos
toggle_favorites_revealer (self);
/* We don't show favorites in the main list, filter them out */
- gtk_filter_list_model_refilter (priv->model);
+ gtk_filter_changed (priv->filter, GTK_FILTER_CHANGE_DIFFERENT);
}
@@ -423,6 +422,7 @@ static void
phosh_app_grid_init (PhoshAppGrid *self)
{
PhoshAppGridPrivate *priv = phosh_app_grid_get_instance_private (self);
+ GtkCustomSorter *sorter;
GtkSortListModel *sorted;
PhoshFavoriteListModel *favorites;
g_autoptr (GAction) action = NULL;
@@ -442,15 +442,12 @@ phosh_app_grid_init (PhoshAppGrid *self)
self);
/* fill the grid with apps */
+ sorter = gtk_custom_sorter_new (sort_apps, NULL, NULL);
sorted = gtk_sort_list_model_new (G_LIST_MODEL (phosh_app_list_model_get_default ()),
- sort_apps,
- NULL,
- NULL);
+ GTK_SORTER (sorter));
+ priv->filter = GTK_FILTER (gtk_custom_filter_new (search_apps, self, NULL));
priv->model = gtk_filter_list_model_new (G_LIST_MODEL (sorted),
- search_apps,
- self,
- NULL);
- g_object_unref (sorted);
+ priv->filter);
gtk_flow_box_bind_model (GTK_FLOW_BOX (priv->apps),
G_LIST_MODEL (priv->model),
create_launcher,
@@ -485,6 +482,8 @@ phosh_app_grid_dispose (GObject *object)
g_clear_object (&priv->settings);
g_clear_handle_id (&priv->debounce, g_source_remove);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_APP_GRID);
+
G_OBJECT_CLASS (phosh_app_grid_parent_class)->dispose (object);
}
@@ -503,18 +502,19 @@ phosh_app_grid_finalize (GObject *object)
static gboolean
-phosh_app_grid_key_press_event (GtkWidget *widget,
- GdkEventKey *event)
+on_key_pressed (PhoshAppGrid *self,
+ guint keyval,
+ guint keycode,
+ GdkModifierType state,
+ GtkEventControllerKey *controller)
{
- PhoshAppGrid *self = PHOSH_APP_GRID (widget);
PhoshAppGridPrivate *priv = phosh_app_grid_get_instance_private (self);
/* Don't search when folder is open */
if (priv->open_folder != NULL)
return GDK_EVENT_PROPAGATE;
- return gtk_search_entry_handle_event (GTK_SEARCH_ENTRY (priv->search),
- (GdkEvent *) event);
+ return gtk_event_controller_key_forward (controller, priv->search);
}
@@ -534,7 +534,7 @@ do_search (gpointer data)
phosh_util_toggle_style_class (GTK_WIDGET (priv->apps), ACTIVE_SEARCH_CLASS, search_active);
toggle_favorites_revealer (self);
- gtk_filter_list_model_refilter (priv->model);
+ gtk_filter_changed (priv->filter, GTK_FILTER_CHANGE_DIFFERENT);
priv->debounce = 0;
}
@@ -548,16 +548,16 @@ on_folder_edit_toggled (PhoshAppGrid *self, GtkToggleButton *toggle_btn)
if (active) {
const char *folder_name = phosh_folder_info_get_name (priv->open_folder);
- gtk_entry_set_text (GTK_ENTRY (priv->folder_name_entry), folder_name);
+ gtk_editable_set_text (GTK_EDITABLE (priv->folder_name_entry), folder_name);
gtk_widget_grab_focus (priv->folder_name_entry);
- gtk_image_set_from_icon_name (GTK_IMAGE (priv->folder_name_img), "checkmark-symbolic", -1);
+ gtk_image_set_from_icon_name (GTK_IMAGE (priv->folder_name_img), "emblem-ok-symbolic");
} else {
- const char *folder_name = gtk_entry_get_text (GTK_ENTRY (priv->folder_name_entry));
+ const char *folder_name = gtk_editable_get_text (GTK_EDITABLE (priv->folder_name_entry));
if (gm_str_is_null_or_empty (folder_name))
return;
phosh_folder_info_set_name (priv->open_folder, folder_name);
- gtk_entry_set_text (GTK_ENTRY (priv->folder_name_entry), "");
- gtk_image_set_from_icon_name (GTK_IMAGE (priv->folder_name_img), "document-edit-symbolic", -1);
+ gtk_editable_set_text (GTK_EDITABLE (priv->folder_name_entry), "");
+ gtk_image_set_from_icon_name (GTK_IMAGE (priv->folder_name_img), "document-edit-symbolic");
}
}
@@ -576,7 +576,7 @@ on_search_changed (GtkSearchEntry *entry,
PhoshAppGrid *self)
{
PhoshAppGridPrivate *priv = phosh_app_grid_get_instance_private (self);
- const char *search = gtk_entry_get_text (GTK_ENTRY (entry));
+ const char *search = gtk_editable_get_text (GTK_EDITABLE (entry));
g_clear_pointer (&priv->search_string, g_free);
@@ -596,25 +596,6 @@ on_search_changed (GtkSearchEntry *entry,
}
-static void
-on_search_preedit_changed (GtkSearchEntry *entry,
- const char *preedit,
- PhoshAppGrid *self)
-{
- PhoshAppGridPrivate *priv = phosh_app_grid_get_instance_private (self);
-
- g_clear_pointer (&priv->search_string, g_free);
-
- if (preedit && *preedit != '\0')
- priv->search_string = g_utf8_casefold (preedit, -1);
-
- g_clear_handle_id (&priv->debounce, g_source_remove);
-
- priv->debounce = g_timeout_add_once (SEARCH_DEBOUNCE + DEFAULT_GTK_DEBOUNCE, do_search, self);
- g_source_set_name_by_id (priv->debounce, "[phosh] debounce app grid search (preedit-changed)");
-}
-
-
static void
on_search_activated (GtkSearchEntry *entry,
PhoshAppGrid *self)
@@ -645,9 +626,8 @@ on_search_activated (GtkSearchEntry *entry,
static gboolean
-on_search_lost_focus (GtkWidget *widget,
- GdkEvent *event,
- PhoshAppGrid *self)
+on_search_lost_focus (GtkEventControllerFocus *focus,
+ PhoshAppGrid *self)
{
PhoshAppGridPrivate *priv = phosh_app_grid_get_instance_private (self);
@@ -658,9 +638,8 @@ on_search_lost_focus (GtkWidget *widget,
static gboolean
-on_search_gained_focus (GtkWidget *widget,
- GdkEvent *event,
- PhoshAppGrid *self)
+on_search_gained_focus (GtkEventControllerFocus *focus,
+ PhoshAppGrid *self)
{
PhoshAppGridPrivate *priv = phosh_app_grid_get_instance_private (self);
@@ -683,8 +662,6 @@ phosh_app_grid_class_init (PhoshAppGridClass *klass)
object_class->set_property = phosh_app_grid_set_property;
object_class->get_property = phosh_app_grid_get_property;
- widget_class->key_press_event = phosh_app_grid_key_press_event;
-
/**
* PhoshAppGrid:filter-adaptive:
*
@@ -726,8 +703,8 @@ phosh_app_grid_class_init (PhoshAppGridClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_folder_edit_toggled);
gtk_widget_class_bind_template_callback (widget_class, on_folder_entry_activated);
+ gtk_widget_class_bind_template_callback (widget_class, on_key_pressed);
gtk_widget_class_bind_template_callback (widget_class, on_search_changed);
- gtk_widget_class_bind_template_callback (widget_class, on_search_preedit_changed);
gtk_widget_class_bind_template_callback (widget_class, on_search_activated);
gtk_widget_class_bind_template_callback (widget_class, on_search_gained_focus);
gtk_widget_class_bind_template_callback (widget_class, on_search_lost_focus);
@@ -757,16 +734,16 @@ phosh_app_grid_reset (PhoshAppGrid *self)
adjustment = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (priv->scrolled_window));
gtk_adjustment_set_value (adjustment, 0);
- gtk_entry_set_text (GTK_ENTRY (priv->search), "");
+ gtk_editable_set_text (GTK_EDITABLE (priv->search), "");
g_clear_pointer (&priv->search_string, g_free);
/* Do not focus last folder */
priv->open_folder_idx = -1;
- /* Set duration to 0 to avoid the simultaneous animation of grid sliding up and deck sliding
+ /* Disable transitions to avoid the simultaneous animation of grid sliding up and deck sliding
* right. If not done, it feels like the deck is spiraling diagonally up. */
- hdy_deck_set_transition_duration (HDY_DECK (priv->deck), 0);
+ adw_navigation_view_set_animate_transitions (ADW_NAVIGATION_VIEW (priv->deck), FALSE);
show_main_grid (self);
- hdy_deck_set_transition_duration (HDY_DECK (priv->deck), 200);
+ adw_navigation_view_set_animate_transitions (ADW_NAVIGATION_VIEW (priv->deck), TRUE);
}
@@ -792,10 +769,12 @@ phosh_app_grid_handle_search (PhoshAppGrid *self, GdkEvent *event)
/* Prevent stealing of focus when folder is open and it's name entry is active */
if (priv->open_folder != NULL)
- return GDK_EVENT_PROPAGATE;
+ return FALSE;
- ret = gtk_search_entry_handle_event (GTK_SEARCH_ENTRY (priv->search), event);
- if (ret == GDK_EVENT_STOP)
+ // FIXME Port to GTK 4
+ // gtk_search_entry_handle_event (GTK_SEARCH_ENTRY (priv->search), event);
+ ret = FALSE;
+ if (ret == TRUE)
gtk_entry_grab_focus_without_selecting (GTK_ENTRY (priv->search));
return ret;
@@ -818,6 +797,6 @@ phosh_app_grid_set_filter_adaptive (PhoshAppGrid *self, gboolean enable)
priv->filter_adaptive = enable;
update_filter_adaptive_button (self);
- gtk_filter_list_model_refilter (priv->model);
+ gtk_filter_changed (priv->filter, GTK_FILTER_CHANGE_DIFFERENT);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_FILTER_ADAPTIVE]);
}
diff --git a/phosh/src/app-grid.h b/phosh/src/app-grid.h
index ce4daac2e..990de31cc 100644
--- a/phosh/src/app-grid.h
+++ b/phosh/src/app-grid.h
@@ -6,8 +6,7 @@
#include
#include
-
-#include
+#include
#include "phosh-settings-enums.h"
diff --git a/phosh/src/app-list-model.c b/phosh/src/app-list-model.c
index d58fa8936..03a3696d0 100644
--- a/phosh/src/app-list-model.c
+++ b/phosh/src/app-list-model.c
@@ -15,15 +15,13 @@
#include "app-list-model.h"
#include "folder-info.h"
-#include
-
#include
typedef struct _PhoshAppListModelPrivate PhoshAppListModelPrivate;
struct _PhoshAppListModelPrivate {
GAppInfoMonitor *monitor;
- GSequence *items;
+ GSequence *items;
guint debounce;
@@ -34,10 +32,9 @@ struct _PhoshAppListModelPrivate {
GSequenceIter *iter;
} last;
- GSettings *settings;
+ GSettings *settings;
GHashTable *startup_wm_class;
- GHashTable *exec_to_id;
};
static void list_iface_init (GListModelInterface *iface);
@@ -56,7 +53,6 @@ phosh_app_list_model_finalize (GObject *object)
g_clear_handle_id (&priv->debounce, g_source_remove);
g_clear_pointer (&priv->startup_wm_class, g_hash_table_destroy);
- g_clear_pointer (&priv->exec_to_id, g_hash_table_destroy);
g_clear_object (&priv->monitor);
g_clear_object (&priv->settings);
@@ -186,7 +182,6 @@ items_changed (gpointer data)
g_sequence_remove_range (g_sequence_get_begin_iter (priv->items),
g_sequence_get_end_iter (priv->items));
g_hash_table_remove_all (priv->startup_wm_class);
- g_hash_table_remove_all (priv->exec_to_id);
folder_paths = g_settings_get_strv (priv->settings, "folder-children");
@@ -272,10 +267,6 @@ phosh_app_list_model_init (PhoshAppListModel *self)
g_str_equal,
g_free,
g_object_unref);
- priv->exec_to_id = g_hash_table_new_full (g_str_hash,
- g_str_equal,
- g_free,
- g_object_unref);
priv->last.is_valid = FALSE;
@@ -291,6 +282,7 @@ phosh_app_list_model_init (PhoshAppListModel *self)
on_monitor_changed_cb (priv->monitor, self);
}
+
/**
* phosh_app_list_model_get_default:
*
@@ -330,37 +322,3 @@ phosh_app_list_model_lookup_by_startup_wm_class (PhoshAppListModel *self,
return g_hash_table_lookup (priv->startup_wm_class, class);
}
-
-
-void
-phosh_app_list_model_add_exec (PhoshAppListModel *self,
- const char *exec,
- GAppInfo *info)
-{
- PhoshAppListModelPrivate *priv = phosh_app_list_model_get_instance_private (self);
- g_autofree char *bin = NULL, *cmd = NULL;
- g_auto (GStrv) parts = NULL;
-
- g_return_if_fail (PHOSH_IS_APP_LIST_MODEL (self));
- g_return_if_fail (G_IS_APP_INFO (info));
- g_return_if_fail (exec);
-
- parts = g_strsplit (exec, " ", -1);
- if (gm_strv_is_null_or_empty (parts))
- return;
-
- cmd = g_path_get_basename (parts[0]);
- if (gm_str_is_null_or_empty (cmd))
- return;
-
- g_hash_table_insert (priv->exec_to_id, g_steal_pointer (&cmd), g_object_ref (info));
-}
-
-
-GDesktopAppInfo *
-phosh_app_list_model_lookup_by_exec (PhoshAppListModel *self, const char *exec)
-{
- PhoshAppListModelPrivate *priv = phosh_app_list_model_get_instance_private (self);
-
- return g_hash_table_lookup (priv->exec_to_id, exec);
-}
diff --git a/phosh/src/app-list-model.h b/phosh/src/app-list-model.h
index 4ad506035..1d7f1e2ba 100644
--- a/phosh/src/app-list-model.h
+++ b/phosh/src/app-list-model.h
@@ -20,11 +20,7 @@ struct _PhoshAppListModelClass
};
PhoshAppListModel *phosh_app_list_model_get_default (void);
-GDesktopAppInfo * phosh_app_list_model_lookup_by_startup_wm_class (PhoshAppListModel *self,
+GDesktopAppInfo *phosh_app_list_model_lookup_by_startup_wm_class (PhoshAppListModel *self,
const char *class);
-GDesktopAppInfo * phosh_app_list_model_lookup_by_exec (PhoshAppListModel *self, const char *exec);
-void phosh_app_list_model_add_exec (PhoshAppListModel *self,
- const char *exec,
- GAppInfo *info);
G_END_DECLS
diff --git a/phosh/src/app-tracker.c b/phosh/src/app-tracker.c
index a46200a5e..30e61a30a 100644
--- a/phosh/src/app-tracker.c
+++ b/phosh/src/app-tracker.c
@@ -10,7 +10,6 @@
#include "phosh-config.h"
-#include "app-list-model.h"
#include "app-tracker.h"
#include "phosh-wayland.h"
#include "shell-priv.h"
@@ -688,19 +687,18 @@ phosh_app_tracker_launch_app_info (PhoshAppTracker *self, GAppInfo *info)
{
g_autoptr (GdkAppLaunchContext) context = NULL;
g_autoptr (GError) error = NULL;
- PhoshShell *shell = phosh_shell_get_default ();
- PhoshToplevelManager *toplevel_manager = phosh_shell_get_toplevel_manager (shell);
- g_autofree char *app_id = NULL, *exec = NULL;
+ PhoshToplevelManager *toplevel_manager = phosh_shell_get_toplevel_manager (phosh_shell_get_default ());
+ g_autofree char *app_id = NULL;
gboolean success;
app_id = phosh_strip_suffix_from_app_id (g_app_info_get_id (G_APP_INFO (info)));
g_debug ("Launching '%s'", app_id);
- for (guint i = 0; i < phosh_toplevel_manager_get_num_toplevels (toplevel_manager); i++) {
+ for (guint i=0; i < phosh_toplevel_manager_get_num_toplevels (toplevel_manager); i++) {
PhoshToplevel *toplevel = phosh_toplevel_manager_get_toplevel (toplevel_manager, i);
const char *window_id = phosh_toplevel_get_app_id (toplevel);
- g_autoptr (GDesktopAppInfo) toplevel_info = phosh_get_desktop_app_info_for_app_id (window_id);
- if (toplevel_info && g_app_info_equal (G_APP_INFO (toplevel_info), G_APP_INFO (info))) {
+ g_autoptr (GDesktopAppInfo) toplevel_app_info = phosh_get_desktop_app_info_for_app_id (window_id);
+ if (toplevel_app_info && g_app_info_equal (G_APP_INFO (toplevel_app_info), G_APP_INFO (info))) {
/* activate the first matching window for now, since we don't have toplevels sorted by last-focus yet */
phosh_toplevel_activate (toplevel, phosh_wayland_get_wl_seat (phosh_wayland_get_default ()));
g_signal_emit (self, signals[APP_ACTIVATED], 0, info);
@@ -724,10 +722,6 @@ phosh_app_tracker_launch_app_info (PhoshAppTracker *self, GAppInfo *info)
G_CALLBACK (on_app_launch_failed),
self);
- exec = g_desktop_app_info_get_string (G_DESKTOP_APP_INFO (info), "Exec");
- if (exec)
- phosh_app_list_model_add_exec (phosh_app_list_model_get_default (), exec, info);
-
success = g_desktop_app_info_launch_uris_as_manager (G_DESKTOP_APP_INFO (info),
NULL,
G_APP_LAUNCH_CONTEXT (context),
diff --git a/phosh/src/arrow.c b/phosh/src/arrow.c
index 80133df42..bbfd0ffb1 100644
--- a/phosh/src/arrow.c
+++ b/phosh/src/arrow.c
@@ -55,26 +55,22 @@ interpolate_progress (double t)
/* GtkWidget */
-static gboolean
-phosh_arrow_draw (GtkWidget *widget,
- cairo_t *cr)
+static void
+phosh_arrow_draw (GtkDrawingArea *drawing_area,
+ cairo_t *cr, int width, int height, gpointer user_data)
{
- PhoshArrow *self = PHOSH_ARROW (widget);
+ PhoshArrow *self = PHOSH_ARROW (drawing_area);
double progress, angle, center_x, center_y;
- GtkStyleContext *context;
- GtkStateFlags flags;
GdkRGBA rgba;
progress = interpolate_progress (self->progress);
angle = (0.5 - progress) * G_PI / 2.5;
- center_x = gtk_widget_get_allocated_width (widget) / 2.0;
- center_y = (gtk_widget_get_allocated_height (widget) / 2.0 - 0.5) * (0.5 + progress);
+ center_x = width / 2.0;
+ center_y = (height / 2.0 - 0.5) * (0.5 + progress);
- context = gtk_widget_get_style_context (widget);
- flags = gtk_widget_get_state_flags (widget);
- gtk_style_context_get_color (context, flags, &rgba);
+ gtk_widget_get_color (GTK_WIDGET (self), &rgba);
cairo_set_line_width (cr, 3);
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
@@ -87,8 +83,6 @@ phosh_arrow_draw (GtkWidget *widget,
cairo_move_to (cr, center_x, center_y);
cairo_line_to (cr, center_x - LENGTH * cos (angle), center_y + LENGTH * sin (angle));
cairo_stroke (cr);
-
- return GDK_EVENT_PROPAGATE;
}
@@ -132,11 +126,9 @@ static void
phosh_arrow_class_init (PhoshArrowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->get_property = phosh_arrow_get_property;
object_class->set_property = phosh_arrow_set_property;
- widget_class->draw = phosh_arrow_draw;
properties [PROP_PROGRESS] =
g_param_spec_double ("progress",
@@ -153,9 +145,10 @@ static void
phosh_arrow_init (PhoshArrow *self)
{
self->progress = 0;
+ gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (self), phosh_arrow_draw, NULL, NULL);
g_object_set (self,
- "width-request", WIDTH,
- "height-request", HEIGHT,
+ "content-width", WIDTH,
+ "content-height", HEIGHT,
NULL);
}
diff --git a/phosh/src/audio-manager.c b/phosh/src/audio-manager.c
deleted file mode 100644
index c49e9af74..000000000
--- a/phosh/src/audio-manager.c
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Copyright (C) 2025 Phosh.mobi e.V.
- *
- * SPDX-License-Identifier: GPL-3.0-or-later
- *
- * Author: Guido Günther
- */
-
-#define G_LOG_DOMAIN "phosh-audio-manager"
-
-#include "phosh-config.h"
-
-#include "audio-manager.h"
-#include "audio/audio-devices.h"
-
-#include "gvc-mixer-control.h"
-
-#include
-
-/**
- * PhoshAudioManager:
- *
- * Manage audio related properties
- */
-
-struct _PhoshAudioManager {
- GObject parent;
-
- GvcMixerControl *mixer_control;
-
- PhoshAudioDevices *input_devices;
- PhoshAudioDevices *output_devices;
-};
-
-G_DEFINE_TYPE (PhoshAudioManager, phosh_audio_manager, G_TYPE_OBJECT)
-
-
-static void
-phosh_audio_manager_dispose (GObject *object)
-{
- PhoshAudioManager *self = PHOSH_AUDIO_MANAGER (object);
-
- g_clear_object (&self->output_devices);
- g_clear_object (&self->input_devices);
-
- G_OBJECT_CLASS (phosh_audio_manager_parent_class)->dispose (object);
-}
-
-
-static void
-phosh_audio_manager_finalize (GObject *object)
-{
- PhoshAudioManager *self = PHOSH_AUDIO_MANAGER (object);
-
- g_clear_object (&self->mixer_control);
-
- G_OBJECT_CLASS (phosh_audio_manager_parent_class)->finalize (object);
-}
-
-
-static void
-phosh_audio_manager_class_init (PhoshAudioManagerClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- object_class->dispose = phosh_audio_manager_dispose;
- object_class->finalize = phosh_audio_manager_finalize;
-}
-
-
-static void
-phosh_audio_manager_init (PhoshAudioManager *self)
-{
- self->mixer_control = gvc_mixer_control_new (_("Phone Shell Volume Control"));
- g_return_if_fail (self->mixer_control);
- gvc_mixer_control_open (self->mixer_control);
-
- self->output_devices = phosh_audio_devices_new (self->mixer_control, FALSE);
- self->input_devices = phosh_audio_devices_new (self->mixer_control, TRUE);
-}
-
-
-PhoshAudioManager *
-phosh_audio_manager_get_default (void)
-{
- static PhoshAudioManager *instance;
-
- if (instance == NULL) {
- instance = g_object_new (PHOSH_TYPE_AUDIO_MANAGER, NULL);
- g_object_add_weak_pointer (G_OBJECT (instance), (gpointer *) &instance);
- }
-
- return instance;
-}
-
-
-PhoshAudioDevices *
-phosh_audio_manager_get_input_devices (PhoshAudioManager *self)
-{
- g_return_val_if_fail (PHOSH_IS_AUDIO_MANAGER (self), NULL);
-
- return self->input_devices;
-}
-
-
-PhoshAudioDevices *
-phosh_audio_manager_get_output_devices (PhoshAudioManager *self)
-{
- g_return_val_if_fail (PHOSH_IS_AUDIO_MANAGER (self), NULL);
-
- return self->output_devices;
-}
-
-
-GvcMixerControl *
-phosh_audio_manager_get_mixer_control (PhoshAudioManager *self)
-{
- g_return_val_if_fail (PHOSH_IS_AUDIO_MANAGER (self), NULL);
-
- return self->mixer_control;
-}
-
-
-GvcMixerStream *
-phosh_audio_manager_get_default_sink (PhoshAudioManager *self)
-{
- g_return_val_if_fail (PHOSH_IS_AUDIO_MANAGER (self), NULL);
-
- return gvc_mixer_control_get_default_sink (self->mixer_control);
-}
-
-
-void
-phosh_audio_manager_change_input (PhoshAudioManager *self, guint id)
-{
- GvcMixerUIDevice *device;
-
- g_return_if_fail (PHOSH_IS_AUDIO_MANAGER (self));
-
- device = gvc_mixer_control_lookup_input_id (self->mixer_control, id);
- g_return_if_fail (device);
-
- gvc_mixer_control_change_input (self->mixer_control, device);
-}
-
-
-void
-phosh_audio_manager_change_output (PhoshAudioManager *self, guint id)
-{
- GvcMixerUIDevice *device;
-
- g_return_if_fail (PHOSH_IS_AUDIO_MANAGER (self));
-
- device = gvc_mixer_control_lookup_output_id (self->mixer_control, id);
- g_return_if_fail (device);
-
- gvc_mixer_control_change_output (self->mixer_control, device);
-}
diff --git a/phosh/src/audio-manager.h b/phosh/src/audio-manager.h
deleted file mode 100644
index b59ccd34e..000000000
--- a/phosh/src/audio-manager.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2025 Phosh.mobi e.V.
- *
- * SPDX-License-Identifier: GPL-3.0-or-later
- */
-
-#pragma once
-
-#include "audio/audio-devices.h"
-
-#include "gvc-mixer-control.h"
-
-#include
-
-G_BEGIN_DECLS
-
-#define PHOSH_TYPE_AUDIO_MANAGER (phosh_audio_manager_get_type ())
-
-G_DECLARE_FINAL_TYPE (PhoshAudioManager, phosh_audio_manager, PHOSH, AUDIO_MANAGER, GObject)
-
-PhoshAudioManager *phosh_audio_manager_get_default (void);
-PhoshAudioDevices *phosh_audio_manager_get_input_devices (PhoshAudioManager *self);
-PhoshAudioDevices *phosh_audio_manager_get_output_devices (PhoshAudioManager *self);
-GvcMixerControl * phosh_audio_manager_get_mixer_control (PhoshAudioManager *self);
-GvcMixerStream * phosh_audio_manager_get_default_sink (PhoshAudioManager *self);
-void phosh_audio_manager_change_input (PhoshAudioManager *self, guint id);
-void phosh_audio_manager_change_output (PhoshAudioManager *self, guint id);
-
-G_END_DECLS
diff --git a/phosh/src/background-manager.c b/phosh/src/background-manager.c
index a350349f8..49644e52a 100644
--- a/phosh/src/background-manager.c
+++ b/phosh/src/background-manager.c
@@ -20,10 +20,9 @@
#include "util.h"
#define GNOME_DESKTOP_USE_UNSTABLE_API
-#include
-#include
+#include
+#include
-#include
#include
#include
@@ -281,11 +280,9 @@ on_background_destroy (PhoshBackgroundManager *self, GtkWidget *widget)
static PhoshBackground *
create_background_for_monitor (PhoshBackgroundManager *self, PhoshMonitor *monitor)
{
- PhoshWayland *wl = phosh_wayland_get_default ();
GtkWidget *background;
- background = phosh_background_new (phosh_wayland_get_zwlr_layer_shell_v1 (wl),
- monitor,
+ background = phosh_background_new (monitor,
monitor == self->primary_monitor,
ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND);
g_signal_connect_object (background,
@@ -479,7 +476,7 @@ phosh_background_manager_init (PhoshBackgroundManager *self)
self->backgrounds = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
g_object_unref,
- (GDestroyNotify)gtk_widget_destroy);
+ (GDestroyNotify)gtk_window_destroy);
}
PhoshBackgroundManager *
diff --git a/phosh/src/background.c b/phosh/src/background.c
index 19245c903..c7ef6f77a 100644
--- a/phosh/src/background.c
+++ b/phosh/src/background.c
@@ -24,8 +24,8 @@
#include "util.h"
#define GNOME_DESKTOP_USE_UNSTABLE_API
-#include
-#include
+#include
+#include
#include
@@ -198,16 +198,24 @@ image_background (PhoshBackgroundImage *image,
}
-static gboolean
-phosh_background_draw (GtkWidget *widget, cairo_t *cr)
+static void
+phosh_background_snapshot (GtkWidget *widget, GtkSnapshot *snapshot)
{
PhoshBackground *self = PHOSH_BACKGROUND (widget);
+ graphene_rect_t bounds;
int x = 0, y = 0, width, height;
+ cairo_t *cr;
- g_return_val_if_fail (PHOSH_IS_BACKGROUND (self), GDK_EVENT_PROPAGATE);
+ g_return_if_fail (PHOSH_IS_BACKGROUND (self));
if (!self->configured)
- return GDK_EVENT_PROPAGATE;
+ return;
+
+ bounds.origin.x = 0;
+ bounds.origin.y = 0;
+ bounds.size.width = gtk_widget_get_width (GTK_WIDGET (self));
+ bounds.size.height = gtk_widget_get_height (GTK_WIDGET (self));
+ cr = gtk_snapshot_append_cairo (snapshot, &bounds);
if (self->primary)
phosh_shell_get_usable_area (phosh_shell_get_default (), &x, &y, NULL, NULL);
@@ -215,11 +223,12 @@ phosh_background_draw (GtkWidget *widget, cairo_t *cr)
cairo_save (cr);
if (self->primary) {
/* Primary background: use CSS color as it's the top- and home-bar's background */
- GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (self));
+ // FIXME Use GTK 4 replacement
+ // GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (self));
- width = gtk_widget_get_allocated_width (GTK_WIDGET (self));
- height = gtk_widget_get_allocated_height (GTK_WIDGET (self));
- gtk_render_background (context, cr, 0, 0, width, height);
+ // width = gtk_widget_get_width (GTK_WIDGET (self));
+ // height = gtk_widget_get_height (GTK_WIDGET (self));
+ // gtk_render_background (context, cr, 0, 0, width, height);
} else {
cairo_set_operator (cr, CAIRO_OPERATOR_OVER);
cairo_set_source_rgb (cr, self->color.red, self->color.green, self->color.blue);
@@ -232,8 +241,7 @@ phosh_background_draw (GtkWidget *widget, cairo_t *cr)
}
cairo_restore (cr);
-
- return GDK_EVENT_PROPAGATE;
+ cairo_destroy (cr);
}
@@ -356,7 +364,7 @@ phosh_background_class_init (PhoshBackgroundClass *klass)
object_class->set_property = phosh_background_set_property;
object_class->get_property = phosh_background_get_property;
- widget_class->draw = phosh_background_draw;
+ widget_class->snapshot = phosh_background_snapshot;
layer_surface_class->configured = phosh_background_configured;
@@ -388,13 +396,11 @@ phosh_background_init (PhoshBackground *self)
GtkWidget *
-phosh_background_new (gpointer layer_shell,
- PhoshMonitor *monitor,
+phosh_background_new (PhoshMonitor *monitor,
gboolean primary,
guint layer)
{
return g_object_new (PHOSH_TYPE_BACKGROUND,
- "layer-shell", layer_shell,
"wl-output", monitor->wl_output,
"anchor", (ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
diff --git a/phosh/src/background.h b/phosh/src/background.h
index 925dfe914..8e3abb50d 100644
--- a/phosh/src/background.h
+++ b/phosh/src/background.h
@@ -10,7 +10,7 @@
#include "monitor/monitor.h"
#define GNOME_DESKTOP_USE_UNSTABLE_API
-#include
+#include
#include
@@ -26,8 +26,7 @@ typedef struct _PhoshBackgroundData {
GDesktopBackgroundStyle style;
} PhoshBackgroundData;
-GtkWidget *phosh_background_new (gpointer layer_shell,
- PhoshMonitor *monitor,
+GtkWidget *phosh_background_new (PhoshMonitor *monitor,
gboolean primary,
guint layer);
void phosh_background_set_primary (PhoshBackground *self,
diff --git a/phosh/src/backlight.c b/phosh/src/backlight.c
index 8caa78249..74744ef02 100644
--- a/phosh/src/backlight.c
+++ b/phosh/src/backlight.c
@@ -104,7 +104,7 @@ phosh_backlight_brightness_to_level (PhoshBacklight *self, double brightness)
if (priv->scale == PHOSH_BACKLIGHT_SCALE_NON_LINEAR)
return round (brightness);
- level = round (exp10 (brightness));
+ level = exp10 (brightness);
return CLAMP (level, priv->level.min, priv->level.max);
}
diff --git a/phosh/src/brightness-manager.c b/phosh/src/brightness-manager.c
index 766596008..735fca539 100644
--- a/phosh/src/brightness-manager.c
+++ b/phosh/src/brightness-manager.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2025-2026 Phosh.mobi e.V.
+ * Copyright (C) 2025 Phosh.mobi e.V.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
@@ -22,10 +22,7 @@
#define KEYBINDING_KEY_BRIGHTNESS_UP_MONITOR "screen-brightness-up-monitor"
#define KEYBINDING_KEY_BRIGHTNESS_DOWN_MONITOR "screen-brightness-down-monitor"
-#define POWER_SCHEMA_ID "org.gnome.settings-daemon.plugins.power"
-
-#define BRIGHTNESS_SCHEMA_ID "mobi.phosh.shell.brightness"
-#define BRIGHTNESS_KEY_AUTO_BRIGHTNESS_OFFSET "auto-brightness-offset"
+#define POWER_SCHEMA "org.gnome.settings-daemon.plugins.power"
/**
* PhoshBrightnessManager:
@@ -62,23 +59,17 @@ struct _PhoshBrightnessManager {
gboolean setting_brightness;
GSettings *settings_power;
- GSettings *settings_brightness;
gboolean dimmed;
struct {
gboolean enabled;
PhoshAutoBrightness *tracker;
double base;
double offset;
- guint night_light_temp;
- gboolean can_night_light;
} auto_brightness;
struct {
double target;
- double start;
- double interval;
- double duration;
- double elapsed;
+ double step;
uint id;
} transition;
@@ -95,116 +86,59 @@ G_DEFINE_TYPE_WITH_CODE (PhoshBrightnessManager,
G_IMPLEMENT_INTERFACE (PHOSH_DBUS_TYPE_BRIGHTNESS,
phosh_brightness_manager_brightness_init))
-/* https://en.wikipedia.org/wiki/Smoothstep */
-static double
-smoothstep (float t)
-{
- return t * t * (3.0 - 2.0 * t);
-}
-
-
static gboolean
on_transition_step (gpointer user_data)
{
PhoshBrightnessManager *self = user_data;
- double next, current, smooth;
+ double current, next;
- self->transition.elapsed += self->transition.interval;
current = phosh_backlight_get_relative (self->backlight);
- smooth = smoothstep (CLAMP (self->transition.elapsed / self->transition.duration, 0.0, 1.0));
- next = self->transition.start + (self->transition.target - self->transition.start) * smooth;
+ next = current + self->transition.step;
if (!self->auto_brightness.enabled) {
g_debug ("Brightness transition aborted");
- goto end;
+ self->transition.id = 0;
+ self->transition.target = current;
+ return G_SOURCE_REMOVE;
}
- if (self->transition.elapsed >= self->transition.duration) {
- g_debug ("Brightness transition done at %f, target: %f", next, self->transition.target);
- phosh_backlight_set_relative (self->backlight, next);
- goto end;
+ if ((self->transition.step > 0 && next >= self->transition.target) ||
+ (self->transition.step < 0 && next <= self->transition.target)) {
+ g_debug ("Brightness transition done at %f", self->transition.target);
+ phosh_backlight_set_relative (self->backlight, self->transition.target);
+ self->transition.id = 0;
+ return G_SOURCE_REMOVE;
}
- g_debug ("Brightness transition step: current %.3f, next %.3f, target: %.3f",
- current, next, self->transition.target);
+ g_debug ("Brightness transition step: current %.3f, next %.3f, step: %.3f, target: %.3f",
+ current, next, self->transition.step, self->transition.target);
phosh_backlight_set_relative (self->backlight, next);
return G_SOURCE_CONTINUE;
-
- end:
- self->transition.id = 0;
- return G_SOURCE_REMOVE;
}
-/* Human eye adapts faster to higher brightness values */
-#define AUTO_UP_INTERVAL 150 /* ms */
-#define AUTO_DOWN_INTERVAL 400 /* ms */
-#define AUTO_MAX_DURATION 4000 /* ms */
-#define AUTO_STEP_CHANGE 0.025
static void
transition_to_brightness (PhoshBrightnessManager *self, double target)
{
- double current = phosh_backlight_get_relative (self->backlight);
- uint steps;
+ double current;
- g_clear_handle_id (&self->transition.id, g_source_remove);
+ current = phosh_backlight_get_relative (self->backlight);
self->transition.target = target;
if (G_APPROX_VALUE (current, self->transition.target, FLT_EPSILON))
return;
- self->transition.interval = target > current ? AUTO_UP_INTERVAL : AUTO_DOWN_INTERVAL;
-
- self->transition.elapsed = 0;
- self->transition.start = current;
- steps = ceil (ABS (self->transition.target - self->transition.start) / 0.025);
- if (steps * self->transition.interval > AUTO_MAX_DURATION) {
- g_debug ("Limiting max transition duration from %.0fms to %dms",
- steps * self->transition.interval, AUTO_MAX_DURATION);
- steps = ceil (AUTO_MAX_DURATION / self->transition.interval);
- }
- self->transition.duration = steps * self->transition.interval;
-
- g_debug ("Starting auto brightness transition from %.2f to %.2f, duration: %.2fms",
- self->transition.start, self->transition.target, self->transition.duration);
+ self->transition.step = 1.0 / phosh_backlight_get_levels (self->backlight);
+ /* Don't do too many steps, even for large changes */
+ self->transition.step = MAX (0.025, self->transition.step);
+ if (self->transition.target < current)
+ self->transition.step *= -1.0;
- self->transition.id = g_timeout_add (self->transition.interval, on_transition_step, self);
-}
+ g_debug ("Starting auto brightness transition from %.2f to %.2f in steps of %f",
+ current, target, self->transition.step);
-
-static double
-compensate_night_light (PhoshBrightnessManager *self)
-{
- guint temp = self->auto_brightness.night_light_temp;
- typedef struct {
- guint32 color_temp; /* K */
- double correction;
- } ColorCorrection;
-
- const ColorCorrection corrections[] = {
- { 2000, 1.90 },
- { 2250, 1.80 },
- { 2500, 1.70 },
- { 2750, 1.60 },
- { 3000, 1.50 },
- { 3250, 1.40 },
- { 3500, 1.30 },
- { 4000, 1.20 },
- { 5000, 1.10 },
- { 6500, 1.00 },
- };
-
- if (!self->auto_brightness.can_night_light)
- return 1.0;
-
- for (int i = 0; i < G_N_ELEMENTS (corrections); i++) {
- const ColorCorrection *correction = &corrections[i];
-
- if (temp < correction->color_temp)
- return correction->correction;
- }
-
- return 1.0;
+ g_clear_handle_id (&self->transition.id, g_source_remove);
+ self->transition.id = g_timeout_add (250, on_transition_step, self);
}
@@ -212,19 +146,15 @@ static double
calc_auto_brightness (PhoshBrightnessManager *self)
{
double new_brightness = self->auto_brightness.base;
- double night_light_correction = compensate_night_light (self);
- /* Compensate for night light */
- new_brightness *= night_light_correction;
/* Apply any offset the user has set */
new_brightness += self->auto_brightness.offset;
new_brightness = CLAMP (new_brightness, 0.0, 1.0);
- g_debug ("New auto brightness %.2f (base: %.2f, offset: %.2f, nightlight: %.2f)",
+ g_debug ("New auto brightness %.2f (base: %.2f, offset: %.2f)",
new_brightness,
self->auto_brightness.base,
- self->auto_brightness.offset,
- night_light_correction);
+ self->auto_brightness.offset);
return new_brightness;
}
@@ -252,29 +182,6 @@ on_auto_brightness_changed (PhoshBrightnessManager *self)
}
-static void
-on_night_light_temp_changed (PhoshBrightnessManager *self,
- GParamSpec *pspec,
- PhoshMonitorManager *monitor_manager)
-{
- guint temp;
-
- g_return_if_fail (PHOSH_IS_BRIGHTNESS_MANAGER (self));
- g_return_if_fail (PHOSH_IS_MONITOR_MANAGER (monitor_manager));
-
- temp = phosh_monitor_manager_get_night_light_temp (monitor_manager);
- if (self->auto_brightness.night_light_temp == temp)
- return;
- self->auto_brightness.night_light_temp = temp;
-
- if (!self->auto_brightness.enabled)
- return;
-
- g_debug ("Night light temp changed, getting new offset");
- on_auto_brightness_changed (self);
-}
-
-
static void
set_auto_brightness_tracker (PhoshBrightnessManager *self)
{
@@ -310,9 +217,6 @@ on_ambient_auto_brightness_changed (PhoshBrightnessManager *self,
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ICON_NAME]);
if (self->auto_brightness.enabled) {
- self->auto_brightness.offset = g_settings_get_double (self->settings_brightness,
- BRIGHTNESS_KEY_AUTO_BRIGHTNESS_OFFSET);
- /* Adjustment is [0.0, 1.0] */
value = self->auto_brightness.offset + 0.5;
set_auto_brightness_tracker (self);
on_auto_brightness_changed (self);
@@ -486,6 +390,7 @@ on_value_changed (PhoshBrightnessManager *self, GtkAdjustment *adjustment)
/* With auto brightness the slider gives an offset to the auto brightness target */
if (self->auto_brightness.enabled) {
/* TODO: should we go through the brightness curve? */
+ /* TODO: preserve as setting */
/* Auto-brightness offset is [-0.5, +0.5] */
double offset = CLAMP (value - 0.5, -0.5, 0.5);
@@ -496,11 +401,6 @@ on_value_changed (PhoshBrightnessManager *self, GtkAdjustment *adjustment)
new_brightness = calc_auto_brightness (self);
/* Cancel any ongoing transition, the user likely wants the new brightness right away */
g_clear_handle_id (&self->transition.id, g_source_remove);
-
- g_debug ("Updating auto-brightness offset %f", offset);
- g_settings_set_double (self->settings_brightness,
- BRIGHTNESS_KEY_AUTO_BRIGHTNESS_OFFSET,
- offset);
} else {
new_brightness = value;
}
@@ -551,10 +451,8 @@ on_primary_monitor_changed (PhoshBrightnessManager *self, GParamSpec *psepc, Pho
if (!backlight)
monitor = phosh_shell_get_builtin_monitor (shell);
- if (monitor) {
+ if (monitor)
backlight = monitor->backlight;
- self->auto_brightness.can_night_light = phosh_monitor_has_gamma (monitor);
- }
set_backlight (self, backlight);
phosh_dbus_brightness_set_has_brightness_control (PHOSH_DBUS_BRIGHTNESS (self),
@@ -562,23 +460,6 @@ on_primary_monitor_changed (PhoshBrightnessManager *self, GParamSpec *psepc, Pho
}
-static void
-on_auto_brightness_offset_changed (PhoshBrightnessManager *self,
- const char *key,
- GSettings *settings)
-{
- double offset = g_settings_get_double (settings, BRIGHTNESS_KEY_AUTO_BRIGHTNESS_OFFSET);
-
- /* If auto brightness is disabled we'll pick up the offset when it gets enabled */
- if (!self->auto_brightness.enabled)
- return;
-
- /* Adjustment goes from [0.0, 1.0] */
- offset += 0.5;
- phosh_brightness_manager_set_value (self, offset, FALSE);
-}
-
-
static void
show_osd (PhoshBrightnessManager *self, double brightness)
{
@@ -725,7 +606,6 @@ phosh_brightness_manager_dispose (GObject *object)
g_clear_pointer (&self->action_names, g_strfreev);
g_clear_object (&self->settings);
g_clear_object (&self->settings_power);
- g_clear_object (&self->settings_brightness);
g_clear_signal_handler (&self->value_changed_id, self->adjustment);
g_clear_object (&self->adjustment);
@@ -771,18 +651,13 @@ static void
phosh_brightness_manager_init (PhoshBrightnessManager *self)
{
PhoshShell *shell = phosh_shell_get_default ();
+ GSettingsSchemaSource *source = g_settings_schema_source_get_default ();
+ g_autoptr (GSettingsSchema) schema = NULL;
PhoshAmbient *ambient = phosh_shell_get_ambient (phosh_shell_get_default ());
self->saved_brightness = -1.0;
self->icon_name = "display-brightness-symbolic";
- self->settings_power = g_settings_new (POWER_SCHEMA_ID);
-
- self->settings_brightness = g_settings_new (BRIGHTNESS_SCHEMA_ID);
- g_signal_connect_swapped (self->settings_brightness,
- "changed::" BRIGHTNESS_KEY_AUTO_BRIGHTNESS_OFFSET,
- G_CALLBACK (on_auto_brightness_offset_changed),
- self);
-
+ self->settings_power = g_settings_new (POWER_SCHEMA);
self->adjustment = g_object_ref_sink (gtk_adjustment_new (0, 0, 1.0, 0.01, 0.01, 0));
self->value_changed_id = g_signal_connect_swapped (self->adjustment,
"value-changed",
@@ -817,11 +692,13 @@ phosh_brightness_manager_init (PhoshBrightnessManager *self)
NULL);
}
- g_signal_connect_object (phosh_shell_get_monitor_manager (shell),
- "notify::night-light-temp",
- G_CALLBACK (on_night_light_temp_changed),
- self,
- G_CONNECT_SWAPPED);
+ /* TODO: Drop once we can rely on GNOME 49 schema for the keybindings */
+ schema = g_settings_schema_source_lookup (source, KEYBINDINGS_SCHEMA_ID, TRUE);
+ if (!schema)
+ return;
+
+ if (!g_settings_schema_has_key (schema, KEYBINDING_KEY_BRIGHTNESS_UP))
+ return;
self->settings = g_settings_new (KEYBINDINGS_SCHEMA_ID);
g_signal_connect_object (self->settings,
diff --git a/phosh/src/brightness-settings.c b/phosh/src/brightness-settings.c
index 41b61f9a3..0e05c5445 100644
--- a/phosh/src/brightness-settings.c
+++ b/phosh/src/brightness-settings.c
@@ -23,7 +23,7 @@
*/
struct _PhoshBrightnessSettings {
- GtkBin parent;
+ GtkWidget parent;
GtkSwitch *auto_switch;
GtkImage *image;
@@ -34,7 +34,7 @@ struct _PhoshBrightnessSettings {
GSettings *settings;
};
-G_DEFINE_TYPE (PhoshBrightnessSettings, phosh_brightness_settings, GTK_TYPE_BIN);
+G_DEFINE_TYPE (PhoshBrightnessSettings, phosh_brightness_settings, GTK_TYPE_WIDGET);
static void
@@ -51,6 +51,8 @@ phosh_brightness_settings_dispose (GObject *object)
g_clear_object (&self->settings);
+ gtk_widget_dispose_template (GTK_WIDGET (self), PHOSH_TYPE_BRIGHTNESS_SETTINGS);
+
G_OBJECT_CLASS (phosh_brightness_settings_parent_class)->dispose (object);
}
@@ -74,6 +76,8 @@ phosh_brightness_settings_class_init (PhoshBrightnessSettingsClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_auto_brightness_activated);
+ gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
+
gtk_widget_class_set_css_name (widget_class, "phosh-brightness-settings");
}
diff --git a/phosh/src/brightness-settings.h b/phosh/src/brightness-settings.h
index c7ccc1ebb..653a90ced 100644
--- a/phosh/src/brightness-settings.h
+++ b/phosh/src/brightness-settings.h
@@ -13,7 +13,7 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_BRIGHTNESS_SETTINGS phosh_brightness_settings_get_type ()
G_DECLARE_FINAL_TYPE (PhoshBrightnessSettings, phosh_brightness_settings, PHOSH,
- BRIGHTNESS_SETTINGS, GtkBin)
+ BRIGHTNESS_SETTINGS, GtkWidget)
GtkWidget *phosh_brightness_settings_new (void);
void phosh_brightness_settings_hide_details (PhoshBrightnessSettings *self);
diff --git a/phosh/src/bt-device-row.c b/phosh/src/bt-device-row.c
index 9026307cd..5fa7e6271 100644
--- a/phosh/src/bt-device-row.c
+++ b/phosh/src/bt-device-row.c
@@ -34,7 +34,7 @@ static guint signals[N_SIGNALS];
struct _PhoshBtDeviceRow {
- HdyActionRow parent;
+ AdwActionRow parent;
GtkWidget *icon;
GtkSpinner *spinner;
@@ -46,7 +46,7 @@ struct _PhoshBtDeviceRow {
GCancellable *cancellable;
};
-G_DEFINE_TYPE (PhoshBtDeviceRow, phosh_bt_device_row, HDY_TYPE_ACTION_ROW);
+G_DEFINE_TYPE (PhoshBtDeviceRow, phosh_bt_device_row, ADW_TYPE_ACTION_ROW);
static void
@@ -67,7 +67,7 @@ bat_level_cb (PhoshBtDeviceRow *self, GParamSpec *pspec, BluetoothDevice *device
NULL);
if (!connected || type != BLUETOOTH_BATTERY_TYPE_PERCENTAGE) {
- hdy_action_row_set_subtitle (HDY_ACTION_ROW (self), "");
+ adw_action_row_set_subtitle (ADW_ACTION_ROW (self), "");
self->bat_percentage = -1.0;
return;
}
@@ -79,7 +79,7 @@ bat_level_cb (PhoshBtDeviceRow *self, GParamSpec *pspec, BluetoothDevice *device
self->bat_percentage = current;
/* Translators: a battery level in percent */
subtitle = g_strdup_printf (_("Battery %.0f%%"), self->bat_percentage);
- hdy_action_row_set_subtitle (HDY_ACTION_ROW (self), subtitle);
+ adw_action_row_set_subtitle (ADW_ACTION_ROW (self), subtitle);
}
@@ -95,7 +95,7 @@ phosh_bt_device_row_set_device (PhoshBtDeviceRow *self, BluetoothDevice *device)
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
g_object_bind_property (self->device,
- "alias",
+ "name",
self,
"title",
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
@@ -113,10 +113,10 @@ phosh_bt_device_row_set_device (PhoshBtDeviceRow *self, BluetoothDevice *device)
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
g_object_connect (self->device,
- "swapped-object-signal::notify::battery-percentage", bat_level_cb, self,
- "swapped-object-signal::notify::battery-type", bat_level_cb, self,
- "swapped-object-signal::notify::connected", bat_level_cb, self,
- NULL);
+ "swapped-object-signal::notify::battery-percentage", bat_level_cb, self,
+ "swapped-object-signal::notify::battery-type", bat_level_cb, self,
+ "swapped-object-signal::notify::connected", bat_level_cb, self,
+ NULL);
bat_level_cb (self, NULL, device);
}
@@ -149,6 +149,8 @@ phosh_bt_device_row_dispose (GObject *object)
g_clear_object (&self->device);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_BT_DEVICE_ROW);
+
G_OBJECT_CLASS (phosh_bt_device_row_parent_class)->dispose (object);
}
@@ -180,7 +182,7 @@ on_bt_row_activated (PhoshBtDeviceRow *self)
gboolean connected;
g_autofree char *name = NULL;
- g_object_get (self->device, "connected", &connected, "alias", &name, NULL);
+ g_object_get (self->device, "connected", &connected, "name", &name, NULL);
g_cancellable_cancel (self->cancellable);
g_set_object (&self->cancellable, g_cancellable_new ());
diff --git a/phosh/src/bt-device-row.h b/phosh/src/bt-device-row.h
index dc965e9cd..b2aeeb162 100644
--- a/phosh/src/bt-device-row.h
+++ b/phosh/src/bt-device-row.h
@@ -8,12 +8,12 @@
#include "bluetooth-device.h"
-#include
+#include
G_BEGIN_DECLS
#define PHOSH_TYPE_BT_DEVICE_ROW phosh_bt_device_row_get_type ()
-G_DECLARE_FINAL_TYPE (PhoshBtDeviceRow, phosh_bt_device_row, PHOSH, BT_DEVICE_ROW, HdyActionRow)
+G_DECLARE_FINAL_TYPE (PhoshBtDeviceRow, phosh_bt_device_row, PHOSH, BT_DEVICE_ROW, AdwActionRow)
GtkWidget *phosh_bt_device_row_new (BluetoothDevice *device);
diff --git a/phosh/src/bt-manager.c b/phosh/src/bt-manager.c
index aa38d2a71..e7d0c8017 100644
--- a/phosh/src/bt-manager.c
+++ b/phosh/src/bt-manager.c
@@ -16,7 +16,6 @@
#include "dbus/gsd-rfkill-dbus.h"
#include "util.h"
-#include "gtk-list-models/gtkfilterlistmodel.h"
#include "gnome-bluetooth-enum-types.h"
#include "bluetooth-client.h"
#include "bluetooth-device.h"
@@ -56,6 +55,7 @@ struct _PhoshBtManager {
char *info;
BluetoothClient *bt_client;
+ GtkFilter *filter;
GtkFilterListModel *connectable_devices;
PhoshDBusRfkill *proxy;
@@ -331,7 +331,7 @@ refilter_cb (PhoshBtManager *self)
{
g_assert (PHOSH_IS_BT_MANAGER (self));
- gtk_filter_list_model_refilter (self->connectable_devices);
+ gtk_filter_changed (self->filter, GTK_FILTER_CHANGE_DIFFERENT);
}
@@ -409,10 +409,9 @@ setup_devices (PhoshBtManager *self)
/* Keep a list of connectable devices */
devices = bluetooth_client_get_devices (self->bt_client);
+ self->filter = GTK_FILTER (gtk_custom_filter_new (filter_devices, self, NULL));
self->connectable_devices = gtk_filter_list_model_new (G_LIST_MODEL (devices),
- filter_devices,
- self,
- NULL);
+ self->filter);
g_object_connect (self->bt_client,
"swapped-object-signal::device-added", on_device_added, self,
"swapped-object-signal::device-removed", on_device_removed, self,
diff --git a/phosh/src/bt-status-page.c b/phosh/src/bt-status-page.c
index 0797a1d62..d9000e71b 100644
--- a/phosh/src/bt-status-page.c
+++ b/phosh/src/bt-status-page.c
@@ -14,8 +14,6 @@
#include "bluetooth-device.h"
-#include
-
/**
* PhoshBtStatusPage:
*
@@ -85,6 +83,8 @@ phosh_bt_status_page_dispose (GObject *object)
g_clear_object (&self->bt_manager);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_BT_STATUS_PAGE);
+
G_OBJECT_CLASS (phosh_bt_status_page_parent_class)->dispose (object);
}
diff --git a/phosh/src/call-notification.c b/phosh/src/call-notification.c
index 60a713f94..9c8db3fe7 100644
--- a/phosh/src/call-notification.c
+++ b/phosh/src/call-notification.c
@@ -17,7 +17,7 @@
#include
#include
-#include
+#include
#include
/**
@@ -38,7 +38,7 @@ static GParamSpec *props[PROP_LAST_PROP];
struct _PhoshCallNotification {
GtkListBoxRow parent;
- HdyAvatar *avatar;
+ AdwAvatar *avatar;
GtkLabel *call_duration;
GtkLabel *call_state;
GtkLabel *caller;
@@ -231,6 +231,8 @@ phosh_call_notification_dispose (GObject *object)
g_clear_object (&self->call);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_CALL_NOTIFICATION);
+
G_OBJECT_CLASS (phosh_call_notification_parent_class)->dispose (object);
}
diff --git a/phosh/src/call.c b/phosh/src/call.c
index e87441a70..b89a3e4e9 100644
--- a/phosh/src/call.c
+++ b/phosh/src/call.c
@@ -49,7 +49,7 @@ typedef struct _PhoshCall {
PhoshDBusCallsCall *proxy; /* DBus proxy to a single call on gnome-calls' DBus service */
GCancellable *cancel;
- GLoadableIcon *avatar_icon;
+ GdkPaintable *avatar_icon;
gboolean can_dtmf;
GTimer *timer;
@@ -64,7 +64,7 @@ G_DEFINE_TYPE_WITH_CODE (PhoshCall, phosh_call, G_TYPE_OBJECT,
phosh_call_cui_call_interface_init))
-static GLoadableIcon *
+static GdkPaintable *
phosh_call_get_avatar_icon (CuiCall *call)
{
g_return_val_if_fail (PHOSH_IS_CALL (call), NULL);
@@ -279,14 +279,18 @@ phosh_call_constructed (GObject *object)
PhoshCall *self = PHOSH_CALL (object);
g_autoptr (GFile) file = NULL;
const char *path = NULL;
+ g_autoptr (GError) error = NULL;
G_OBJECT_CLASS (phosh_call_parent_class)->constructed (object);
path = phosh_dbus_calls_call_get_image_path (self->proxy);
if (!gm_str_is_null_or_empty (path)) {
file = g_file_new_for_path (path);
- if (file)
- self->avatar_icon = G_LOADABLE_ICON (g_file_icon_new (file));
+ if (file) {
+ self->avatar_icon = GDK_PAINTABLE (gdk_texture_new_from_file (file, &error));
+ if (error != NULL)
+ g_critical ("Failed to load avatar: %s", error->message);
+ }
}
/* Sync active property */
diff --git a/phosh/src/cell-broadcast-manager.c b/phosh/src/cell-broadcast-manager.c
index df341a3ab..08de4cdc9 100644
--- a/phosh/src/cell-broadcast-manager.c
+++ b/phosh/src/cell-broadcast-manager.c
@@ -72,7 +72,7 @@ on_new_cbm (PhoshCellBroadcastManager *self, const char *message, guint id)
return;
prompt = phosh_cell_broadcast_prompt_new (message, id_to_title (id));
- g_signal_connect (prompt, "closed", G_CALLBACK (gtk_widget_destroy), NULL);
+ g_signal_connect (prompt, "closed", G_CALLBACK (gtk_window_destroy), NULL);
gtk_widget_set_visible (prompt, TRUE);
phosh_trigger_feedback ("message-new-cellbroadcast");
phosh_shell_activate_action (phosh_shell_get_default (), "screensaver.wakeup-screen", NULL);
diff --git a/phosh/src/cell-broadcast-prompt.c b/phosh/src/cell-broadcast-prompt.c
index 256113ba2..9309e1652 100644
--- a/phosh/src/cell-broadcast-prompt.c
+++ b/phosh/src/cell-broadcast-prompt.c
@@ -120,6 +120,15 @@ on_dialog_canceled (PhoshCellBroadcastPrompt *self)
}
+static void
+phosh_cell_broadcast_prompt_dispose (GObject *object)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_CELL_BROADCAST_PROMPT);
+
+ G_OBJECT_CLASS (phosh_cell_broadcast_prompt_parent_class)->dispose (object);
+}
+
+
static void
phosh_cell_broadcast_prompt_finalize (GObject *obj)
{
@@ -139,6 +148,7 @@ phosh_cell_broadcast_prompt_class_init (PhoshCellBroadcastPromptClass *klass)
object_class->get_property = phosh_cell_broadcast_prompt_get_property;
object_class->set_property = phosh_cell_broadcast_prompt_set_property;
+ object_class->dispose = phosh_cell_broadcast_prompt_dispose;
object_class->finalize = phosh_cell_broadcast_prompt_finalize;
props[PROP_MESSAGE] =
diff --git a/phosh/src/clamp.c b/phosh/src/clamp.c
index 85048efd3..08f0ec96e 100644
--- a/phosh/src/clamp.c
+++ b/phosh/src/clamp.c
@@ -29,7 +29,7 @@ enum {
struct _PhoshClamp
{
- GtkBin parent_instance;
+ GtkWidget parent_instance;
gint natural_size;
@@ -38,7 +38,7 @@ struct _PhoshClamp
static GParamSpec *props[LAST_PROP];
-G_DEFINE_TYPE_WITH_CODE (PhoshClamp, phosh_clamp, GTK_TYPE_BIN,
+G_DEFINE_TYPE_WITH_CODE (PhoshClamp, phosh_clamp, GTK_TYPE_WIDGET,
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL))
static void
@@ -93,9 +93,19 @@ phosh_clamp_set_property (GObject *object,
}
}
-/* This private method is prefixed by the call name because it will be a virtual
- * method in GTK 4.
- */
+static void
+phosh_clamp_dispose (GObject *object)
+{
+ PhoshClamp *self = PHOSH_CLAMP (object);
+ GtkWidget *child;
+
+ child = gtk_widget_get_first_child (GTK_WIDGET (self));
+ if (child)
+ gtk_widget_unparent (child);
+
+ G_OBJECT_CLASS (phosh_clamp_parent_class)->dispose (object);
+}
+
static void
phosh_clamp_measure (GtkWidget *widget,
GtkOrientation orientation,
@@ -106,7 +116,6 @@ phosh_clamp_measure (GtkWidget *widget,
int *natural_baseline)
{
PhoshClamp *self = PHOSH_CLAMP (widget);
- GtkBin *bin = GTK_BIN (widget);
GtkWidget *child;
int child_min = 0;
int child_nat = 0;
@@ -122,33 +131,33 @@ phosh_clamp_measure (GtkWidget *widget,
if (natural_baseline)
*natural_baseline = -1;
- child = gtk_bin_get_child (bin);
+ child = gtk_widget_get_first_child (widget);
if (!child || !gtk_widget_is_visible (child))
return;
if (self->orientation == orientation) {
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_get_preferred_width (child, &child_min, &child_nat);
+ gtk_widget_measure (child, GTK_ORIENTATION_HORIZONTAL, -1, &child_min, &child_nat, NULL, NULL);
else
- gtk_widget_get_preferred_height_and_baseline_for_width (child, -1,
- &child_min,
- &child_nat,
- &child_min_baseline,
- &child_nat_baseline);
+ gtk_widget_measure (child, GTK_ORIENTATION_VERTICAL, -1,
+ &child_min,
+ &child_nat,
+ &child_min_baseline,
+ &child_nat_baseline);
child_nat = MIN (child_nat, self->natural_size);
child_nat = MAX (child_min, child_nat);
} else {
if (orientation == GTK_ORIENTATION_HORIZONTAL)
- gtk_widget_get_preferred_width_for_height (child, for_size,
- &child_min, &child_nat);
+ gtk_widget_measure (child, GTK_ORIENTATION_HORIZONTAL, for_size,
+ &child_min, &child_nat, NULL, NULL);
else
- gtk_widget_get_preferred_height_and_baseline_for_width (child, for_size,
- &child_min,
- &child_nat,
- &child_min_baseline,
- &child_nat_baseline);
+ gtk_widget_measure (child, GTK_ORIENTATION_VERTICAL, for_size,
+ &child_min,
+ &child_nat,
+ &child_min_baseline,
+ &child_nat_baseline);
}
if (minimum)
@@ -171,74 +180,35 @@ phosh_clamp_get_request_mode (GtkWidget *widget)
GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT;
}
-static void
-phosh_clamp_get_preferred_width_for_height (GtkWidget *widget,
- gint height,
- gint *minimum,
- gint *natural)
-{
- phosh_clamp_measure (widget, GTK_ORIENTATION_HORIZONTAL, height,
- minimum, natural, NULL, NULL);
-}
static void
-phosh_clamp_get_preferred_width (GtkWidget *widget,
- gint *minimum,
- gint *natural)
+phosh_clamp_size_allocate (GtkWidget *widget, int width, int height, int baseline)
{
- phosh_clamp_measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
- minimum, natural, NULL, NULL);
-}
+ GtkWidget *child;
+ GtkAllocation allocation = {0, 0, width, height};
-static void
-phosh_clamp_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
- gint width,
- gint *minimum,
- gint *natural,
- gint *minimum_baseline,
- gint *natural_baseline)
-{
- phosh_clamp_measure (widget, GTK_ORIENTATION_VERTICAL, width,
- minimum, natural, minimum_baseline, natural_baseline);
-}
+ child = gtk_widget_get_first_child (widget);
-static void
-phosh_clamp_get_preferred_height_for_width (GtkWidget *widget,
- gint width,
- gint *minimum,
- gint *natural)
-{
- phosh_clamp_measure (widget, GTK_ORIENTATION_VERTICAL, width,
- minimum, natural, NULL, NULL);
-}
+ if (!child)
+ return;
-static void
-phosh_clamp_get_preferred_height (GtkWidget *widget,
- gint *minimum,
- gint *natural)
-{
- phosh_clamp_measure (widget, GTK_ORIENTATION_VERTICAL, -1,
- minimum, natural, NULL, NULL);
+ gtk_widget_size_allocate (child, &allocation, baseline);
}
+
static void
phosh_clamp_class_init (PhoshClampClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
object_class->get_property = phosh_clamp_get_property;
object_class->set_property = phosh_clamp_set_property;
+ object_class->dispose = phosh_clamp_dispose;
widget_class->get_request_mode = phosh_clamp_get_request_mode;
- widget_class->get_preferred_width = phosh_clamp_get_preferred_width;
- widget_class->get_preferred_width_for_height = phosh_clamp_get_preferred_width_for_height;
- widget_class->get_preferred_height = phosh_clamp_get_preferred_height;
- widget_class->get_preferred_height_for_width = phosh_clamp_get_preferred_height_for_width;
- widget_class->get_preferred_height_and_baseline_for_width = phosh_clamp_get_preferred_height_and_baseline_for_width;
-
- gtk_container_class_handle_border_width (container_class);
+ widget_class->measure = phosh_clamp_measure;
+ widget_class->size_allocate = phosh_clamp_size_allocate;
g_object_class_override_property (object_class,
PROP_ORIENTATION,
diff --git a/phosh/src/clamp.h b/phosh/src/clamp.h
index 7b1d00edf..aa47d69dd 100644
--- a/phosh/src/clamp.h
+++ b/phosh/src/clamp.h
@@ -12,7 +12,7 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_CLAMP (phosh_clamp_get_type())
-G_DECLARE_FINAL_TYPE (PhoshClamp, phosh_clamp, PHOSH, CLAMP, GtkBin)
+G_DECLARE_FINAL_TYPE (PhoshClamp, phosh_clamp, PHOSH, CLAMP, GtkWidget)
GtkWidget *phosh_clamp_new (void);
gint phosh_clamp_get_natural_size (PhoshClamp *self);
diff --git a/phosh/src/connectivity-manager.c b/phosh/src/connectivity-manager.c
index 25bb720e1..61f757ff8 100644
--- a/phosh/src/connectivity-manager.c
+++ b/phosh/src/connectivity-manager.c
@@ -51,21 +51,35 @@ G_DEFINE_TYPE (PhoshConnectivityManager, phosh_connectivity_manager, PHOSH_TYPE_
static void
-on_notification_actioned (PhoshConnectivityManager *self)
+on_uri_launch_ready (GtkUriLauncher *launcher, GAsyncResult *result, gpointer user_data)
{
gboolean success;
- const char *check_uri;
g_autoptr (GError) err = NULL;
+ success = gtk_uri_launcher_launch_finish (launcher, result, &err);
+ if (!success)
+ g_warning ("Failed to show uri '%s': %s", gtk_uri_launcher_get_uri (launcher), err->message);
+}
+
+
+static void
+on_notification_actioned (PhoshConnectivityManager *self)
+{
+ const char *check_uri;
+ g_autoptr (GtkUriLauncher) launcher = NULL;
+
check_uri = nm_client_connectivity_check_get_uri (self->nmclient);
if (check_uri == NULL) {
g_warning ("No connectivity check URI configured");
return;
}
- success = gtk_show_uri_on_window (NULL, check_uri, GDK_CURRENT_TIME, &err);
- if (!success)
- g_warning ("Failed to show uri '%s': %s", check_uri, err->message);
+ launcher = gtk_uri_launcher_new (check_uri);
+ gtk_uri_launcher_launch (launcher,
+ NULL,
+ self->cancel,
+ (GAsyncReadyCallback) on_uri_launch_ready,
+ NULL);
}
diff --git a/phosh/src/dbus/meson.build b/phosh/src/dbus/meson.build
index ef97d0075..7a0c479ac 100644
--- a/phosh/src/dbus/meson.build
+++ b/phosh/src/dbus/meson.build
@@ -21,20 +21,6 @@ dbus_client_protos = [
false,
false,
],
- [
- 'accounts-user-dbus',
- 'org.freedesktop.Accounts.User.xml',
- 'org.freedesktop',
- false,
- false,
- ],
- [
- 'accounts-dbus',
- 'org.freedesktop.Accounts.xml',
- 'org.freedesktop',
- false,
- false,
- ],
[
'geoclue-manager-dbus',
'org.freedesktop.GeoClue2.Manager.xml',
diff --git a/phosh/src/dbus/org.freedesktop.Accounts.User.xml b/phosh/src/dbus/org.freedesktop.Accounts.User.xml
deleted file mode 100644
index 81129b842..000000000
--- a/phosh/src/dbus/org.freedesktop.Accounts.User.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
- The username of the user.
-
-
-
-
-
-
-
-
-
- The userʼs real name.
-
-
-
-
-
-
-
-
-
- The filename of a png file containing the userʼs icon.
-
-
-
-
-
-
-
diff --git a/phosh/src/dbus/org.freedesktop.Accounts.xml b/phosh/src/dbus/org.freedesktop.Accounts.xml
deleted file mode 100644
index 5ee7ff77f..000000000
--- a/phosh/src/dbus/org.freedesktop.Accounts.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
-
- The username to look up
-
-
- Object path of user
-
-
-
-
-
- Finds a user by its username.
-
-
-
- if no user with the given username exists
-
-
-
-
-
diff --git a/phosh/src/drag-surface.c b/phosh/src/drag-surface.c
index e803e5488..74abed91d 100644
--- a/phosh/src/drag-surface.c
+++ b/phosh/src/drag-surface.c
@@ -13,6 +13,7 @@
#include "phosh-enums.h"
#include "drag-surface.h"
#include "layersurface-priv.h"
+#include "phosh-wayland.h"
/**
* PhoshDragSurface:
@@ -28,7 +29,6 @@
enum {
PROP_0,
- PROP_LAYER_SHELL_EFFECTS,
PROP_MARGIN_FOLDED,
PROP_MARGIN_UNFOLDED,
PROP_THRESHOLD,
@@ -49,7 +49,6 @@ static guint signals[N_SIGNALS] = { 0 };
typedef struct _PhoshDragSurfacePrivate {
- struct zphoc_layer_shell_effects_v1 *layer_shell_effects;
struct zphoc_draggable_layer_surface_v1 *drag_surface;
int margin_folded;
@@ -74,9 +73,6 @@ phosh_drag_surface_set_property (GObject *object,
PhoshDragSurfacePrivate *priv = phosh_drag_surface_get_instance_private (self);
switch (property_id) {
- case PROP_LAYER_SHELL_EFFECTS:
- priv->layer_shell_effects = g_value_get_pointer (value);
- break;
case PROP_MARGIN_FOLDED:
phosh_drag_surface_set_margin (self, g_value_get_int (value), priv->margin_unfolded);
break;
@@ -112,9 +108,6 @@ phosh_drag_surface_get_property (GObject *object,
PhoshDragSurfacePrivate *priv = phosh_drag_surface_get_instance_private (self);
switch (property_id) {
- case PROP_LAYER_SHELL_EFFECTS:
- g_value_set_pointer (value, priv->layer_shell_effects);
- break;
case PROP_MARGIN_FOLDED:
g_value_set_int (value, priv->margin_folded);
break;
@@ -197,6 +190,7 @@ phosh_drag_surface_configured (PhoshLayerSurface *layer_surface)
PhoshLayerSurfaceClass *parent_class = PHOSH_LAYER_SURFACE_CLASS (phosh_drag_surface_parent_class);
PhoshDragSurfacePrivate *priv = phosh_drag_surface_get_instance_private (self);
struct zwlr_layer_surface_v1 *wl_layer_surface = phosh_layer_surface_get_layer_surface (layer_surface);
+ struct zphoc_layer_shell_effects_v1 *layer_shell_effects;
if (parent_class->configured)
parent_class->configured (layer_surface);
@@ -204,8 +198,9 @@ phosh_drag_surface_configured (PhoshLayerSurface *layer_surface)
if (priv->drag_surface)
return;
+ layer_shell_effects = phosh_wayland_get_zphoc_layer_shell_effects_v1 (phosh_wayland_get_default ());
/* Configure drag surface if not done yet */
- priv->drag_surface = zphoc_layer_shell_effects_v1_get_draggable_layer_surface (priv->layer_shell_effects,
+ priv->drag_surface = zphoc_layer_shell_effects_v1_get_draggable_layer_surface (layer_shell_effects,
wl_layer_surface);
zphoc_draggable_layer_surface_v1_add_listener (priv->drag_surface, &drag_surface_listener, self);
}
@@ -290,13 +285,6 @@ phosh_drag_surface_class_init (PhoshDragSurfaceClass *klass)
layer_surface_class->configured = phosh_drag_surface_configured;
- props[PROP_LAYER_SHELL_EFFECTS] = g_param_spec_pointer ("layer-shell-effects",
- "",
- "",
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT_ONLY |
- G_PARAM_STATIC_STRINGS);
-
props[PROP_MARGIN_FOLDED] = g_param_spec_int ("margin-folded",
"",
"",
diff --git a/phosh/src/emergency-contact-row.c b/phosh/src/emergency-contact-row.c
index 184c3af43..ec58d7e13 100644
--- a/phosh/src/emergency-contact-row.c
+++ b/phosh/src/emergency-contact-row.c
@@ -36,7 +36,7 @@
* the contact object.
*/
struct _PhoshEmergencyContactRow {
- HdyActionRow parent;
+ AdwActionRow parent;
GtkLabel *name_label;
GtkLabel *id_label;
@@ -44,7 +44,7 @@ struct _PhoshEmergencyContactRow {
PhoshEmergencyContact *contact;
};
-G_DEFINE_TYPE (PhoshEmergencyContactRow, phosh_emergency_contact_row, HDY_TYPE_ACTION_ROW)
+G_DEFINE_TYPE (PhoshEmergencyContactRow, phosh_emergency_contact_row, ADW_TYPE_ACTION_ROW)
enum {
@@ -115,6 +115,8 @@ emergency_contact_row_dispose (GObject *object)
g_clear_object (&self->contact);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_EMERGENCY_CONTACT_ROW);
+
G_OBJECT_CLASS (phosh_emergency_contact_row_parent_class)->dispose (object);
}
diff --git a/phosh/src/emergency-contact-row.h b/phosh/src/emergency-contact-row.h
index 0616d34bf..0e6d97627 100644
--- a/phosh/src/emergency-contact-row.h
+++ b/phosh/src/emergency-contact-row.h
@@ -11,14 +11,14 @@
#include "emergency-contact.h"
#include "emergency-calls-manager.h"
-#include
+#include
#include
G_BEGIN_DECLS
#define PHOSH_TYPE_EMERGENCY_CONTACT_ROW (phosh_emergency_contact_row_get_type ())
-G_DECLARE_FINAL_TYPE (PhoshEmergencyContactRow, phosh_emergency_contact_row, PHOSH, EMERGENCY_CONTACT_ROW, HdyActionRow)
+G_DECLARE_FINAL_TYPE (PhoshEmergencyContactRow, phosh_emergency_contact_row, PHOSH, EMERGENCY_CONTACT_ROW, AdwActionRow)
PhoshEmergencyContactRow *phosh_emergency_contact_row_new (PhoshEmergencyContact *contact);
void phosh_emergency_contact_row_call (PhoshEmergencyContactRow *self,
diff --git a/phosh/src/emergency-menu.c b/phosh/src/emergency-menu.c
index 9dd32b62c..e63e6c9da 100644
--- a/phosh/src/emergency-menu.c
+++ b/phosh/src/emergency-menu.c
@@ -18,7 +18,7 @@
#include "util.h"
#include
-#include
+#include
/**
@@ -54,7 +54,7 @@ struct _PhoshEmergencyMenu {
PhoshEmergencyCallsManager *manager;
- HdyCarousel *emergency_carousel;
+ AdwCarousel *emergency_carousel;
GtkBox *emergency_dialpad_box;
GtkBox *emergency_info_box;
GtkListBox *emergency_contacts_list_box;
@@ -76,7 +76,7 @@ on_go_back_activated (GSimpleAction *action, GVariant *param, gpointer data)
if (close) {
g_signal_emit (self, signals[DONE], 0);
} else {
- hdy_carousel_scroll_to (self->emergency_carousel, GTK_WIDGET (self->emergency_dialpad_box));
+ adw_carousel_scroll_to (self->emergency_carousel, GTK_WIDGET (self->emergency_dialpad_box), TRUE);
}
}
@@ -103,13 +103,13 @@ on_dial_error (PhoshEmergencyMenu *self, GError *error)
gtk_label_set_label (GTK_LABEL (error_label), error->message);
else
gtk_label_set_label (GTK_LABEL (error_label), _("Internal error"));
- gtk_label_set_line_wrap (GTK_LABEL (error_label), TRUE);
+ gtk_label_set_wrap (GTK_LABEL (error_label), TRUE);
phosh_system_modal_dialog_set_content (error_dialog, error_label);
- g_signal_connect_swapped (ok_button, "clicked", G_CALLBACK (gtk_widget_destroy), error_dialog);
+ g_signal_connect_swapped (ok_button, "clicked", G_CALLBACK (gtk_window_destroy), error_dialog);
g_signal_connect_swapped (error_dialog,
"dialog-canceled",
- G_CALLBACK (gtk_widget_destroy),
+ G_CALLBACK (gtk_window_destroy),
error_dialog);
gtk_widget_set_visible (error_label, TRUE);
@@ -179,6 +179,8 @@ emergency_menu_dispose (GObject *object)
g_clear_object (&self->actions);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_EMERGENCY_MENU);
+
G_OBJECT_CLASS (phosh_emergency_menu_parent_class)->dispose (object);
}
@@ -210,7 +212,7 @@ static void
on_emergency_contacts_button_clicked (PhoshEmergencyMenu *self)
{
g_debug ("Emergency info button pressed");
- hdy_carousel_scroll_to (self->emergency_carousel, GTK_WIDGET (self->emergency_info_box));
+ adw_carousel_scroll_to (self->emergency_carousel, GTK_WIDGET (self->emergency_info_box), TRUE);
}
diff --git a/phosh/src/end-session-dialog.c b/phosh/src/end-session-dialog.c
index 474ecfa45..83cd607fd 100644
--- a/phosh/src/end-session-dialog.c
+++ b/phosh/src/end-session-dialog.c
@@ -325,7 +325,7 @@ add_inhibitor (PhoshEndSessionDialog *self, GDBusProxy *inhibitor)
"label", name,
"valign", GTK_ALIGN_END,
NULL);
- gtk_box_pack_start (GTK_BOX (box_text), label, TRUE, TRUE, 0);
+ gtk_box_prepend (GTK_BOX (box_text), label);
if (reason) {
lbl_reason = g_object_new (GTK_TYPE_LABEL,
@@ -336,7 +336,7 @@ add_inhibitor (PhoshEndSessionDialog *self, GDBusProxy *inhibitor)
"label", reason,
"valign", GTK_ALIGN_START,
NULL);
- gtk_box_pack_end (GTK_BOX (box_text), lbl_reason, TRUE, TRUE, 0);
+ gtk_box_append (GTK_BOX (box_text), lbl_reason);
} else {
gtk_widget_set_valign (label, GTK_ALIGN_FILL);
}
@@ -349,8 +349,8 @@ add_inhibitor (PhoshEndSessionDialog *self, GDBusProxy *inhibitor)
"spacing", 12,
NULL);
- gtk_box_pack_start (GTK_BOX (box), img, TRUE, TRUE, 0);
- gtk_box_pack_end (GTK_BOX (box), box_text, FALSE, FALSE, 0);
+ gtk_box_prepend (GTK_BOX (box), img);
+ gtk_box_append (GTK_BOX (box), box_text);
gtk_list_box_insert (GTK_LIST_BOX (self->listbox), GTK_WIDGET (box), -1);
gtk_widget_set_visible (GTK_WIDGET (self->sw_inhibitors), TRUE);
@@ -385,9 +385,7 @@ clear_inhibitors (PhoshEndSessionDialog *self)
g_return_if_fail (GTK_IS_LIST_BOX (self->listbox));
- children = gtk_container_get_children (GTK_CONTAINER (self->listbox));
- for (GList *child = children; child; child = child->next)
- gtk_container_remove (GTK_CONTAINER (self->listbox), child->data);
+ gtk_list_box_remove_all (GTK_LIST_BOX (self->listbox));
gtk_widget_set_visible (self->sw_inhibitors, FALSE);
}
@@ -477,6 +475,8 @@ phosh_end_session_dialog_dispose (GObject *obj)
if (self->listbox)
clear_inhibitors (self);
+ gtk_widget_dispose_template (GTK_WIDGET (obj), PHOSH_TYPE_END_SESSION_DIALOG);
+
G_OBJECT_CLASS (phosh_end_session_dialog_parent_class)->dispose (obj);
}
diff --git a/phosh/src/fader.c b/phosh/src/fader.c
index d7efcd14d..cb53b7eb5 100644
--- a/phosh/src/fader.c
+++ b/phosh/src/fader.c
@@ -14,7 +14,7 @@
#include "layersurface-priv.h"
#include "shell-priv.h"
-#include
+#include
/**
* PhoshFader:
@@ -60,7 +60,7 @@ fadeout_value_cb (double value, PhoshFader *self)
static void
fadeout_done_cb (GtkWidget *self)
{
- gtk_widget_destroy (self);
+ gtk_window_destroy (GTK_WINDOW (self));
}
@@ -126,16 +126,14 @@ phosh_fader_show (GtkWidget *widget)
{
PhoshFader *self = PHOSH_FADER (widget);
gboolean enable_animations;
- GtkStyleContext *context;
- enable_animations = hdy_get_enable_animations (widget);
+ enable_animations = adw_get_enable_animations (widget);
if (enable_animations) {
const char *style_class;
style_class = self->style_class ?: PHOSH_FADER_DEFAULT_STYLE_CLASS;
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_add_class (context, style_class);
+ gtk_widget_add_css_class (widget, style_class);
}
GTK_WIDGET_CLASS (phosh_fader_parent_class)->show (widget);
@@ -165,7 +163,6 @@ phosh_fader_constructed (GObject *object)
self->monitor = g_object_ref (phosh_shell_get_primary_monitor (phosh_shell_get_default ()));
g_object_set (PHOSH_LAYER_SURFACE (self),
- "layer-shell", phosh_wayland_get_zwlr_layer_shell_v1 (wl),
"wl-output", phosh_monitor_get_wl_output (self->monitor),
"anchor", ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
@@ -251,7 +248,7 @@ phosh_fader_hide (PhoshFader *self)
g_return_if_fail (PHOSH_IS_FADER (self));
if (self->fade_out_time == 0) {
- gtk_widget_destroy (GTK_WIDGET (self));
+ gtk_window_destroy (GTK_WINDOW (self));
return;
}
diff --git a/phosh/src/fading-label.c b/phosh/src/fading-label.c
index 741134bad..da15c1732 100644
--- a/phosh/src/fading-label.c
+++ b/phosh/src/fading-label.c
@@ -24,14 +24,14 @@
struct _PhoshFadingLabel
{
- GtkBin parent_instance;
+ GtkWidget parent_instance;
GtkWidget *label;
gfloat align;
cairo_pattern_t *gradient;
};
-G_DEFINE_TYPE (PhoshFadingLabel, phosh_fading_label, GTK_TYPE_BIN)
+G_DEFINE_TYPE (PhoshFadingLabel, phosh_fading_label, GTK_TYPE_WIDGET)
enum {
PROP_0,
@@ -72,88 +72,91 @@ ensure_gradient (PhoshFadingLabel *self)
}
static void
-phosh_fading_label_get_preferred_width (GtkWidget *widget,
- gint *min,
- gint *nat)
+phosh_fading_label_measure (GtkWidget *widget,
+ GtkOrientation orientation,
+ int for_size,
+ int *minimum,
+ int *natural,
+ int *minimum_baseline,
+ int *natural_baseline)
{
PhoshFadingLabel *self = PHOSH_FADING_LABEL (widget);
- gtk_widget_get_preferred_width (self->label, min, nat);
+ gtk_widget_measure (self->label,
+ orientation,
+ for_size,
+ minimum, natural,
+ minimum_baseline, natural_baseline);
- if (min)
- *min = 0;
-}
-
-static void
-phosh_fading_label_get_preferred_width_for_height (GtkWidget *widget,
- gint for_height,
- gint *min,
- gint *nat)
-{
- phosh_fading_label_get_preferred_width (widget, min, nat);
+ if (orientation == GTK_ORIENTATION_HORIZONTAL) {
+ if (minimum)
+ *minimum = 0;
+ }
}
static void
-phosh_fading_label_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
+phosh_fading_label_size_allocate (GtkWidget *widget,
+ int width,
+ int height,
+ int baseline)
{
PhoshFadingLabel *self = PHOSH_FADING_LABEL (widget);
gfloat align = is_rtl (self) ? 1 - self->align : self->align;
GtkAllocation child_allocation;
gint child_width;
- gtk_widget_set_allocation (widget, allocation);
-
- phosh_fading_label_get_preferred_width (widget, NULL, &child_width);
+ phosh_fading_label_measure (widget,
+ GTK_ORIENTATION_HORIZONTAL,
+ -1,
+ NULL, &child_width,
+ NULL, NULL);
- child_allocation.x = allocation->x + (gint) ((allocation->width - child_width) * align);
- child_allocation.y = allocation->y;
+ child_allocation.x = (gint) ((width - child_width) * align);
+ child_allocation.y = 0;
child_allocation.width = child_width;
- child_allocation.height = allocation->height;
+ child_allocation.height = height;
- gtk_widget_size_allocate (self->label, &child_allocation);
-
- gtk_widget_get_clip (self->label, &child_allocation);
- child_allocation.x = allocation->x;
- child_allocation.width = allocation->width;
- gtk_widget_set_clip (self->label, &child_allocation);
+ gtk_widget_size_allocate (self->label, &child_allocation, baseline);
}
-static gboolean
-phosh_fading_label_draw (GtkWidget *widget,
- cairo_t *cr)
+static void
+phosh_fading_label_snapshot (GtkWidget *widget,
+ GtkSnapshot *snapshot)
{
PhoshFadingLabel *self = PHOSH_FADING_LABEL (widget);
+ cairo_t *cr;
gfloat align = is_rtl (self) ? 1 - self->align : self->align;
- GtkAllocation clip, alloc;
- int child_width = gtk_widget_get_allocated_width (self->label);
+ graphene_rect_t clip, alloc;
+ int child_width = gtk_widget_get_width (self->label);
- gtk_widget_get_allocation (widget, &alloc);
+ g_return_if_fail (gtk_widget_compute_bounds (widget, widget, &alloc));
- if (child_width <= alloc.width) {
- gtk_container_propagate_draw (GTK_CONTAINER (widget), self->label, cr);
-
- return GDK_EVENT_PROPAGATE;
+ if (child_width <= alloc.size.width) {
+ gtk_widget_snapshot_child (widget, self->label, snapshot);
+ return;
}
ensure_gradient (self);
- gtk_widget_get_clip (self->label, &clip);
- clip.x = 0;
- clip.y -= alloc.y;
- clip.width = alloc.width;
+ g_return_if_fail (gtk_widget_compute_bounds (widget, widget, &clip));
+ clip.origin.x = 0;
+ clip.origin.y -= alloc.origin.y;
+ clip.size.width = alloc.size.width;
+
+ gtk_snapshot_push_clip (snapshot, &alloc);
+ cr = gtk_snapshot_append_cairo (snapshot, &alloc);
cairo_save (cr);
- cairo_rectangle (cr, clip.x, clip.y, clip.width, clip.height);
+ cairo_rectangle (cr, clip.origin.x, clip.origin.y, clip.size.width, clip.size.height);
cairo_clip (cr);
cairo_push_group (cr);
- gtk_container_propagate_draw (GTK_CONTAINER (widget), self->label, cr);
+ gtk_widget_snapshot_child (widget, self->label, snapshot);
if (align > 0) {
cairo_save (cr);
- cairo_translate (cr, clip.x + FADE_WIDTH, clip.y);
- cairo_scale (cr, -FADE_WIDTH, clip.height);
+ cairo_translate (cr, clip.origin.x + FADE_WIDTH, clip.origin.y);
+ cairo_scale (cr, -FADE_WIDTH, clip.size.height);
cairo_set_source (cr, self->gradient);
cairo_rectangle (cr, 0, 0, 1, 1);
cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OUT);
@@ -162,8 +165,8 @@ phosh_fading_label_draw (GtkWidget *widget,
}
if (align < 1) {
- cairo_translate (cr, clip.x + clip.width - FADE_WIDTH, clip.y);
- cairo_scale (cr, FADE_WIDTH, clip.height);
+ cairo_translate (cr, clip.origin.x + clip.size.width - FADE_WIDTH, clip.origin.y);
+ cairo_scale (cr, FADE_WIDTH, clip.size.height);
cairo_set_source (cr, self->gradient);
cairo_rectangle (cr, 0, 0, 1, 1);
cairo_set_operator (cr, CAIRO_OPERATOR_DEST_OUT);
@@ -174,8 +177,8 @@ phosh_fading_label_draw (GtkWidget *widget,
cairo_paint (cr);
cairo_restore (cr);
-
- return GDK_EVENT_PROPAGATE;
+ cairo_destroy (cr);
+ gtk_snapshot_pop (snapshot);
}
static void
@@ -222,6 +225,16 @@ phosh_fading_label_set_property (GObject *object,
}
}
+static void
+phosh_fading_label_dispose (GObject *object)
+{
+ PhoshFadingLabel *self = PHOSH_FADING_LABEL (object);
+
+ g_clear_pointer (&self->label, gtk_widget_unparent);
+
+ G_OBJECT_CLASS (phosh_fading_label_parent_class)->dispose (object);
+}
+
static void
phosh_fading_label_finalize (GObject *object)
{
@@ -240,12 +253,12 @@ phosh_fading_label_class_init (PhoshFadingLabelClass *klass)
object_class->get_property = phosh_fading_label_get_property;
object_class->set_property = phosh_fading_label_set_property;
+ object_class->dispose = phosh_fading_label_dispose;
object_class->finalize = phosh_fading_label_finalize;
- widget_class->get_preferred_width = phosh_fading_label_get_preferred_width;
- widget_class->get_preferred_width_for_height = phosh_fading_label_get_preferred_width_for_height;
+ widget_class->measure = phosh_fading_label_measure;
widget_class->size_allocate = phosh_fading_label_size_allocate;
- widget_class->draw = phosh_fading_label_draw;
+ widget_class->snapshot = phosh_fading_label_snapshot;
props[PROP_LABEL] =
g_param_spec_string ("label", "", "",
@@ -263,13 +276,10 @@ phosh_fading_label_class_init (PhoshFadingLabelClass *klass)
static void
phosh_fading_label_init (PhoshFadingLabel *self)
{
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
-
self->label = gtk_label_new (NULL);
gtk_widget_set_visible (self->label, TRUE);
gtk_label_set_single_line_mode (GTK_LABEL (self->label), TRUE);
-
- gtk_container_add (GTK_CONTAINER (self), self->label);
+ gtk_widget_set_parent (self->label, GTK_WIDGET (self));
}
GtkWidget *
diff --git a/phosh/src/fading-label.h b/phosh/src/fading-label.h
index 1df288bf0..5f73945c6 100644
--- a/phosh/src/fading-label.h
+++ b/phosh/src/fading-label.h
@@ -14,7 +14,7 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_FADING_LABEL (phosh_fading_label_get_type())
-G_DECLARE_FINAL_TYPE (PhoshFadingLabel, phosh_fading_label, PHOSH, FADING_LABEL, GtkBin)
+G_DECLARE_FINAL_TYPE (PhoshFadingLabel, phosh_fading_label, PHOSH, FADING_LABEL, GtkWidget)
GtkWidget *phosh_fading_label_new (const char *label);
const char *phosh_fading_label_get_label (PhoshFadingLabel *self);
diff --git a/phosh/src/folder-info.c b/phosh/src/folder-info.c
index 2e2d8a5e6..eff8cad82 100644
--- a/phosh/src/folder-info.c
+++ b/phosh/src/folder-info.c
@@ -12,7 +12,6 @@
#include "util.h"
#include "favorite-list-model.h"
-#include "gtk-list-models/gtkfilterlistmodel.h"
#include
@@ -52,6 +51,7 @@ struct _PhoshFolderInfo {
GListStore *app_infos;
/* Filters the above to show only required apps,
* like non-favorite etc. */
+ GtkFilter *filter;
GtkFilterListModel *filtered_app_infos;
PhoshFavoriteListModel *favorites;
@@ -259,7 +259,6 @@ phosh_folder_info_dispose (GObject *object)
g_clear_pointer (&self->path, g_free);
g_clear_pointer (&self->name, g_free);
g_clear_object (&self->filtered_app_infos);
- g_clear_object (&self->app_infos);
g_clear_object (&self->settings);
G_OBJECT_CLASS (phosh_folder_info_parent_class)->dispose (object);
@@ -275,11 +274,10 @@ phosh_folder_info_constructed (GObject *object)
G_OBJECT_CLASS (phosh_folder_info_parent_class)->constructed (object);
self->app_infos = g_list_store_new (G_TYPE_APP_INFO);
+ self->filter = GTK_FILTER (gtk_custom_filter_new (filter_app, self, NULL));
self->favorites = phosh_favorite_list_model_get_default ();
self->filtered_app_infos = gtk_filter_list_model_new (G_LIST_MODEL (self->app_infos),
- filter_app,
- self,
- NULL);
+ self->filter);
path = g_strconcat (FOLDERS_PREFIX, "/", self->path, "/", NULL);
self->settings = g_settings_new_with_path (FOLDER_SCHEMA_ID, path);
@@ -290,7 +288,6 @@ phosh_folder_info_constructed (GObject *object)
on_settings_name_changed (self, NULL, NULL);
load_apps (self);
- gtk_filter_list_model_refilter (self->filtered_app_infos);
}
static void
@@ -423,7 +420,7 @@ phosh_folder_info_refilter (PhoshFolderInfo *self, const char *search)
g_return_val_if_fail (PHOSH_IS_FOLDER_INFO (self), FALSE);
self->search = search;
- gtk_filter_list_model_refilter (self->filtered_app_infos);
+ gtk_filter_changed (self->filter, GTK_FILTER_CHANGE_DIFFERENT);
self->search = NULL;
item = g_list_model_get_item (G_LIST_MODEL (self->filtered_app_infos), 0);
diff --git a/phosh/src/gtk-list-models/gtkfilterlistmodel.c b/phosh/src/gtk-list-models/gtkfilterlistmodel.c
deleted file mode 100644
index 022194322..000000000
--- a/phosh/src/gtk-list-models/gtkfilterlistmodel.c
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
- * Copyright © 2018 Benjamin Otte
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see .
- *
- * Authors: Benjamin Otte
- */
-
-#include "phosh-config.h"
-
-#include "gtkfilterlistmodel.h"
-
-#include "gtkrbtreeprivate.h"
-
-#include
-
-/**
- * SECTION:gtkfilterlistmodel
- * @title: GtkFilterListModel
- * @short_description: A list model that filters its items
- * @see_also: #GListModel
- *
- * #GtkFilterListModel is a list model that filters a given other
- * listmodel.
- * It hides some elements from the other model according to
- * criteria given by a #GtkFilterListModelFilterFunc.
- */
-
-enum {
- PROP_0,
- PROP_HAS_FILTER,
- PROP_ITEM_TYPE,
- PROP_MODEL,
- NUM_PROPERTIES
-};
-
-typedef struct _FilterNode FilterNode;
-typedef struct _FilterAugment FilterAugment;
-
-struct _FilterNode
-{
- guint visible : 1;
-};
-
-struct _FilterAugment
-{
- guint n_items;
- guint n_visible;
-};
-
-struct _GtkFilterListModel
-{
- GObject parent_instance;
-
- GType item_type;
- GListModel *model;
- GtkFilterListModelFilterFunc filter_func;
- gpointer user_data;
- GDestroyNotify user_destroy;
-
- GtkRbTree *items; /* NULL if filter_func == NULL */
-};
-
-struct _GtkFilterListModelClass
-{
- GObjectClass parent_class;
-};
-
-static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
-
-static FilterNode *
-gtk_filter_list_model_get_nth_filtered (GtkRbTree *tree,
- guint position,
- guint *out_unfiltered)
-{
- FilterNode *node, *tmp;
- guint unfiltered;
-
- node = gtk_rb_tree_get_root (tree);
- unfiltered = 0;
-
- while (node)
- {
- tmp = gtk_rb_tree_node_get_left (node);
- if (tmp)
- {
- FilterAugment *aug = gtk_rb_tree_get_augment (tree, tmp);
- if (position < aug->n_visible)
- {
- node = tmp;
- continue;
- }
- position -= aug->n_visible;
- unfiltered += aug->n_items;
- }
-
- if (node->visible)
- {
- if (position == 0)
- break;
- position--;
- }
-
- unfiltered++;
-
- node = gtk_rb_tree_node_get_right (node);
- }
-
- if (out_unfiltered)
- *out_unfiltered = unfiltered;
-
- return node;
-}
-
-static FilterNode *
-gtk_filter_list_model_get_nth (GtkRbTree *tree,
- guint position,
- guint *out_filtered)
-{
- FilterNode *node, *tmp;
- guint filtered;
-
- node = gtk_rb_tree_get_root (tree);
- filtered = 0;
-
- while (node)
- {
- tmp = gtk_rb_tree_node_get_left (node);
- if (tmp)
- {
- FilterAugment *aug = gtk_rb_tree_get_augment (tree, tmp);
- if (position < aug->n_items)
- {
- node = tmp;
- continue;
- }
- position -= aug->n_items;
- filtered += aug->n_visible;
- }
-
- if (position == 0)
- break;
-
- position--;
- if (node->visible)
- filtered++;
-
- node = gtk_rb_tree_node_get_right (node);
- }
-
- if (out_filtered)
- *out_filtered = filtered;
-
- return node;
-}
-
-static GType
-gtk_filter_list_model_get_item_type (GListModel *list)
-{
- GtkFilterListModel *self = GTK_FILTER_LIST_MODEL (list);
-
- return self->item_type;
-}
-
-static guint
-gtk_filter_list_model_get_n_items (GListModel *list)
-{
- GtkFilterListModel *self = GTK_FILTER_LIST_MODEL (list);
- FilterAugment *aug;
- FilterNode *node;
-
- if (self->model == NULL)
- return 0;
-
- if (!self->items)
- return g_list_model_get_n_items (self->model);
-
- node = gtk_rb_tree_get_root (self->items);
- if (node == NULL)
- return 0;
-
- aug = gtk_rb_tree_get_augment (self->items, node);
- return aug->n_visible;
-}
-
-static gpointer
-gtk_filter_list_model_get_item (GListModel *list,
- guint position)
-{
- GtkFilterListModel *self = GTK_FILTER_LIST_MODEL (list);
- guint unfiltered;
-
- if (self->model == NULL)
- return NULL;
-
- if (self->items)
- gtk_filter_list_model_get_nth_filtered (self->items, position, &unfiltered);
- else
- unfiltered = position;
-
- return g_list_model_get_item (self->model, unfiltered);
-}
-
-static void
-gtk_filter_list_model_model_init (GListModelInterface *iface)
-{
- iface->get_item_type = gtk_filter_list_model_get_item_type;
- iface->get_n_items = gtk_filter_list_model_get_n_items;
- iface->get_item = gtk_filter_list_model_get_item;
-}
-
-G_DEFINE_TYPE_WITH_CODE (GtkFilterListModel, gtk_filter_list_model, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_filter_list_model_model_init))
-
-static gboolean
-gtk_filter_list_model_run_filter (GtkFilterListModel *self,
- guint position)
-{
- gpointer item;
- gboolean visible;
-
- item = g_list_model_get_item (self->model, position);
- visible = self->filter_func (item, self->user_data);
- g_object_unref (item);
-
- return visible;
-}
-
-static guint
-gtk_filter_list_model_add_items (GtkFilterListModel *self,
- FilterNode *after,
- guint position,
- guint n_items)
-{
- FilterNode *node;
- guint i, n_visible;
-
- n_visible = 0;
-
- for (i = 0; i < n_items; i++)
- {
- node = gtk_rb_tree_insert_before (self->items, after);
- node->visible = gtk_filter_list_model_run_filter (self, position + i);
- if (node->visible)
- n_visible++;
- }
-
- return n_visible;
-}
-
-static void
-gtk_filter_list_model_items_changed_cb (GListModel *model,
- guint position,
- guint removed,
- guint added,
- GtkFilterListModel *self)
-{
- FilterNode *node;
- guint i, filter_position, filter_removed, filter_added;
-
- if (self->items == NULL)
- {
- g_list_model_items_changed (G_LIST_MODEL (self), position, removed, added);
- return;
- }
-
- node = gtk_filter_list_model_get_nth (self->items, position, &filter_position);
-
- filter_removed = 0;
- for (i = 0; i < removed; i++)
- {
- FilterNode *next = gtk_rb_tree_node_get_next (node);
- if (node->visible)
- filter_removed++;
- gtk_rb_tree_remove (self->items, node);
- node = next;
- }
-
- filter_added = gtk_filter_list_model_add_items (self, node, position, added);
-
- if (filter_removed > 0 || filter_added > 0)
- g_list_model_items_changed (G_LIST_MODEL (self), filter_position, filter_removed, filter_added);
-}
-
-static void
-gtk_filter_list_model_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GtkFilterListModel *self = GTK_FILTER_LIST_MODEL (object);
-
- switch (prop_id)
- {
- case PROP_ITEM_TYPE:
- self->item_type = g_value_get_gtype (value);
- break;
-
- case PROP_MODEL:
- gtk_filter_list_model_set_model (self, g_value_get_object (value));
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-gtk_filter_list_model_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GtkFilterListModel *self = GTK_FILTER_LIST_MODEL (object);
-
- switch (prop_id)
- {
- case PROP_HAS_FILTER:
- g_value_set_boolean (value, self->items != NULL);
- break;
-
- case PROP_ITEM_TYPE:
- g_value_set_gtype (value, self->item_type);
- break;
-
- case PROP_MODEL:
- g_value_set_object (value, self->model);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-gtk_filter_list_model_clear_model (GtkFilterListModel *self)
-{
- if (self->model == NULL)
- return;
-
- g_signal_handlers_disconnect_by_func (self->model, gtk_filter_list_model_items_changed_cb, self);
- g_clear_object (&self->model);
- if (self->items)
- gtk_rb_tree_remove_all (self->items);
-}
-
-static void
-gtk_filter_list_model_dispose (GObject *object)
-{
- GtkFilterListModel *self = GTK_FILTER_LIST_MODEL (object);
-
- gtk_filter_list_model_clear_model (self);
- if (self->user_destroy)
- self->user_destroy (self->user_data);
- self->filter_func = NULL;
- self->user_data = NULL;
- self->user_destroy = NULL;
- g_clear_pointer (&self->items, gtk_rb_tree_unref);
-
- G_OBJECT_CLASS (gtk_filter_list_model_parent_class)->dispose (object);
-}
-
-static void
-gtk_filter_list_model_class_init (GtkFilterListModelClass *class)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-
- gobject_class->set_property = gtk_filter_list_model_set_property;
- gobject_class->get_property = gtk_filter_list_model_get_property;
- gobject_class->dispose = gtk_filter_list_model_dispose;
-
- /**
- * GtkFilterListModel:has-filter:
- *
- * If a filter is set for this model
- */
- properties[PROP_HAS_FILTER] =
- g_param_spec_boolean ("has-filter",
- N_("has filter"),
- N_("If a filter is set for this model"),
- FALSE,
- G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY);
-
- /**
- * GtkFilterListModel:item-type:
- *
- * The #GType for elements of this object
- */
- properties[PROP_ITEM_TYPE] =
- g_param_spec_gtype ("item-type",
- N_("Item type"),
- N_("The type of elements of this object"),
- G_TYPE_OBJECT,
- G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_EXPLICIT_NOTIFY);
-
- /**
- * GtkFilterListModel:model:
- *
- * The model being filtered
- */
- properties[PROP_MODEL] =
- g_param_spec_object ("model",
- N_("Model"),
- N_("The model being filtered"),
- G_TYPE_LIST_MODEL,
- G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_EXPLICIT_NOTIFY);
-
- g_object_class_install_properties (gobject_class, NUM_PROPERTIES, properties);
-}
-
-static void
-gtk_filter_list_model_init (GtkFilterListModel *self)
-{
-}
-
-
-static void
-gtk_filter_list_model_augment (GtkRbTree *filter,
- gpointer _aug,
- gpointer _node,
- gpointer left,
- gpointer right)
-{
- FilterNode *node = _node;
- FilterAugment *aug = _aug;
-
- aug->n_items = 1;
- aug->n_visible = node->visible ? 1 : 0;
-
- if (left)
- {
- FilterAugment *left_aug = gtk_rb_tree_get_augment (filter, left);
- aug->n_items += left_aug->n_items;
- aug->n_visible += left_aug->n_visible;
- }
- if (right)
- {
- FilterAugment *right_aug = gtk_rb_tree_get_augment (filter, right);
- aug->n_items += right_aug->n_items;
- aug->n_visible += right_aug->n_visible;
- }
-}
-
-/**
- * gtk_filter_list_model_new:
- * @model: the model to sort
- * @filter_func: (allow-none): filter function or %NULL to not filter items
- * @user_data: user data passed to @filter_func
- * @user_destroy: destroy notifier for @user_data
- *
- * Creates a new #GtkFilterListModel that will filter @model using the given
- * @filter_func.
- *
- * Returns: a new #GtkFilterListModel
- **/
-GtkFilterListModel *
-gtk_filter_list_model_new (GListModel *model,
- GtkFilterListModelFilterFunc filter_func,
- gpointer user_data,
- GDestroyNotify user_destroy)
-{
- GtkFilterListModel *result;
-
- g_return_val_if_fail (G_IS_LIST_MODEL (model), NULL);
-
- result = g_object_new (GTK_TYPE_FILTER_LIST_MODEL,
- "item-type", g_list_model_get_item_type (model),
- "model", model,
- NULL);
-
- if (filter_func)
- gtk_filter_list_model_set_filter_func (result, filter_func, user_data, user_destroy);
-
- return result;
-}
-
-/**
- * gtk_filter_list_model_new_for_type:
- * @item_type: the type of the items that will be returned
- *
- * Creates a new empty filter list model set up to return items of type @item_type.
- * It is up to the application to set a proper filter function and model to ensure
- * the item type is matched.
- *
- * Returns: a new #GtkFilterListModel
- **/
-GtkFilterListModel *
-gtk_filter_list_model_new_for_type (GType item_type)
-{
- g_return_val_if_fail (g_type_is_a (item_type, G_TYPE_OBJECT), NULL);
-
- return g_object_new (GTK_TYPE_FILTER_LIST_MODEL,
- "item-type", item_type,
- NULL);
-}
-
-/**
- * gtk_filter_list_model_set_filter_func:
- * @self: a #GtkFilterListModel
- * @filter_func: (allow-none): filter function or %NULL to not filter items
- * @user_data: user data passed to @filter_func
- * @user_destroy: destroy notifier for @user_data
- *
- * Sets the function used to filter items. The function will be called for every
- * item and if it returns %TRUE the item is considered visible.
- **/
-void
-gtk_filter_list_model_set_filter_func (GtkFilterListModel *self,
- GtkFilterListModelFilterFunc filter_func,
- gpointer user_data,
- GDestroyNotify user_destroy)
-{
- gboolean was_filtered, will_be_filtered;
-
- g_return_if_fail (GTK_IS_FILTER_LIST_MODEL (self));
- g_return_if_fail (filter_func != NULL || (user_data == NULL && !user_destroy));
-
- was_filtered = self->filter_func != NULL;
- will_be_filtered = filter_func != NULL;
-
- if (!was_filtered && !will_be_filtered)
- return;
-
- if (self->user_destroy)
- self->user_destroy (self->user_data);
-
- self->filter_func = filter_func;
- self->user_data = user_data;
- self->user_destroy = user_destroy;
-
- if (!will_be_filtered)
- {
- g_clear_pointer (&self->items, gtk_rb_tree_unref);
- }
- else if (!was_filtered)
- {
- guint i, n_items;
-
- self->items = gtk_rb_tree_new (FilterNode,
- FilterAugment,
- gtk_filter_list_model_augment,
- NULL, NULL);
- if (self->model)
- {
- n_items = g_list_model_get_n_items (self->model);
- for (i = 0; i < n_items; i++)
- {
- FilterNode *node = gtk_rb_tree_insert_before (self->items, NULL);
- node->visible = TRUE;
- }
- }
- }
-
- gtk_filter_list_model_refilter (self);
-
- if (was_filtered != will_be_filtered)
- g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_HAS_FILTER]);
-}
-
-/**
- * gtk_filter_list_model_set_model:
- * @self: a #GtkFilterListModel
- * @model: (allow-none): The model to be filtered
- *
- * Sets the model to be filtered.
- *
- * Note that GTK makes no effort to ensure that @model conforms to
- * the item type of @self. It assumes that the caller knows what they
- * are doing and have set up an appropriate filter function to ensure
- * that item types match.
- **/
-void
-gtk_filter_list_model_set_model (GtkFilterListModel *self,
- GListModel *model)
-{
- guint removed, added;
-
- g_return_if_fail (GTK_IS_FILTER_LIST_MODEL (self));
- g_return_if_fail (model == NULL || G_IS_LIST_MODEL (model));
- /* Note: We don't check for matching item type here, we just assume the
- * filter func takes care of filtering wrong items. */
-
- if (self->model == model)
- return;
-
- removed = g_list_model_get_n_items (G_LIST_MODEL (self));
- gtk_filter_list_model_clear_model (self);
-
- if (model)
- {
- self->model = g_object_ref (model);
- g_signal_connect (model, "items-changed", G_CALLBACK (gtk_filter_list_model_items_changed_cb), self);
- if (self->items)
- added = gtk_filter_list_model_add_items (self, NULL, 0, g_list_model_get_n_items (model));
- else
- added = g_list_model_get_n_items (model);
- }
- else
- added = 0;
-
- if (removed > 0 || added > 0)
- g_list_model_items_changed (G_LIST_MODEL (self), 0, removed, added);
-
- g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_MODEL]);
-}
-
-/**
- * gtk_filter_list_model_get_model:
- * @self: a #GtkFilterListModel
- *
- * Gets the model currently filtered or %NULL if none.
- *
- * Returns: (nullable) (transfer none): The model that gets filtered
- **/
-GListModel *
-gtk_filter_list_model_get_model (GtkFilterListModel *self)
-{
- g_return_val_if_fail (GTK_IS_FILTER_LIST_MODEL (self), NULL);
-
- return self->model;
-}
-
-/**
- * gtk_filter_list_model_has_filter:
- * @self: a #GtkFilterListModel
- *
- * Checks if a filter function is currently set on @self
- *
- * Returns: %TRUE if a filter function is set
- **/
-gboolean
-gtk_filter_list_model_has_filter (GtkFilterListModel *self)
-{
- g_return_val_if_fail (GTK_IS_FILTER_LIST_MODEL (self), FALSE);
-
- return self->filter_func != NULL;
-}
-
-/**
- * gtk_filter_list_model_refilter:
- * @self: a #GtkFilterListModel
- *
- * Causes @self to refilter all items in the model.
- *
- * Calling this function is necessary when data used by the filter
- * function has changed.
- **/
-void
-gtk_filter_list_model_refilter (GtkFilterListModel *self)
-{
- FilterNode *node;
- guint i, first_change, last_change;
- guint n_is_visible, n_was_visible;
- gboolean visible;
-
- g_return_if_fail (GTK_IS_FILTER_LIST_MODEL (self));
-
- if (self->items == NULL || self->model == NULL)
- return;
-
- first_change = G_MAXUINT;
- last_change = 0;
- n_is_visible = 0;
- n_was_visible = 0;
- for (i = 0, node = gtk_rb_tree_get_first (self->items);
- node != NULL;
- i++, node = gtk_rb_tree_node_get_next (node))
- {
- visible = gtk_filter_list_model_run_filter (self, i);
- if (visible == node->visible)
- {
- if (visible)
- {
- n_is_visible++;
- n_was_visible++;
- }
- continue;
- }
-
- node->visible = visible;
- gtk_rb_tree_node_mark_dirty (node);
- first_change = MIN (n_is_visible, first_change);
- if (visible)
- n_is_visible++;
- else
- n_was_visible++;
- last_change = MAX (n_is_visible, last_change);
- }
-
- if (first_change <= last_change)
- {
- g_list_model_items_changed (G_LIST_MODEL (self),
- first_change,
- last_change - first_change + n_was_visible - n_is_visible,
- last_change - first_change);
- }
-}
-
diff --git a/phosh/src/gtk-list-models/gtkfilterlistmodel.h b/phosh/src/gtk-list-models/gtkfilterlistmodel.h
deleted file mode 100644
index f241809f1..000000000
--- a/phosh/src/gtk-list-models/gtkfilterlistmodel.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright © 2018 Benjamin Otte
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see .
- *
- * Authors: Benjamin Otte
- */
-
-#ifndef __GTK_FILTER_LIST_MODEL_H__
-#define __GTK_FILTER_LIST_MODEL_H__
-
-
-#include
-#include
-
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_FILTER_LIST_MODEL (gtk_filter_list_model_get_type ())
-
-GDK_AVAILABLE_IN_ALL
-G_DECLARE_FINAL_TYPE (GtkFilterListModel, gtk_filter_list_model, GTK, FILTER_LIST_MODEL, GObject)
-
-/**
- * GtkFilterListModelFilterFunc:
- * @item: (type GObject): The item that may be filtered
- * @user_data: user data
- *
- * User function that is called to determine if the @item of the original model should be visible.
- * If it should be visible, this function must return %TRUE. If the model should filter out the
- * @item, %FALSE must be returned.
- *
- * Returns: %TRUE to keep the item around
- */
-typedef gboolean (* GtkFilterListModelFilterFunc) (gpointer item, gpointer user_data);
-
-GDK_AVAILABLE_IN_ALL
-GtkFilterListModel * gtk_filter_list_model_new (GListModel *model,
- GtkFilterListModelFilterFunc filter_func,
- gpointer user_data,
- GDestroyNotify user_destroy);
-GDK_AVAILABLE_IN_ALL
-GtkFilterListModel * gtk_filter_list_model_new_for_type (GType item_type);
-
-GDK_AVAILABLE_IN_ALL
-void gtk_filter_list_model_set_filter_func (GtkFilterListModel *self,
- GtkFilterListModelFilterFunc filter_func,
- gpointer user_data,
- GDestroyNotify user_destroy);
-GDK_AVAILABLE_IN_ALL
-void gtk_filter_list_model_set_model (GtkFilterListModel *self,
- GListModel *model);
-GDK_AVAILABLE_IN_ALL
-GListModel * gtk_filter_list_model_get_model (GtkFilterListModel *self);
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_filter_list_model_has_filter (GtkFilterListModel *self);
-
-GDK_AVAILABLE_IN_ALL
-void gtk_filter_list_model_refilter (GtkFilterListModel *self);
-
-G_END_DECLS
-
-#endif /* __GTK_FILTER_LIST_MODEL_H__ */
diff --git a/phosh/src/gtk-list-models/gtkrbtree.c b/phosh/src/gtk-list-models/gtkrbtree.c
deleted file mode 100644
index 98aa546fa..000000000
--- a/phosh/src/gtk-list-models/gtkrbtree.c
+++ /dev/null
@@ -1,798 +0,0 @@
-/* gtkrbtree.c
- * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library. If not, see .
- */
-
-#include "phosh-config.h"
-
-#include "gtkrbtreeprivate.h"
-
-/* Define the following to print adds and removals to stdout.
- * The format of the printout will be suitable for addition as a new test to
- * testsuite/gtk/rbtree-crash.c
- * by just grepping the printouts from the relevant rbtree.
- *
- * This is meant to be a trivial way to add rbtree tests to the testsuite.
- */
-#undef DUMP_MODIFICATION
-
-typedef struct _GtkRbNode GtkRbNode;
-
-struct _GtkRbTree
-{
- guint ref_count;
-
- gsize element_size;
- gsize augment_size;
- GtkRbTreeAugmentFunc augment_func;
- GDestroyNotify clear_func;
- GDestroyNotify clear_augment_func;
-
- GtkRbNode *root;
-};
-
-struct _GtkRbNode
-{
- guint red :1;
- guint dirty :1;
-
- GtkRbNode *left;
- GtkRbNode *right;
- /* The difference between tree and parent here is that we OR the tree with 1 and because
- * pointers are always multiples of 4, we can know if we've stored a parent or the tree here */
- union {
- gpointer parent_or_tree;
- GtkRbNode *parent;
- GtkRbTree *tree;
- };
-};
-
-#define NODE_FROM_POINTER(ptr) ((GtkRbNode *) ((ptr) ? (((guchar *) (ptr)) - sizeof (GtkRbNode)) : NULL))
-#define NODE_TO_POINTER(node) ((gpointer) ((node) ? (((guchar *) (node)) + sizeof (GtkRbNode)) : NULL))
-#define NODE_TO_AUG_POINTER(tree, node) ((gpointer) ((node) ? (((guchar *) (node)) + sizeof (GtkRbNode) + (tree)->element_size) : NULL))
-
-static inline gboolean
-is_root (GtkRbNode *node)
-{
- return GPOINTER_TO_SIZE (node->parent_or_tree) & 1 ? TRUE : FALSE;
-}
-
-static inline GtkRbNode *
-parent (GtkRbNode *node)
-{
- if (is_root (node))
- return NULL;
- else
- return node->parent;
-}
-
-static GtkRbTree *
-tree (GtkRbNode *node)
-{
- while (!is_root (node))
- node = parent (node);
-
- return GSIZE_TO_POINTER (GPOINTER_TO_SIZE (node->tree) & ~1);
-}
-
-static void
-set_parent (GtkRbTree *tree,
- GtkRbNode *node,
- GtkRbNode *new_parent)
-{
-
- if (new_parent != NULL)
- {
- node->parent = new_parent;
- }
- else
- {
- node->tree = GSIZE_TO_POINTER (GPOINTER_TO_SIZE (tree) | 1);
- tree->root = node;
- }
-}
-
-static inline gsize
-gtk_rb_node_get_size (GtkRbTree *tree)
-{
- return sizeof (GtkRbNode) + tree->element_size + tree->augment_size;
-}
-
-static GtkRbNode *
-gtk_rb_node_new (GtkRbTree *tree)
-{
- GtkRbNode *result;
-
- result = g_slice_alloc0 (gtk_rb_node_get_size (tree));
-
- result->red = TRUE;
- result->dirty = TRUE;
-
- return result;
-}
-
-static void
-gtk_rb_node_free (GtkRbTree *tree,
- GtkRbNode *node)
-{
- if (tree->clear_func)
- tree->clear_func (NODE_TO_POINTER (node));
- if (tree->clear_augment_func)
- tree->clear_augment_func (NODE_TO_AUG_POINTER (tree, node));
-
- g_slice_free1 (gtk_rb_node_get_size (tree), node);
-}
-
-static void
-gtk_rb_node_free_deep (GtkRbTree *tree,
- GtkRbNode *node)
-{
- GtkRbNode *right = node->right;
-
- if (node->left)
- gtk_rb_node_free_deep (tree, node->left);
-
- gtk_rb_node_free (tree, node);
-
- if (right)
- gtk_rb_node_free_deep (tree, right);
-}
-
-static void
-gtk_rb_node_mark_dirty (GtkRbNode *node,
- gboolean mark_parent)
-{
- if (node->dirty)
- return;
-
- node->dirty = TRUE;
-
- if (mark_parent && parent (node))
- gtk_rb_node_mark_dirty (parent (node), TRUE);
-}
-
-static void
-gtk_rb_node_clean (GtkRbTree *tree,
- GtkRbNode *node)
-{
- if (!node->dirty)
- return;
-
- node->dirty = FALSE;
- if (tree->augment_func)
- tree->augment_func (tree,
- NODE_TO_AUG_POINTER (tree, node),
- NODE_TO_POINTER (node),
- NODE_TO_POINTER (node->left),
- NODE_TO_POINTER (node->right));
-}
-
-static GtkRbNode *
-gtk_rb_node_get_first (GtkRbNode *node)
-{
- while (node->left)
- node = node->left;
-
- return node;
-}
-
-static GtkRbNode *
-gtk_rb_node_get_last (GtkRbNode *node)
-{
- while (node->right)
- node = node->right;
-
- return node;
-}
-
-static GtkRbNode *
-gtk_rb_node_get_previous (GtkRbNode *node)
-{
- GtkRbNode *p;
-
- if (node->left)
- return gtk_rb_node_get_last (node->left);
-
- for (p = parent (node); p != NULL; p = parent (node))
- {
- if (p->right == node)
- return p;
-
- node = p;
- }
-
- return NULL;
-}
-
-static GtkRbNode *
-gtk_rb_node_get_next (GtkRbNode *node)
-{
- GtkRbNode *p;
-
- if (node->right)
- return gtk_rb_node_get_first (node->right);
-
- for (p = parent (node); p != NULL; p = parent (node))
- {
- if (p->left == node)
- return p;
-
- node = p;
- }
-
- return NULL;
-}
-
-#ifdef DUMP_MODIFICATION
-static guint
-position (GtkRbTree *tree,
- GtkRbNode *node)
-{
- GtkRbNode *n;
- guint i;
-
- i = 0;
- for (n = gtk_rb_node_get_first (tree->root);
- n != node;
- n = gtk_rb_node_get_next (n))
- i++;
-
- return i;
-}
-#endif
-
-static void
-gtk_rb_node_rotate_left (GtkRbTree *tree,
- GtkRbNode *node)
-{
- GtkRbNode *right, *p;
-
- right = node->right;
- p = parent (node);
-
- node->right = right->left;
- if (right->left)
- set_parent (tree, right->left, node);
-
- set_parent (tree, right, p);
- if (p)
- {
- if (node == p->left)
- p->left = right;
- else
- p->right = right;
- }
-
- right->left = node;
- set_parent (tree, node, right);
-
- gtk_rb_node_mark_dirty (node, FALSE);
- gtk_rb_node_mark_dirty (right, FALSE);
-}
-
-static void
-gtk_rb_node_rotate_right (GtkRbTree *tree,
- GtkRbNode *node)
-{
- GtkRbNode *left, *p;
-
- left = node->left;
- p = parent (node);
-
- node->left = left->right;
- if (left->right)
- set_parent (tree, left->right, node);
-
- set_parent (tree, left, p);
- if (p)
- {
- if (node == p->right)
- p->right = left;
- else
- p->left = left;
- }
-
- /* link node and left */
- left->right = node;
- set_parent (tree, node, left);
-
- gtk_rb_node_mark_dirty (node, FALSE);
- gtk_rb_node_mark_dirty (left, FALSE);
-}
-
-static gboolean
-is_red (GtkRbNode *node_or_null)
-{
- if (node_or_null == NULL)
- return FALSE;
- else
- return node_or_null->red;
-}
-
-static inline gboolean
-is_black (GtkRbNode *node_or_null)
-{
- return !is_red (node_or_null);
-}
-
-static void
-set_black (GtkRbNode *node_or_null)
-{
- if (node_or_null == NULL)
- return;
-
- node_or_null->red = FALSE;
-}
-
-static void
-set_red (GtkRbNode *node_or_null)
-{
- if (node_or_null == NULL)
- return;
-
- node_or_null->red = TRUE;
-}
-
-static void
-gtk_rb_tree_insert_fixup (GtkRbTree *tree,
- GtkRbNode *node)
-{
- GtkRbNode *p;
-
- /* check Red-Black properties */
- for (p = parent (node);
- p && is_red (p);
- p = parent (node))
- {
- GtkRbNode *pp = parent (p);
-
- /* we have a violation */
- g_assert (pp);
-
- if (p == pp->left)
- {
- GtkRbNode *uncle = pp->right;
-
- if (is_red (uncle))
- {
- /* uncle is red */
- set_black (p);
- set_black (uncle);
- set_red (pp);
- node = pp;
- }
- else
- {
- /* uncle is black */
- if (node == p->right)
- {
- /* make node a left child */
- node = p;
- gtk_rb_node_rotate_left (tree, node);
- p = parent (node);
- pp = parent (p);
- }
- /* recolor and rotate */
- set_black (p);
- set_red (pp);
- gtk_rb_node_rotate_right (tree, pp);
- }
- }
- else
- {
- /* mirror image of above code */
- GtkRbNode *uncle = pp->left;
-
- if (is_red (uncle))
- {
- /* uncle is red */
- set_black (p);
- set_black (uncle);
- set_red (pp);
- node = pp;
- }
- else
- {
- /* uncle is black */
- if (node == p->left)
- {
- node = p;
- gtk_rb_node_rotate_right (tree, node);
- p = parent (node);
- pp = parent (p);
- }
- set_black (p);
- set_red (pp);
- gtk_rb_node_rotate_left (tree, pp);
- }
- }
- }
-
- set_black (tree->root);
-}
-
-static void
-gtk_rb_tree_remove_node_fixup (GtkRbTree *tree,
- GtkRbNode *node,
- GtkRbNode *p)
-{
- while (node != tree->root && is_black (node))
- {
- if (node == p->left)
- {
- GtkRbNode *w = p->right;
-
- if (is_red (w))
- {
- set_black (w);
- set_red (p);
- gtk_rb_node_rotate_left (tree, p);
- w = p->right;
- }
- if (is_black (w->left) && is_black (w->right))
- {
- set_red (w);
- node = p;
- }
- else
- {
- if (is_black (w->right))
- {
- set_black (w->left);
- set_red (w);
- gtk_rb_node_rotate_right (tree, w);
- w = p->right;
- }
- w->red = p->red;
- set_black (p);
- set_black (w->right);
- gtk_rb_node_rotate_left (tree, p);
- node = tree->root;
- }
- }
- else
- {
- GtkRbNode *w = p->left;
- if (is_red (w))
- {
- set_black (w);
- set_red (p);
- gtk_rb_node_rotate_right (tree, p);
- w = p->left;
- }
- if (is_black (w->right) && is_black (w->left))
- {
- set_red (w);
- node = p;
- }
- else
- {
- if (is_black (w->left))
- {
- set_black (w->right);
- set_red (w);
- gtk_rb_node_rotate_left (tree, w);
- w = p->left;
- }
- w->red = p->red;
- set_black (p);
- set_black (w->left);
- gtk_rb_node_rotate_right (tree, p);
- node = tree->root;
- }
- }
-
- p = parent (node);
- }
-
- set_black (node);
-}
-
-GtkRbTree *
-gtk_rb_tree_new_for_size (gsize element_size,
- gsize augment_size,
- GtkRbTreeAugmentFunc augment_func,
- GDestroyNotify clear_func,
- GDestroyNotify clear_augment_func)
-{
- GtkRbTree *tree;
-
- tree = g_slice_new0 (GtkRbTree);
- tree->ref_count = 1;
-
- tree->element_size = element_size;
- tree->augment_size = augment_size;
- tree->augment_func = augment_func;
- tree->clear_func = clear_func;
- tree->clear_augment_func = clear_augment_func;
-
- return tree;
-}
-
-GtkRbTree *
-gtk_rb_tree_ref (GtkRbTree *tree)
-{
- tree->ref_count++;
-
- return tree;
-}
-
-void
-gtk_rb_tree_unref (GtkRbTree *tree)
-{
- tree->ref_count--;
- if (tree->ref_count > 0)
- return;
-
- if (tree->root)
- gtk_rb_node_free_deep (tree, tree->root);
-
- g_slice_free (GtkRbTree, tree);
-}
-
-gpointer
-gtk_rb_tree_get_first (GtkRbTree *tree)
-{
- if (tree->root == NULL)
- return NULL;
-
- return NODE_TO_POINTER (gtk_rb_node_get_first (tree->root));
-}
-
-gpointer
-gtk_rb_tree_get_last (GtkRbTree *tree)
-{
- if (tree->root == NULL)
- return NULL;
-
- return NODE_TO_POINTER (gtk_rb_node_get_last (tree->root));
-}
-
-gpointer
-gtk_rb_tree_node_get_previous (gpointer node)
-{
- return NODE_TO_POINTER (gtk_rb_node_get_previous (NODE_FROM_POINTER (node)));
-}
-
-gpointer
-gtk_rb_tree_node_get_next (gpointer node)
-{
- return NODE_TO_POINTER (gtk_rb_node_get_next (NODE_FROM_POINTER (node)));
-}
-
-gpointer
-gtk_rb_tree_get_root (GtkRbTree *tree)
-{
- return NODE_TO_POINTER (tree->root);
-}
-
-gpointer
-gtk_rb_tree_node_get_parent (gpointer node)
-{
- return NODE_TO_POINTER (parent (NODE_FROM_POINTER (node)));
-}
-
-gpointer
-gtk_rb_tree_node_get_left (gpointer node)
-{
- return NODE_TO_POINTER (NODE_FROM_POINTER (node)->left);
-}
-
-gpointer
-gtk_rb_tree_node_get_right (gpointer node)
-{
- return NODE_TO_POINTER (NODE_FROM_POINTER (node)->right);
-}
-
-gpointer
-gtk_rb_tree_get_augment (GtkRbTree *tree,
- gpointer node)
-{
- GtkRbNode *rbnode = NODE_FROM_POINTER (node);
-
- gtk_rb_node_clean (tree, rbnode);
-
- return NODE_TO_AUG_POINTER (tree, rbnode);
-}
-
-GtkRbTree *
-gtk_rb_tree_node_get_tree (gpointer node)
-{
- return tree (NODE_FROM_POINTER (node));
-}
-
-void
-gtk_rb_tree_node_mark_dirty (gpointer node)
-{
- gtk_rb_node_mark_dirty (NODE_FROM_POINTER (node), TRUE);
-}
-
-gpointer
-gtk_rb_tree_insert_before (GtkRbTree *tree,
- gpointer node)
-{
- GtkRbNode *result;
-
-
- if (tree->root == NULL)
- {
-#ifdef DUMP_MODIFICATION
- g_print ("add (tree, 0); /* 0x%p */\n", tree);
-#endif /* DUMP_MODIFICATION */
-
- g_assert (node == NULL);
-
- result = gtk_rb_node_new (tree);
- tree->root = result;
- }
- else if (node == NULL)
- {
- return gtk_rb_tree_insert_after (tree, gtk_rb_tree_get_last (tree));
- }
- else
- {
- GtkRbNode *current = NODE_FROM_POINTER (node);
-
-#ifdef DUMP_MODIFICATION
- g_print ("add (tree, %u); /* 0x%p */\n", position (tree, current), tree);
-#endif /* DUMP_MODIFICATION */
-
- /* setup new node */
- result = gtk_rb_node_new (tree);
-
- if (current->left)
- {
- current = gtk_rb_node_get_last (current->left);
- current->right = result;
- }
- else
- {
- current->left = result;
- }
- set_parent (tree, result, current);
- gtk_rb_node_mark_dirty (current, TRUE);
- }
-
- gtk_rb_tree_insert_fixup (tree, result);
-
- return NODE_TO_POINTER (result);
-}
-
-gpointer
-gtk_rb_tree_insert_after (GtkRbTree *tree,
- gpointer node)
-{
- GtkRbNode *current, *result;
-
- if (node == NULL)
- return gtk_rb_tree_insert_before (tree, gtk_rb_tree_get_first (tree));
-
- current = NODE_FROM_POINTER (node);
-
-#ifdef DUMP_MODIFICATION
- g_print ("add (tree, %u); /* 0x%p */\n", position (tree, current) + 1, tree);
-#endif /* DUMP_MODIFICATION */
-
- /* setup new node */
- result = gtk_rb_node_new (tree);
-
- if (current->right)
- {
- current = gtk_rb_node_get_first (current->right);
- current->left = result;
- }
- else
- {
- current->right = result;
- }
- set_parent (tree, result, current);
- gtk_rb_node_mark_dirty (current, TRUE);
-
- gtk_rb_tree_insert_fixup (tree, result);
-
- return NODE_TO_POINTER (result);
-}
-
-void
-gtk_rb_tree_remove (GtkRbTree *tree,
- gpointer node)
-{
- GtkRbNode *x, *y, *p, *real_node;
-
- real_node = NODE_FROM_POINTER (node);
-
-#ifdef DUMP_MODIFICATION
- g_print ("delete (tree, %u); /* 0x%p */\n", position (tree, real_node), tree);
-#endif /* DUMP_MODIFICATION */
-
- y = real_node;
- if (y->left && y->right)
- {
- y = y->right;
-
- while (y->left)
- y = y->left;
- }
-
- /* x is y's only child, or nil */
- if (y->left)
- x = y->left;
- else
- x = y->right;
-
- /* remove y from the parent chain */
- p = parent (y);
- if (x != NULL)
- set_parent (tree, x, p);
- if (p)
- {
- if (y == p->left)
- p->left = x;
- else
- p->right = x;
- gtk_rb_node_mark_dirty (p, TRUE);
- }
- else
- {
- if (x == NULL)
- tree->root = NULL;
- }
-
- /* We need to clean up the validity of the tree.
- */
- if (is_black (y))
- gtk_rb_tree_remove_node_fixup (tree, x, p);
-
- if (y != real_node)
- {
- /* Move the node over */
- if (is_red (real_node) != is_red (y))
- y->red = !y->red;
-
- y->left = real_node->left;
- if (y->left)
- set_parent (tree, y->left, y);
- y->right = real_node->right;
- if (y->right)
- set_parent (tree, y->right, y);
- p = parent (real_node);
- set_parent (tree, y, p);
- if (p)
- {
- if (p->left == real_node)
- p->left = y;
- else
- p->right = y;
- gtk_rb_node_mark_dirty (p, TRUE);
- }
- gtk_rb_node_mark_dirty (y, TRUE);
- }
-
- gtk_rb_node_free (tree, real_node);
-}
-
-void
-gtk_rb_tree_remove_all (GtkRbTree *tree)
-{
-#ifdef DUMP_MODIFICATION
- g_print ("delete_all (tree); /* 0x%p */\n", tree);
-#endif /* DUMP_MODIFICATION */
-
- if (tree->root)
- gtk_rb_node_free_deep (tree, tree->root);
-
- tree->root = NULL;
-}
-
diff --git a/phosh/src/gtk-list-models/gtkrbtreeprivate.h b/phosh/src/gtk-list-models/gtkrbtreeprivate.h
deleted file mode 100644
index 45aba5cc2..000000000
--- a/phosh/src/gtk-list-models/gtkrbtreeprivate.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* gtkrbtree.h
- * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library. If not, see .
- */
-
-/* A Red-Black Tree implementation used specifically by GtkTreeView.
- */
-#ifndef __GTK_RB_TREE_H__
-#define __GTK_RB_TREE_H__
-
-#include
-
-
-G_BEGIN_DECLS
-
-
-typedef struct _GtkRbTree GtkRbTree;
-
-typedef void (* GtkRbTreeAugmentFunc) (GtkRbTree *tree,
- gpointer node_augment,
- gpointer node,
- gpointer left,
- gpointer right);
-
-GtkRbTree * gtk_rb_tree_new_for_size (gsize element_size,
- gsize augment_size,
- GtkRbTreeAugmentFunc augment_func,
- GDestroyNotify clear_func,
- GDestroyNotify clear_augment_func);
-#define gtk_rb_tree_new(type, augment_type, augment_func, clear_func, clear_augment_func) \
- gtk_rb_tree_new_for_size (sizeof (type), sizeof (augment_type), (augment_func), (clear_func), (clear_augment_func))
-
-GtkRbTree * gtk_rb_tree_ref (GtkRbTree *tree);
-void gtk_rb_tree_unref (GtkRbTree *tree);
-
-gpointer gtk_rb_tree_get_root (GtkRbTree *tree);
-gpointer gtk_rb_tree_get_first (GtkRbTree *tree);
-gpointer gtk_rb_tree_get_last (GtkRbTree *tree);
-
-gpointer gtk_rb_tree_node_get_previous (gpointer node);
-gpointer gtk_rb_tree_node_get_next (gpointer node);
-gpointer gtk_rb_tree_node_get_parent (gpointer node);
-gpointer gtk_rb_tree_node_get_left (gpointer node);
-gpointer gtk_rb_tree_node_get_right (gpointer node);
-GtkRbTree * gtk_rb_tree_node_get_tree (gpointer node);
-void gtk_rb_tree_node_mark_dirty (gpointer node);
-
-gpointer gtk_rb_tree_get_augment (GtkRbTree *tree,
- gpointer node);
-
-gpointer gtk_rb_tree_insert_before (GtkRbTree *tree,
- gpointer node);
-gpointer gtk_rb_tree_insert_after (GtkRbTree *tree,
- gpointer node);
-void gtk_rb_tree_remove (GtkRbTree *tree,
- gpointer node);
-void gtk_rb_tree_remove_all (GtkRbTree *tree);
-
-
-G_END_DECLS
-
-
-#endif /* __GTK_RB_TREE_H__ */
diff --git a/phosh/src/gtk-list-models/gtksortlistmodel.c b/phosh/src/gtk-list-models/gtksortlistmodel.c
deleted file mode 100644
index 7372934cb..000000000
--- a/phosh/src/gtk-list-models/gtksortlistmodel.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
- * Copyright © 2018 Benjamin Otte
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see .
- *
- * Authors: Benjamin Otte
- */
-
-#include "phosh-config.h"
-
-#include "gtksortlistmodel.h"
-
-#include
-
-/**
- * SECTION:gtksortlistmodel
- * @title: GtkSortListModel
- * @short_description: A list model that sorts its items
- * @see_also: #GListModel
- *
- * #GtkSortListModel is a list model that takes a list model and
- * sorts its elements according to a compare function.
- *
- * #GtkSortListModel is a generic model and because of that it
- * cannot take advantage of any external knowledge when sorting.
- * If you run into performance issues with #GtkSortListModel, it
- * is strongly recommended that you write your own sorting list
- * model.
- */
-
-enum {
- PROP_0,
- PROP_HAS_SORT,
- PROP_ITEM_TYPE,
- PROP_MODEL,
- NUM_PROPERTIES
-};
-
-struct _GtkSortListModel
-{
- GObject parent_instance;
-
- GType item_type;
- GListModel *model;
- GCompareDataFunc sort_func;
- gpointer user_data;
- GDestroyNotify user_destroy;
-
- GSequence *sorted; /* NULL if sort_func == NULL */
- GSequence *unsorted; /* NULL if sort_func == NULL */
-};
-
-struct _GtkSortListModelClass
-{
- GObjectClass parent_class;
-};
-
-static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
-
-static GType
-gtk_sort_list_model_get_item_type (GListModel *list)
-{
- GtkSortListModel *self = GTK_SORT_LIST_MODEL (list);
-
- return self->item_type;
-}
-
-static guint
-gtk_sort_list_model_get_n_items (GListModel *list)
-{
- GtkSortListModel *self = GTK_SORT_LIST_MODEL (list);
-
- if (self->model == NULL)
- return 0;
-
- if (self->sorted)
- return g_sequence_get_length (self->sorted);
-
- return g_list_model_get_n_items (self->model);
-}
-
-static gpointer
-gtk_sort_list_model_get_item (GListModel *list,
- guint position)
-{
- GtkSortListModel *self = GTK_SORT_LIST_MODEL (list);
- GSequenceIter *iter;
-
- if (self->model == NULL)
- return NULL;
-
- if (self->unsorted == NULL)
- return g_list_model_get_item (self->model, position);
-
- iter = g_sequence_get_iter_at_pos (self->sorted, position);
- if (g_sequence_iter_is_end (iter))
- return NULL;
-
- return g_object_ref (g_sequence_get (iter));
-}
-
-static void
-gtk_sort_list_model_model_init (GListModelInterface *iface)
-{
- iface->get_item_type = gtk_sort_list_model_get_item_type;
- iface->get_n_items = gtk_sort_list_model_get_n_items;
- iface->get_item = gtk_sort_list_model_get_item;
-}
-
-G_DEFINE_TYPE_WITH_CODE (GtkSortListModel, gtk_sort_list_model, G_TYPE_OBJECT,
- G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_sort_list_model_model_init))
-
-static void
-gtk_sort_list_model_remove_items (GtkSortListModel *self,
- guint position,
- guint n_items,
- guint *unmodified_start,
- guint *unmodified_end)
-{
- GSequenceIter *unsorted_iter;
- guint i, pos, start, end, length_before;
-
- start = end = length_before = g_sequence_get_length (self->sorted);
- unsorted_iter = g_sequence_get_iter_at_pos (self->unsorted, position);
-
- for (i = 0; i < n_items ; i++)
- {
- GSequenceIter *sorted_iter;
- GSequenceIter *next;
-
- next = g_sequence_iter_next (unsorted_iter);
-
- sorted_iter = g_sequence_get (unsorted_iter);
- pos = g_sequence_iter_get_position (sorted_iter);
- start = MIN (start, pos);
- end = MIN (end, length_before - i - 1 - pos);
-
- g_sequence_remove (sorted_iter);
- g_sequence_remove (unsorted_iter);
-
- unsorted_iter = next;
- }
-
- *unmodified_start = start;
- *unmodified_end = end;
-}
-
-static void
-gtk_sort_list_model_add_items (GtkSortListModel *self,
- guint position,
- guint n_items,
- guint *unmodified_start,
- guint *unmodified_end)
-{
- GSequenceIter *unsorted_iter, *sorted_iter;
- guint i, pos, start, end, length_before;
-
- unsorted_iter = g_sequence_get_iter_at_pos (self->unsorted, position);
- start = end = length_before = g_sequence_get_length (self->sorted);
-
- for (i = 0; i < n_items; i++)
- {
- gpointer item = g_list_model_get_item (self->model, position + i);
- sorted_iter = g_sequence_insert_sorted (self->sorted, item, self->sort_func, self->user_data);
- g_sequence_insert_before (unsorted_iter, sorted_iter);
- if (unmodified_start != NULL || unmodified_end != NULL)
- {
- pos = g_sequence_iter_get_position (sorted_iter);
- start = MIN (start, pos);
- end = MIN (end, length_before + i - pos);
- }
- }
-
- if (unmodified_start)
- *unmodified_start = start;
- if (unmodified_end)
- *unmodified_end = end;
-}
-
-static void
-gtk_sort_list_model_items_changed_cb (GListModel *model,
- guint position,
- guint removed,
- guint added,
- GtkSortListModel *self)
-{
- guint n_items, start, end, start2, end2;
-
- if (removed == 0 && added == 0)
- return;
-
- if (self->sorted == NULL)
- {
- g_list_model_items_changed (G_LIST_MODEL (self), position, removed, added);
- return;
- }
-
- gtk_sort_list_model_remove_items (self, position, removed, &start, &end);
- gtk_sort_list_model_add_items (self, position, added, &start2, &end2);
- start = MIN (start, start2);
- end = MIN (end, end2);
-
- n_items = g_sequence_get_length (self->sorted) - start - end;
- g_list_model_items_changed (G_LIST_MODEL (self), start, n_items - added + removed, n_items);
-}
-
-static void
-gtk_sort_list_model_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GtkSortListModel *self = GTK_SORT_LIST_MODEL (object);
-
- switch (prop_id)
- {
- case PROP_ITEM_TYPE:
- self->item_type = g_value_get_gtype (value);
- break;
-
- case PROP_MODEL:
- gtk_sort_list_model_set_model (self, g_value_get_object (value));
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-gtk_sort_list_model_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GtkSortListModel *self = GTK_SORT_LIST_MODEL (object);
-
- switch (prop_id)
- {
- case PROP_HAS_SORT:
- g_value_set_boolean (value, self->sort_func != NULL);
- break;
-
- case PROP_ITEM_TYPE:
- g_value_set_gtype (value, self->item_type);
- break;
-
- case PROP_MODEL:
- g_value_set_object (value, self->model);
- break;
-
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-gtk_sort_list_model_clear_model (GtkSortListModel *self)
-{
- if (self->model == NULL)
- return;
-
- g_signal_handlers_disconnect_by_func (self->model, gtk_sort_list_model_items_changed_cb, self);
- g_clear_object (&self->model);
- g_clear_pointer (&self->sorted, g_sequence_free);
- g_clear_pointer (&self->unsorted, g_sequence_free);
-}
-
-static void
-gtk_sort_list_model_dispose (GObject *object)
-{
- GtkSortListModel *self = GTK_SORT_LIST_MODEL (object);
-
- gtk_sort_list_model_clear_model (self);
- if (self->user_destroy)
- self->user_destroy (self->user_data);
- self->sort_func = NULL;
- self->user_data = NULL;
- self->user_destroy = NULL;
-
- G_OBJECT_CLASS (gtk_sort_list_model_parent_class)->dispose (object);
-};
-
-static void
-gtk_sort_list_model_class_init (GtkSortListModelClass *class)
-{
- GObjectClass *gobject_class = G_OBJECT_CLASS (class);
-
- gobject_class->set_property = gtk_sort_list_model_set_property;
- gobject_class->get_property = gtk_sort_list_model_get_property;
- gobject_class->dispose = gtk_sort_list_model_dispose;
-
- /**
- * GtkSortListModel:has-sort:
- *
- * If a sort function is set for this model
- */
- properties[PROP_HAS_SORT] =
- g_param_spec_boolean ("has-sort",
- N_("has sort"),
- N_("If a sort function is set for this model"),
- FALSE,
- G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY);
-
- /**
- * GtkSortListModel:item-type:
- *
- * The #GType for items of this model
- */
- properties[PROP_ITEM_TYPE] =
- g_param_spec_gtype ("item-type",
- N_("Item type"),
- N_("The type of items of this list"),
- G_TYPE_OBJECT,
- G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_EXPLICIT_NOTIFY);
-
- /**
- * GtkSortListModel:model:
- *
- * The model being sorted
- */
- properties[PROP_MODEL] =
- g_param_spec_object ("model",
- N_("Model"),
- N_("The model being sorted"),
- G_TYPE_LIST_MODEL,
- G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_EXPLICIT_NOTIFY);
-
- g_object_class_install_properties (gobject_class, NUM_PROPERTIES, properties);
-}
-
-static void
-gtk_sort_list_model_init (GtkSortListModel *self)
-{
-}
-
-
-/**
- * gtk_sort_list_model_new:
- * @model: the model to sort
- * @sort_func: (allow-none): sort function or %NULL to not sort items
- * @user_data: user data passed to @sort_func
- * @user_destroy: destroy notifier for @user_data
- *
- * Creates a new sort list model that uses the @sort_func to sort @model.
- *
- * Returns: a new #GtkSortListModel
- **/
-GtkSortListModel *
-gtk_sort_list_model_new (GListModel *model,
- GCompareDataFunc sort_func,
- gpointer user_data,
- GDestroyNotify user_destroy)
-{
- GtkSortListModel *result;
-
- g_return_val_if_fail (G_IS_LIST_MODEL (model), NULL);
-
- result = g_object_new (GTK_TYPE_SORT_LIST_MODEL,
- "item-type", g_list_model_get_item_type (model),
- "model", model,
- NULL);
-
- if (sort_func)
- gtk_sort_list_model_set_sort_func (result, sort_func, user_data, user_destroy);
-
- return result;
-}
-
-/**
- * gtk_sort_list_model_new_for_type:
- * @item_type: the type of the items that will be returned
- *
- * Creates a new empty sort list model set up to return items of type @item_type.
- * It is up to the application to set a proper sort function and model to ensure
- * the item type is matched.
- *
- * Returns: a new #GtkSortListModel
- **/
-GtkSortListModel *
-gtk_sort_list_model_new_for_type (GType item_type)
-{
- g_return_val_if_fail (g_type_is_a (item_type, G_TYPE_OBJECT), NULL);
-
- return g_object_new (GTK_TYPE_SORT_LIST_MODEL,
- "item-type", item_type,
- NULL);
-}
-
-static void
-gtk_sort_list_model_create_sequences (GtkSortListModel *self)
-{
- if (!self->sort_func || self->model == NULL)
- return;
-
- self->sorted = g_sequence_new (g_object_unref);
- self->unsorted = g_sequence_new (NULL);
-
- gtk_sort_list_model_add_items (self, 0, g_list_model_get_n_items (self->model), NULL, NULL);
-}
-
-/**
- * gtk_sort_list_model_set_sort_func:
- * @self: a #GtkSortListModel
- * @sort_func: (allow-none): sort function or %NULL to not sort items
- * @user_data: user data passed to @sort_func
- * @user_destroy: destroy notifier for @user_data
- *
- * Sets the function used to sort items. The function will be called for every
- * item and must return an integer less than, equal to, or greater than zero if
- * for two items from the model if the first item is considered to be respectively
- * less than, equal to, or greater than the second.
- **/
-void
-gtk_sort_list_model_set_sort_func (GtkSortListModel *self,
- GCompareDataFunc sort_func,
- gpointer user_data,
- GDestroyNotify user_destroy)
-{
- guint n_items;
-
- g_return_if_fail (GTK_IS_SORT_LIST_MODEL (self));
- g_return_if_fail (sort_func != NULL || (user_data == NULL && !user_destroy));
-
- if (!sort_func && !self->sort_func)
- return;
-
- if (self->user_destroy)
- self->user_destroy (self->user_data);
-
- g_clear_pointer (&self->unsorted, g_sequence_free);
- g_clear_pointer (&self->sorted, g_sequence_free);
- self->sort_func = sort_func;
- self->user_data = user_data;
- self->user_destroy = user_destroy;
-
- gtk_sort_list_model_create_sequences (self);
-
- n_items = g_list_model_get_n_items (G_LIST_MODEL (self));
- if (n_items > 1)
- g_list_model_items_changed (G_LIST_MODEL (self), 0, n_items, n_items);
-
- g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_HAS_SORT]);
-}
-
-/**
- * gtk_sort_list_model_set_model:
- * @self: a #GtkSortListModel
- * @model: (allow-none): The model to be sorted
- *
- * Sets the model to be sorted. The @model's item type must conform to
- * the item type of @self.
- **/
-void
-gtk_sort_list_model_set_model (GtkSortListModel *self,
- GListModel *model)
-{
- guint removed, added;
-
- g_return_if_fail (GTK_IS_SORT_LIST_MODEL (self));
- g_return_if_fail (model == NULL || G_IS_LIST_MODEL (model));
- if (model)
- {
- g_return_if_fail (g_type_is_a (g_list_model_get_item_type (model), self->item_type));
- }
-
- if (self->model == model)
- return;
-
- removed = g_list_model_get_n_items (G_LIST_MODEL (self));
- gtk_sort_list_model_clear_model (self);
-
- if (model)
- {
- self->model = g_object_ref (model);
- g_signal_connect (model, "items-changed", G_CALLBACK (gtk_sort_list_model_items_changed_cb), self);
- added = g_list_model_get_n_items (model);
-
- gtk_sort_list_model_create_sequences (self);
- }
- else
- added = 0;
-
- if (removed > 0 || added > 0)
- g_list_model_items_changed (G_LIST_MODEL (self), 0, removed, added);
-
- g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_MODEL]);
-}
-
-/**
- * gtk_sort_list_model_get_model:
- * @self: a #GtkSortListModel
- *
- * Gets the model currently sorted or %NULL if none.
- *
- * Returns: (nullable) (transfer none): The model that gets sorted
- **/
-GListModel *
-gtk_sort_list_model_get_model (GtkSortListModel *self)
-{
- g_return_val_if_fail (GTK_IS_SORT_LIST_MODEL (self), NULL);
-
- return self->model;
-}
-
-/**
- * gtk_sort_list_model_has_sort:
- * @self: a #GtkSortListModel
- *
- * Checks if a sort function is currently set on @self
- *
- * Returns: %TRUE if a sort function is set
- **/
-gboolean
-gtk_sort_list_model_has_sort (GtkSortListModel *self)
-{
- g_return_val_if_fail (GTK_IS_SORT_LIST_MODEL (self), FALSE);
-
- return self->sort_func != NULL;
-}
-
-/**
- * gtk_sort_list_model_resort:
- * @self: a #GtkSortListModel
- *
- * Causes @self to resort all items in the model.
- *
- * Calling this function is necessary when data used by the sort
- * function has changed.
- **/
-void
-gtk_sort_list_model_resort (GtkSortListModel *self)
-{
- guint n_items;
-
- g_return_if_fail (GTK_IS_SORT_LIST_MODEL (self));
-
- if (self->sorted == NULL)
- return;
-
- n_items = g_list_model_get_n_items (self->model);
- if (n_items <= 1)
- return;
-
- g_sequence_sort (self->sorted, self->sort_func, self->user_data);
-
- g_list_model_items_changed (G_LIST_MODEL (self), 0, n_items, n_items);
-}
-
diff --git a/phosh/src/gtk-list-models/gtksortlistmodel.h b/phosh/src/gtk-list-models/gtksortlistmodel.h
deleted file mode 100644
index c1da26842..000000000
--- a/phosh/src/gtk-list-models/gtksortlistmodel.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright © 2018 Benjamin Otte
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see .
- *
- * Authors: Benjamin Otte
- */
-
-#ifndef __GTK_SORT_LIST_MODEL_H__
-#define __GTK_SORT_LIST_MODEL_H__
-
-
-#include
-#include
-
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_SORT_LIST_MODEL (gtk_sort_list_model_get_type ())
-
-GDK_AVAILABLE_IN_ALL
-G_DECLARE_FINAL_TYPE (GtkSortListModel, gtk_sort_list_model, GTK, SORT_LIST_MODEL, GObject)
-
-GDK_AVAILABLE_IN_ALL
-GtkSortListModel * gtk_sort_list_model_new (GListModel *model,
- GCompareDataFunc sort_func,
- gpointer user_data,
- GDestroyNotify user_destroy);
-GDK_AVAILABLE_IN_ALL
-GtkSortListModel * gtk_sort_list_model_new_for_type (GType item_type);
-
-GDK_AVAILABLE_IN_ALL
-void gtk_sort_list_model_set_sort_func (GtkSortListModel *self,
- GCompareDataFunc sort_func,
- gpointer user_data,
- GDestroyNotify user_destroy);
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_sort_list_model_has_sort (GtkSortListModel *self);
-GDK_AVAILABLE_IN_ALL
-void gtk_sort_list_model_set_model (GtkSortListModel *self,
- GListModel *model);
-GDK_AVAILABLE_IN_ALL
-GListModel * gtk_sort_list_model_get_model (GtkSortListModel *self);
-
-GDK_AVAILABLE_IN_ALL
-void gtk_sort_list_model_resort (GtkSortListModel *self);
-
-G_END_DECLS
-
-#endif /* __GTK_SORT_LIST_MODEL_H__ */
diff --git a/phosh/src/gtk-mount-prompt.c b/phosh/src/gtk-mount-prompt.c
index 34bb58e48..50c4cb21f 100644
--- a/phosh/src/gtk-mount-prompt.c
+++ b/phosh/src/gtk-mount-prompt.c
@@ -143,8 +143,7 @@ set_icon_name (PhoshGtkMountPrompt *self, const char *icon_name)
gtk_image_set_from_icon_name (GTK_IMAGE (self->img_icon),
(icon_name && strlen (icon_name)) ?
- self->icon_name : "dialog-password",
- -1);
+ self->icon_name : "dialog-password");
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ICON_NAME]);
}
@@ -161,7 +160,7 @@ set_default_user (PhoshGtkMountPrompt *self, const char *default_user)
g_clear_pointer (&self->default_user, g_free);
self->default_user = g_strdup (default_user);
- gtk_entry_set_text (GTK_ENTRY (self->entry_domain), self->default_user);
+ gtk_editable_set_text (GTK_EDITABLE (self->entry_domain), self->default_user);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_DEFAULT_USER]);
}
@@ -178,7 +177,7 @@ set_default_domain (PhoshGtkMountPrompt *self, const char *default_domain)
g_clear_pointer (&self->default_domain, g_free);
self->default_domain = g_strdup (default_domain);
- gtk_entry_set_text (GTK_ENTRY (self->entry_domain), self->default_domain);
+ gtk_editable_set_text (GTK_EDITABLE (self->entry_domain), self->default_domain);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_DEFAULT_DOMAIN]);
}
@@ -213,7 +212,7 @@ set_choices (PhoshGtkMountPrompt *self, GStrv choices)
self->choices = g_strdupv (choices);
buttons = phosh_system_modal_dialog_get_buttons (PHOSH_SYSTEM_MODAL_DIALOG (self));
for (GList *elem = buttons; elem; elem = elem->next)
- gtk_widget_destroy (GTK_WIDGET (elem->data));
+ phosh_system_modal_dialog_remove_button (PHOSH_SYSTEM_MODAL_DIALOG (self), GTK_WIDGET (elem->data));
for (int i = 0; i < g_strv_length (self->choices); i++) {
GtkWidget *btn = gtk_button_new_with_label (self->choices[i]);
@@ -223,8 +222,7 @@ set_choices (PhoshGtkMountPrompt *self, GStrv choices)
g_signal_connect_swapped (btn, "clicked", G_CALLBACK (on_button_clicked), self);
if (i == 0) {
- GtkStyleContext *context = gtk_widget_get_style_context (btn);
- gtk_style_context_add_class (context, "suggested-action");
+ gtk_widget_add_css_class (btn, "suggested-action");
gtk_widget_grab_focus (btn);
}
}
@@ -354,6 +352,15 @@ on_dialog_canceled (PhoshGtkMountPrompt *self)
}
+static void
+phosh_gtk_mount_prompt_dispose (GObject *obj)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (obj), PHOSH_TYPE_GTK_MOUNT_PROMPT);
+
+ G_OBJECT_CLASS (phosh_gtk_mount_prompt_parent_class)->dispose (obj);
+}
+
+
static void
phosh_gtk_mount_prompt_finalize (GObject *obj)
{
@@ -378,6 +385,7 @@ phosh_gtk_mount_prompt_class_init (PhoshGtkMountPromptClass *klass)
object_class->get_property = phosh_gtk_mount_prompt_get_property;
object_class->set_property = phosh_gtk_mount_prompt_set_property;
+ object_class->dispose = phosh_gtk_mount_prompt_dispose;
object_class->finalize = phosh_gtk_mount_prompt_finalize;
props[PROP_MESSAGE] =
diff --git a/phosh/src/home.c b/phosh/src/home.c
index e08641008..bab298955 100644
--- a/phosh/src/home.c
+++ b/phosh/src/home.c
@@ -20,7 +20,7 @@
#include "feedback-manager.h"
#include "util.h"
-#include
+#include
#define KEYBINDINGS_SCHEMA_ID "org.gnome.shell.keybindings"
#define KEYBINDING_KEY_TOGGLE_OVERVIEW "toggle-overview"
@@ -151,7 +151,8 @@ static void
update_drag_handle (PhoshHome *self, gboolean queue_draw)
{
gboolean success;
- gint handle = 0;
+ graphene_point_t src = { 0, 0 };
+ graphene_point_t dst = { 0, 0 };
PhoshAppGrid *app_grid;
PhoshDragSurfaceDragMode drag_mode = PHOSH_DRAG_SURFACE_DRAG_MODE_HANDLE;
PhoshDragSurfaceState drag_state = phosh_drag_surface_get_drag_state (PHOSH_DRAG_SURFACE (self));
@@ -168,16 +169,17 @@ update_drag_handle (PhoshHome *self, gboolean queue_draw)
/* Update handle size */
app_grid = phosh_overview_get_app_grid (PHOSH_OVERVIEW (self->overview));
- success = gtk_widget_translate_coordinates (GTK_WIDGET (app_grid),
- GTK_WIDGET (self),
- 0, 0, NULL, &handle);
+ success = gtk_widget_compute_point (GTK_WIDGET (app_grid),
+ GTK_WIDGET (self),
+ &src, &dst);
+
if (!success) {
g_warning ("Failed to get handle position");
- handle = PHOSH_HOME_BAR_HEIGHT;
+ dst.y = PHOSH_HOME_BAR_HEIGHT;
}
- g_debug ("Drag Handle: %d", handle);
- phosh_drag_surface_set_drag_handle (PHOSH_DRAG_SURFACE (self), handle);
+ g_debug ("Drag Handle: %d", (int) dst.y);
+ phosh_drag_surface_set_drag_handle (PHOSH_DRAG_SURFACE (self), dst.y);
/* Trigger redraw and surface commit */
if (queue_draw)
gtk_widget_queue_draw (GTK_WIDGET (self));
@@ -191,25 +193,51 @@ get_margin (gint height)
}
-static gboolean
-on_configure_event (PhoshHome *self, GdkEventConfigure *event)
+static void
+on_configure_event (PhoshHome *self)
{
guint margin;
+ int width, height;
- margin = get_margin (event->height);
-
- /* ignore popovers like the power menu */
- if (gtk_widget_get_window (GTK_WIDGET (self)) != event->window)
- return FALSE;
+ width = phosh_layer_surface_get_configured_width (PHOSH_LAYER_SURFACE (self));
+ height = phosh_layer_surface_get_configured_height (PHOSH_LAYER_SURFACE (self));
+ margin = get_margin (height);
- g_debug ("%s: %dx%d, margin: %d", __func__, event->height, event->width, margin);
+ g_debug ("%s: %dx%d, margin: %d", __func__, height, width, margin);
/* If the size changes we need to update the folded margin */
phosh_drag_surface_set_margin (PHOSH_DRAG_SURFACE (self), margin, 0);
/* Update drag handle since overview size might have changed */
update_drag_handle (self, TRUE);
+}
+
+
+static void
+phosh_home_add_background (PhoshHome *self)
+{
+ PhoshShell *shell = phosh_shell_get_default ();
+ PhoshMonitor *monitor;
+ GdkSurface *surface;
+ cairo_rectangle_int_t rect = { 0, 0, 0, 0 };
+ cairo_region_t *region;
+
+ monitor = phosh_shell_get_primary_monitor (shell);
+ self->background = PHOSH_BACKGROUND (phosh_background_new (monitor,
+ /* Span over whole display */
+ FALSE,
+ ZWLR_LAYER_SHELL_V1_LAYER_TOP));
+ g_object_bind_property (self, "visible", self->background, "visible", G_BINDING_SYNC_CREATE);
+
+ g_signal_connect_object (phosh_shell_get_background_manager (shell),
+ "config-changed",
+ G_CALLBACK (phosh_background_needs_update),
+ self->background,
+ G_CONNECT_SWAPPED);
- return FALSE;
+ region = cairo_region_create_rectangle (&rect);
+ surface = gtk_native_get_surface (GTK_NATIVE (self->background));
+ gdk_surface_set_input_region (surface, region);
+ cairo_region_destroy (region);
}
@@ -220,13 +248,14 @@ phosh_home_map (GtkWidget *widget)
GTK_WIDGET_CLASS (phosh_home_parent_class)->map (widget);
+ phosh_home_add_background (self);
phosh_layer_surface_set_stacked_below (PHOSH_LAYER_SURFACE (self->background),
PHOSH_LAYER_SURFACE (self));
}
static void
-on_home_released (GtkButton *button, int n_press, double x, double y, GtkGestureMultiPress *gesture)
+on_home_released (GtkButton *button, int n_press, double x, double y, GtkGestureClick *gesture)
{
PhoshHome *self = g_object_get_data (G_OBJECT (gesture), "phosh-home");
@@ -329,29 +358,27 @@ on_has_activities_changed (PhoshHome *self)
static gboolean
-window_key_press_event_cb (PhoshHome *self, GdkEvent *event, gpointer data)
+window_key_press_event_cb (PhoshHome *self, guint keyval, guint keycode, GdkModifierType state, GtkEventController *key_controller)
{
gboolean ret = GDK_EVENT_PROPAGATE;
- guint keyval;
- g_return_val_if_fail (PHOSH_IS_HOME (self), GDK_EVENT_PROPAGATE);
+ g_return_val_if_fail (PHOSH_IS_HOME (self), FALSE);
if (self->state != PHOSH_HOME_STATE_UNFOLDED)
- return GDK_EVENT_PROPAGATE;
-
- if (!gdk_event_get_keyval (event, &keyval))
- return GDK_EVENT_PROPAGATE;
+ return FALSE;
switch (keyval) {
case GDK_KEY_Escape:
phosh_home_set_state (self, PHOSH_HOME_STATE_FOLDED);
- ret = GDK_EVENT_STOP;
+ ret = TRUE;
break;
case GDK_KEY_Return:
- ret = GDK_EVENT_PROPAGATE;
+ ret = FALSE;
break;
default:
/* Focus search when typing */
- ret = phosh_overview_handle_search (PHOSH_OVERVIEW (self->overview), event);
+ // FIXME Port to GTK 4
+ // ret = phosh_overview_handle_search (PHOSH_OVERVIEW (self->overview), event);
+ ret = FALSE;
}
return ret;
@@ -456,15 +483,15 @@ static void
phosh_home_dragged (PhoshDragSurface *drag_surface, int margin)
{
PhoshHome *self = PHOSH_HOME (drag_surface);
- int width, height;
+ int height;
double progress, alpha;
- gtk_window_get_size (GTK_WINDOW (self), &width, &height);
+ height = phosh_layer_surface_get_configured_height (PHOSH_LAYER_SURFACE (self));
progress = 1.0 - (-margin / (double)(height - PHOSH_HOME_BAR_HEIGHT));
/* Avoid negative values when resizing the surface */
progress = MAX (0, progress);
- alpha = hdy_ease_out_cubic (progress);
+ alpha = adw_easing_ease (ADW_EASE_OUT_CUBIC, progress);
phosh_home_set_background_alpha (self, alpha);
}
@@ -515,36 +542,6 @@ on_drag_state_changed (PhoshHome *self)
}
-static void
-phosh_home_add_background (PhoshHome *self)
-{
- PhoshWayland *wl = phosh_wayland_get_default ();
- PhoshShell *shell = phosh_shell_get_default ();
- PhoshMonitor *monitor;
- cairo_rectangle_int_t rect = { 0, 0, 0, 0 };
- cairo_region_t *region;
-
- monitor = phosh_shell_get_primary_monitor (shell);
- self->background = PHOSH_BACKGROUND (phosh_background_new (
- phosh_wayland_get_zwlr_layer_shell_v1 (wl),
- monitor,
- /* Span over whole display */
- FALSE,
- ZWLR_LAYER_SHELL_V1_LAYER_TOP));
- g_object_bind_property (self, "visible", self->background, "visible", G_BINDING_SYNC_CREATE);
-
- g_signal_connect_object (phosh_shell_get_background_manager (shell),
- "config-changed",
- G_CALLBACK (phosh_background_needs_update),
- self->background,
- G_CONNECT_SWAPPED);
-
- region = cairo_region_create_rectangle (&rect);
- gtk_widget_input_shape_combine_region (GTK_WIDGET (self->background), region);
- cairo_region_destroy (region);
-}
-
-
static void
on_theme_name_changed (PhoshHome *self, GParamSpec *pspec, PhoshStyleManager *style_manager)
{
@@ -587,7 +584,6 @@ phosh_home_constructed (GObject *object)
g_object_set_data (G_OBJECT (self->click_gesture), "phosh-home", self);
g_object_set_data (G_OBJECT (self->osk_toggle_long_press), "phosh-home", self);
- phosh_home_add_background (self);
g_signal_connect_object (phosh_shell_get_style_manager (shell),
"notify::theme-name",
G_CALLBACK (on_theme_name_changed),
@@ -613,6 +609,8 @@ phosh_home_dispose (GObject *object)
g_clear_pointer (&self->background, phosh_cp_widget_destroy);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_HOME);
+
G_OBJECT_CLASS (phosh_home_parent_class)->dispose (object);
}
@@ -693,7 +691,8 @@ phosh_home_init (PhoshHome *self)
self->settings = g_settings_new (KEYBINDINGS_SCHEMA_ID);
/* Adjust margins and folded state on size changes */
- g_signal_connect (self, "configure-event", G_CALLBACK (on_configure_event), NULL);
+ g_signal_connect (self, "configured", G_CALLBACK (on_configure_event), NULL);
+ on_configure_event (self);
settings = g_settings_new (PHOSH_SETTINGS);
g_settings_bind (settings, "osk-unfold-delay",
@@ -709,17 +708,10 @@ phosh_home_new (struct zwlr_layer_shell_v1 *layer_shell,
{
return g_object_new (PHOSH_TYPE_HOME,
/* layer-surface */
- "layer-shell", layer_shell,
"wl-output", monitor->wl_output,
- "anchor", ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
- ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
- ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT,
- "layer", ZWLR_LAYER_SHELL_V1_LAYER_TOP,
"kbd-interactivity", FALSE,
"exclusive-zone", PHOSH_HOME_BAR_HEIGHT,
- "namespace", "phosh home",
/* drag-surface */
- "layer-shell-effects", layer_shell_effects,
"exclusive", PHOSH_HOME_BAR_HEIGHT,
"threshold", PHOSH_HOME_DRAG_THRESHOLD,
NULL);
diff --git a/phosh/src/idle-manager.c b/phosh/src/idle-manager.c
index 13868d68c..826493fc1 100644
--- a/phosh/src/idle-manager.c
+++ b/phosh/src/idle-manager.c
@@ -13,7 +13,6 @@
#include "idle-manager.h"
#include "shell-priv.h"
-#include
/**
* PhoshIdleManager:
diff --git a/phosh/src/keypad.c b/phosh/src/keypad.c
index 2d6f3747c..bd7da4a5d 100644
--- a/phosh/src/keypad.c
+++ b/phosh/src/keypad.c
@@ -61,12 +61,15 @@ static GParamSpec *props[PROP_LAST_PROP];
static void
symbol_clicked (PhoshKeypad *self, char symbol)
{
- g_autofree char *string = g_strdup_printf ("%c", symbol);
+ int position;
+ g_autofree gchar *string = g_strdup_printf ("%c", symbol);
if (!self->entry)
return;
- g_signal_emit_by_name (self->entry, "insert-at-cursor", string, NULL);
+ position = gtk_editable_get_position (GTK_EDITABLE (self->entry));
+ gtk_editable_insert_text (GTK_EDITABLE (self->entry), string, -1, &position);
+ gtk_editable_set_position (GTK_EDITABLE (self->entry), position);
/* Set focus to the entry only when it can get focus
* https://gitlab.gnome.org/GNOME/gtk/issues/2204
*/
@@ -79,7 +82,7 @@ static void
on_button_clicked (PhoshKeypad *self,
GtkButton *btn)
{
- GtkWidget *label = gtk_bin_get_child (GTK_BIN (btn));
+ GtkWidget *label = gtk_button_get_child (btn);
const char *text = gtk_label_get_label (GTK_LABEL (label));
g_return_if_fail (!gm_str_is_null_or_empty (text));
@@ -158,10 +161,10 @@ swap_buttons (PhoshKeypad *self, int pos_a, int pos_b)
return;
a = gtk_grid_get_child_at (GTK_GRID (self), c_a, r_a);
- gtk_container_remove (GTK_CONTAINER (self), a);
+ gtk_grid_remove (GTK_GRID (self), a);
b = gtk_grid_get_child_at (GTK_GRID (self), c_b, r_b);
- gtk_container_remove (GTK_CONTAINER (self), b);
+ gtk_grid_remove (GTK_GRID (self), b);
gtk_grid_attach (GTK_GRID (self), a, c_b, r_b, 1, 1);
gtk_grid_attach (GTK_GRID (self), b, c_a, r_a, 1, 1);
@@ -185,7 +188,7 @@ distribute_buttons (PhoshKeypad *self, gboolean shuffle)
int r = btn_pos[i][1];
old = gtk_grid_get_child_at (GTK_GRID (self), c, r);
- gtk_container_remove (GTK_CONTAINER (self), old);
+ gtk_grid_remove (GTK_GRID (self), old);
}
for (int i = 0; i < NUM_DIGITS; i++) {
@@ -283,7 +286,8 @@ phosh_keypad_class_init (PhoshKeypadClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_button_clicked);
- gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_DIAL);
+ // FIXME Update to GTK 4
+ // gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_DIAL);
gtk_widget_class_set_css_name (widget_class, "phosh-keypad");
}
@@ -390,7 +394,7 @@ phosh_keypad_set_start_action (PhoshKeypad *self,
return;
if (old_widget != NULL)
- gtk_container_remove (GTK_CONTAINER (self), old_widget);
+ gtk_grid_remove (GTK_GRID (self), old_widget);
if (start_action != NULL)
gtk_grid_attach (GTK_GRID (self), start_action, 0, 3, 1, 1);
@@ -440,7 +444,7 @@ phosh_keypad_set_end_action (PhoshKeypad *self,
return;
if (old_widget != NULL)
- gtk_container_remove (GTK_CONTAINER (self), old_widget);
+ gtk_grid_remove (GTK_GRID (self), old_widget);
if (end_action != NULL)
gtk_grid_attach (GTK_GRID (self), end_action, 2, 3, 1, 1);
diff --git a/phosh/src/layersurface-priv.h b/phosh/src/layersurface-priv.h
index 61669ce42..566e5b0fe 100644
--- a/phosh/src/layersurface-priv.h
+++ b/phosh/src/layersurface-priv.h
@@ -12,8 +12,7 @@
G_BEGIN_DECLS
-GtkWidget *phosh_layer_surface_new (gpointer layer_shell,
- gpointer wl_output);
+GtkWidget *phosh_layer_surface_new (gpointer wl_output);
struct zwlr_layer_surface_v1 *phosh_layer_surface_get_layer_surface(PhoshLayerSurface *self);
struct wl_surface *phosh_layer_surface_get_wl_surface(PhoshLayerSurface *self);
void phosh_layer_surface_set_size(PhoshLayerSurface *self,
@@ -28,9 +27,9 @@ void phosh_layer_surface_set_exclusive_zone(PhoshLa
int zone);
void phosh_layer_surface_set_kbd_interactivity(PhoshLayerSurface *self,
gboolean interactivity);
-guint32 phosh_layer_surface_get_layer (PhoshLayerSurface *self);
-void phosh_layer_surface_set_layer (PhoshLayerSurface *self,
- guint32 layer);
+PhoshLayerSurfaceLayer phosh_layer_surface_get_layer (PhoshLayerSurface *self);
+void phosh_layer_surface_set_layer (PhoshLayerSurface *self,
+ PhoshLayerSurfaceLayer layer);
void phosh_layer_surface_wl_surface_commit (PhoshLayerSurface *self);
void phosh_layer_surface_get_margins (PhoshLayerSurface *self,
int *top,
@@ -46,5 +45,7 @@ void phosh_layer_surface_set_stacked_above (PhoshLa
void phosh_layer_surface_set_stacked_below (PhoshLayerSurface *self,
PhoshLayerSurface *target);
gpointer phosh_layer_surface_get_wl_output (PhoshLayerSurface *self);
+const char * phosh_layer_surface_get_namespace (PhoshLayerSurface *self);
+void phosh_layer_surface_destroy (PhoshLayerSurface *self);
G_END_DECLS
diff --git a/phosh/src/layersurface.c b/phosh/src/layersurface.c
index 52885b795..45ddc9fcc 100644
--- a/phosh/src/layersurface.c
+++ b/phosh/src/layersurface.c
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018-2023 Purism SPC
+ * 2026 Phosh.mobi e.V.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
@@ -9,11 +10,15 @@
#define G_LOG_DOMAIN "phosh-layer-surface"
#include "phosh-config.h"
+
#include "layersurface-priv.h"
+#include "phosh-enums.h"
#include "phosh-wayland.h"
#include "phoc-layer-shell-effects-unstable-v1-client-protocol.h"
-#include
+#include
+
+#include
/**
* PhoshLayerSurface:
@@ -26,25 +31,24 @@
*/
enum {
- PHOSH_LAYER_SURFACE_PROP_0,
- PHOSH_LAYER_SURFACE_PROP_LAYER_SHELL,
- PHOSH_LAYER_SURFACE_PROP_WL_OUTPUT,
- PHOSH_LAYER_SURFACE_PROP_ANCHOR,
- PHOSH_LAYER_SURFACE_PROP_LAYER,
- PHOSH_LAYER_SURFACE_PROP_KBD_INTERACTIVITY,
- PHOSH_LAYER_SURFACE_PROP_EXCLUSIVE_ZONE,
- PHOSH_LAYER_SURFACE_PROP_MARGIN_TOP,
- PHOSH_LAYER_SURFACE_PROP_MARGIN_BOTTOM,
- PHOSH_LAYER_SURFACE_PROP_MARGIN_LEFT,
- PHOSH_LAYER_SURFACE_PROP_MARGIN_RIGHT,
- PHOSH_LAYER_SURFACE_PROP_LAYER_WIDTH,
- PHOSH_LAYER_SURFACE_PROP_LAYER_HEIGHT,
- PHOSH_LAYER_SURFACE_PROP_CONFIGURED_WIDTH,
- PHOSH_LAYER_SURFACE_PROP_CONFIGURED_HEIGHT,
- PHOSH_LAYER_SURFACE_PROP_NAMESPACE,
- PHOSH_LAYER_SURFACE_PROP_LAST_PROP
+ PROP_0,
+ PROP_WL_OUTPUT,
+ PROP_ANCHOR,
+ PROP_LAYER,
+ PROP_KBD_INTERACTIVITY,
+ PROP_EXCLUSIVE_ZONE,
+ PROP_MARGIN_TOP,
+ PROP_MARGIN_BOTTOM,
+ PROP_MARGIN_LEFT,
+ PROP_MARGIN_RIGHT,
+ PROP_LAYER_WIDTH,
+ PROP_LAYER_HEIGHT,
+ PROP_CONFIGURED_WIDTH,
+ PROP_CONFIGURED_HEIGHT,
+ PROP_NAMESPACE,
+ LAST_PROP
};
-static GParamSpec *props[PHOSH_LAYER_SURFACE_PROP_LAST_PROP];
+static GParamSpec *props[LAST_PROP];
enum {
CONFIGURED,
@@ -59,8 +63,8 @@ typedef struct {
struct zphoc_stacked_layer_surface_v1 *stacked_surface;
/* Properties */
- guint anchor;
- guint layer;
+ PhoshLayerSurfaceAnchor anchor;
+ PhoshLayerSurfaceLayer layer;
gboolean kbd_interactivity;
int exclusive_zone;
int margin_top, margin_bottom;
@@ -68,7 +72,6 @@ typedef struct {
int width, height;
int configured_width, configured_height;
char *namespace;
- struct zwlr_layer_shell_v1 *layer_shell;
struct wl_output *wl_output;
/* alpha_layer_surface_v1 */
double alpha;
@@ -77,7 +80,136 @@ typedef struct {
gboolean stack_above;
} PhoshLayerSurfacePrivate;
-G_DEFINE_TYPE_WITH_PRIVATE (PhoshLayerSurface, phosh_layer_surface, GTK_TYPE_WINDOW)
+G_DEFINE_TYPE_WITH_PRIVATE (PhoshLayerSurface, phosh_layer_surface, GTK_TYPE_PLAIN)
+
+
+static void
+phosh_layer_surface_compute_size (GtkPlain *plain,
+ GdkCustomSurfaceSize *size)
+
+{
+ PhoshLayerSurface *self = PHOSH_LAYER_SURFACE (plain);
+ PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
+ int width, height;
+
+ width = priv->configured_width ?: priv->width;
+ height = priv->configured_height ?: priv->height;
+
+ g_debug ("%s: %d: %dx%d", __func__, __LINE__, width, height);
+ gdk_custom_surface_size_set_size (size, width, height);
+}
+
+static struct zwlr_layer_surface_v1_listener layer_surface_listener;
+
+static void
+setup_layer_surface (PhoshLayerSurface *self)
+{
+ PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
+ PhoshWayland *wl = phosh_wayland_get_default ();
+ struct zwlr_layer_shell_v1 *layer_shell = phosh_wayland_get_zwlr_layer_shell_v1 (wl);
+ struct zphoc_layer_shell_effects_v1 *layer_shell_effects;
+
+ g_message ("Setting up layer surface %p: %s, %d", self, priv->namespace, priv->layer);
+
+ g_assert (layer_shell);
+ g_assert (priv->wl_surface);
+
+ priv->layer_surface = zwlr_layer_shell_v1_get_layer_surface (layer_shell,
+ priv->wl_surface,
+ priv->wl_output,
+ priv->layer,
+ priv->namespace ?: "");
+ zwlr_layer_surface_v1_set_exclusive_zone (priv->layer_surface, priv->exclusive_zone);
+ zwlr_layer_surface_v1_set_size (priv->layer_surface, priv->width, priv->height);
+ zwlr_layer_surface_v1_set_anchor (priv->layer_surface, priv->anchor);
+ zwlr_layer_surface_v1_set_margin (priv->layer_surface,
+ priv->margin_top,
+ priv->margin_right,
+ priv->margin_bottom,
+ priv->margin_left);
+ zwlr_layer_surface_v1_set_keyboard_interactivity (priv->layer_surface, priv->kbd_interactivity);
+ zwlr_layer_surface_v1_add_listener (priv->layer_surface,
+ &layer_surface_listener,
+ self);
+ wl_surface_commit (priv->wl_surface);
+
+ layer_shell_effects = phosh_wayland_get_zphoc_layer_shell_effects_v1 (wl);
+ priv->alpha_surface =
+ zphoc_layer_shell_effects_v1_get_alpha_layer_surface (layer_shell_effects,
+ priv->layer_surface);
+ priv->stacked_surface =
+ zphoc_layer_shell_effects_v1_get_stacked_layer_surface (layer_shell_effects,
+ priv->layer_surface);
+}
+
+
+static void
+phosh_layer_surface_realize (GtkWidget *widget)
+{
+ PhoshLayerSurface *self = PHOSH_LAYER_SURFACE (widget);
+ PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
+ GdkDisplay *display = gdk_display_get_default ();
+ GdkSurface *gdk_surface;
+
+ GTK_WIDGET_CLASS (phosh_layer_surface_parent_class)->realize (widget);
+
+ gdk_surface = gtk_native_get_surface (GTK_NATIVE (self));
+ priv->wl_surface = gdk_wayland_surface_get_wl_surface (GDK_WAYLAND_SURFACE (gdk_surface));
+
+ setup_layer_surface (self);
+
+ /* Process all pending events, otherwise we end up sending ack configure
+ * to a not yet configured surface */
+ gdk_display_sync (display);
+}
+
+
+static void
+phosh_layer_surface_unrealize (GtkWidget *widget)
+{
+ PhoshLayerSurface *self = PHOSH_LAYER_SURFACE (widget);
+ PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
+
+ GTK_WIDGET_CLASS (phosh_layer_surface_parent_class)->unrealize (widget);
+
+ g_clear_pointer (&priv->layer_surface, zwlr_layer_surface_v1_destroy);
+ priv->wl_surface = NULL;
+}
+
+
+static void phosh_layer_surface_set_stacked (PhoshLayerSurface *self, PhoshLayerSurface *target, gboolean above);
+static void set_alpha (PhoshLayerSurface *self, double alpha);
+
+
+static void
+phosh_layer_surface_map (GtkWidget *widget)
+{
+ PhoshLayerSurface *self = PHOSH_LAYER_SURFACE (widget);
+ PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
+
+ GTK_WIDGET_CLASS (phosh_layer_surface_parent_class)->map (widget);
+
+ /* Catch up with alpha values set before map */
+ if (!G_APPROX_VALUE (priv->alpha, 1.0, FLT_EPSILON))
+ set_alpha (self, priv->alpha);
+
+ /* Catch up with stackings set before map */
+ if (priv->stacked_surface)
+ phosh_layer_surface_set_stacked (self, priv->stack_target, priv->stack_above);
+}
+
+
+static void
+phosh_layer_surface_unmap (GtkWidget *widget)
+{
+ PhoshLayerSurface *self = PHOSH_LAYER_SURFACE (widget);
+ PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
+
+ g_clear_pointer (&priv->alpha_surface, zphoc_alpha_layer_surface_v1_destroy);
+ g_clear_pointer (&priv->stacked_surface, zphoc_stacked_layer_surface_v1_destroy);
+
+ GTK_WIDGET_CLASS (phosh_layer_surface_parent_class)->unmap (widget);
+}
static void
@@ -88,27 +220,27 @@ layer_surface_configure (void *data,
uint32_t height)
{
PhoshLayerSurface *self = data;
- PhoshLayerSurfacePrivate *priv;
+ PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
gboolean changed = FALSE;
g_return_if_fail (PHOSH_IS_LAYER_SURFACE (self));
- priv = phosh_layer_surface_get_instance_private (self);
- gtk_window_resize (GTK_WINDOW (self), width, height);
+
+ //gtk_window_resize (GTK_WINDOW (self), width, height);
zwlr_layer_surface_v1_ack_configure (surface, serial);
if (priv->configured_height != height) {
priv->configured_height = height;
changed = TRUE;
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_LAYER_SURFACE_PROP_CONFIGURED_HEIGHT]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_CONFIGURED_HEIGHT]);
}
if (priv->configured_width != width) {
priv->configured_width = width;
changed = TRUE;
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_LAYER_SURFACE_PROP_CONFIGURED_WIDTH]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_CONFIGURED_WIDTH]);
}
- g_debug ("Configured '%s' (%p) (%dx%d)", priv->namespace, self, width, height);
+ g_message ("Configured '%s' (%p) (%dx%d)", priv->namespace, self, width, height);
if (changed)
g_signal_emit (self, signals[CONFIGURED], 0);
}
@@ -128,16 +260,10 @@ layer_surface_closed (void *data,
g_debug ("Destroying layer surface '%s' (%p)", priv->namespace, self);
zwlr_layer_surface_v1_destroy (priv->layer_surface);
priv->layer_surface = NULL;
- gtk_widget_destroy (GTK_WIDGET (self));
+ //gtk_widget_destroy (GTK_WIDGET (self));
}
-static struct zwlr_layer_surface_v1_listener layer_surface_listener = {
- .configure = layer_surface_configure,
- .closed = layer_surface_closed,
-};
-
-
static void
set_alpha (PhoshLayerSurface *self, double alpha)
{
@@ -174,12 +300,12 @@ phosh_layer_surface_set_stacked (PhoshLayerSurface *self, PhoshLayerSurface *tar
}
if (priv->stacked_surface == NULL) {
- g_debug ("Trying to stack an unmapped layer surface '%s'", priv->namespace);
+ g_warning ("Trying to stack an unmapped layer surface '%s'", priv->namespace);
return;
}
if (target_priv->stacked_surface == NULL) {
- g_debug ("Trying to stack above an unmapped layer surface '%s'", target_priv->namespace);
+ g_warning ("Trying to stack above an unmapped layer surface '%s'", target_priv->namespace);
return;
}
@@ -192,6 +318,12 @@ phosh_layer_surface_set_stacked (PhoshLayerSurface *self, PhoshLayerSurface *tar
}
+static struct zwlr_layer_surface_v1_listener layer_surface_listener = {
+ .configure = layer_surface_configure,
+ .closed = layer_surface_closed,
+};
+
+
static void
phosh_layer_surface_set_property (GObject *object,
guint property_id,
@@ -203,61 +335,58 @@ phosh_layer_surface_set_property (GObject *object,
int width, height;
switch (property_id) {
- case PHOSH_LAYER_SURFACE_PROP_LAYER_SHELL:
- priv->layer_shell = g_value_get_pointer (value);
- break;
- case PHOSH_LAYER_SURFACE_PROP_WL_OUTPUT:
+ case PROP_WL_OUTPUT:
priv->wl_output = g_value_get_pointer (value);
break;
- case PHOSH_LAYER_SURFACE_PROP_ANCHOR:
- priv->anchor = g_value_get_uint (value);
+ case PROP_ANCHOR:
+ priv->anchor = g_value_get_flags (value);
break;
- case PHOSH_LAYER_SURFACE_PROP_LAYER:
- phosh_layer_surface_set_layer (self, g_value_get_uint (value));
+ case PROP_LAYER:
+ phosh_layer_surface_set_layer (self, g_value_get_enum (value));
break;
- case PHOSH_LAYER_SURFACE_PROP_KBD_INTERACTIVITY:
+ case PROP_KBD_INTERACTIVITY:
phosh_layer_surface_set_kbd_interactivity (self, g_value_get_boolean (value));
break;
- case PHOSH_LAYER_SURFACE_PROP_EXCLUSIVE_ZONE:
+ case PROP_EXCLUSIVE_ZONE:
phosh_layer_surface_set_exclusive_zone (self, g_value_get_int (value));
break;
- case PHOSH_LAYER_SURFACE_PROP_MARGIN_TOP:
+ case PROP_MARGIN_TOP:
phosh_layer_surface_set_margins (self,
g_value_get_int (value),
priv->margin_right,
priv->margin_bottom,
priv->margin_left);
break;
- case PHOSH_LAYER_SURFACE_PROP_MARGIN_BOTTOM:
+ case PROP_MARGIN_BOTTOM:
phosh_layer_surface_set_margins (self,
priv->margin_top,
priv->margin_right,
g_value_get_int (value),
priv->margin_left);
break;
- case PHOSH_LAYER_SURFACE_PROP_MARGIN_LEFT:
+ case PROP_MARGIN_LEFT:
phosh_layer_surface_set_margins (self,
priv->margin_top,
priv->margin_right,
priv->margin_bottom,
g_value_get_int (value));
break;
- case PHOSH_LAYER_SURFACE_PROP_MARGIN_RIGHT:
+ case PROP_MARGIN_RIGHT:
phosh_layer_surface_set_margins (self,
priv->margin_top,
g_value_get_int (value),
priv->margin_bottom,
priv->margin_left);
break;
- case PHOSH_LAYER_SURFACE_PROP_LAYER_WIDTH:
+ case PROP_LAYER_WIDTH:
width = g_value_get_uint (value);
phosh_layer_surface_set_size (self, width, priv->height);
break;
- case PHOSH_LAYER_SURFACE_PROP_LAYER_HEIGHT:
+ case PROP_LAYER_HEIGHT:
height = g_value_get_uint (value);
phosh_layer_surface_set_size (self, priv->width, height);
break;
- case PHOSH_LAYER_SURFACE_PROP_NAMESPACE:
+ case PROP_NAMESPACE:
g_free (priv->namespace);
priv->namespace = g_value_dup_string (value);
break;
@@ -278,49 +407,46 @@ phosh_layer_surface_get_property (GObject *object,
PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
switch (property_id) {
- case PHOSH_LAYER_SURFACE_PROP_LAYER_SHELL:
- g_value_set_pointer (value, priv->layer_shell);
- break;
- case PHOSH_LAYER_SURFACE_PROP_WL_OUTPUT:
+ case PROP_WL_OUTPUT:
g_value_set_pointer (value, priv->wl_output);
break;
- case PHOSH_LAYER_SURFACE_PROP_ANCHOR:
- g_value_set_uint (value, priv->anchor);
+ case PROP_ANCHOR:
+ g_value_set_flags (value, priv->anchor);
break;
- case PHOSH_LAYER_SURFACE_PROP_LAYER:
- g_value_set_uint (value, phosh_layer_surface_get_layer (self));
+ case PROP_LAYER:
+ g_value_set_enum (value, phosh_layer_surface_get_layer (self));
break;
- case PHOSH_LAYER_SURFACE_PROP_KBD_INTERACTIVITY:
+ case PROP_KBD_INTERACTIVITY:
g_value_set_boolean (value, priv->kbd_interactivity);
break;
- case PHOSH_LAYER_SURFACE_PROP_EXCLUSIVE_ZONE:
+ case PROP_EXCLUSIVE_ZONE:
g_value_set_int (value, priv->exclusive_zone);
break;
- case PHOSH_LAYER_SURFACE_PROP_MARGIN_TOP:
+ case PROP_MARGIN_TOP:
g_value_set_int (value, priv->margin_top);
break;
- case PHOSH_LAYER_SURFACE_PROP_MARGIN_BOTTOM:
+ case PROP_MARGIN_BOTTOM:
g_value_set_int (value, priv->margin_bottom);
break;
- case PHOSH_LAYER_SURFACE_PROP_MARGIN_LEFT:
+ case PROP_MARGIN_LEFT:
g_value_set_int (value, priv->margin_left);
break;
- case PHOSH_LAYER_SURFACE_PROP_MARGIN_RIGHT:
+ case PROP_MARGIN_RIGHT:
g_value_set_int (value, priv->margin_right);
break;
- case PHOSH_LAYER_SURFACE_PROP_LAYER_WIDTH:
+ case PROP_LAYER_WIDTH:
g_value_set_uint (value, priv->width);
break;
- case PHOSH_LAYER_SURFACE_PROP_LAYER_HEIGHT:
+ case PROP_LAYER_HEIGHT:
g_value_set_uint (value, priv->height);
break;
- case PHOSH_LAYER_SURFACE_PROP_CONFIGURED_WIDTH:
+ case PROP_CONFIGURED_WIDTH:
g_value_set_uint (value, priv->configured_width);
break;
- case PHOSH_LAYER_SURFACE_PROP_CONFIGURED_HEIGHT:
+ case PROP_CONFIGURED_HEIGHT:
g_value_set_uint (value, priv->configured_height);
break;
- case PHOSH_LAYER_SURFACE_PROP_NAMESPACE:
+ case PROP_NAMESPACE:
g_value_set_string (value, priv->namespace);
break;
default:
@@ -330,98 +456,6 @@ phosh_layer_surface_get_property (GObject *object,
}
-static void
-phosh_layer_surface_realize (GtkWidget *widget)
-{
- PhoshLayerSurface *self = PHOSH_LAYER_SURFACE (widget);
- PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
- GdkWindow *gdk_window;
-
- GTK_WIDGET_CLASS (phosh_layer_surface_parent_class)->realize (widget);
-
- gdk_window = gtk_widget_get_window (GTK_WIDGET (self));
- gdk_wayland_window_set_use_custom_surface (gdk_window);
- priv->wl_surface = gdk_wayland_window_get_wl_surface (gdk_window);
-
- gtk_window_set_decorated (GTK_WINDOW (self), FALSE);
-}
-
-
-static void
-phosh_layer_surface_map (GtkWidget *widget)
-{
- PhoshLayerSurface *self = PHOSH_LAYER_SURFACE (widget);
- PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
- PhoshWayland *wl = phosh_wayland_get_default ();
- struct zphoc_layer_shell_effects_v1 *layer_shell_effects;
-
- GTK_WIDGET_CLASS (phosh_layer_surface_parent_class)->map (widget);
-
- if (!priv->wl_surface) {
- GdkWindow *gdk_window;
-
- gdk_window = gtk_widget_get_window (GTK_WIDGET (self));
- gdk_wayland_window_set_use_custom_surface (gdk_window);
- priv->wl_surface = gdk_wayland_window_get_wl_surface (gdk_window);
- }
- g_debug ("Mapped '%s' (%p)", priv->namespace, self);
-
- priv->layer_surface = zwlr_layer_shell_v1_get_layer_surface (priv->layer_shell,
- priv->wl_surface,
- priv->wl_output,
- priv->layer,
- priv->namespace);
- zwlr_layer_surface_v1_set_exclusive_zone (priv->layer_surface, priv->exclusive_zone);
- zwlr_layer_surface_v1_set_size (priv->layer_surface, priv->width, priv->height);
- zwlr_layer_surface_v1_set_anchor (priv->layer_surface, priv->anchor);
- zwlr_layer_surface_v1_set_margin (priv->layer_surface,
- priv->margin_top,
- priv->margin_right,
- priv->margin_bottom,
- priv->margin_left);
- zwlr_layer_surface_v1_set_keyboard_interactivity (priv->layer_surface, priv->kbd_interactivity);
- zwlr_layer_surface_v1_add_listener (priv->layer_surface,
- &layer_surface_listener,
- self);
- wl_surface_commit (priv->wl_surface);
-
- /* Process all pending events, otherwise we end up sending ack configure
- * to a not yet configured surface */
- wl_display_roundtrip (gdk_wayland_display_get_wl_display (gdk_display_get_default ()));
-
- layer_shell_effects = phosh_wayland_get_zphoc_layer_shell_effects_v1 (wl);
- priv->alpha_surface =
- zphoc_layer_shell_effects_v1_get_alpha_layer_surface (layer_shell_effects,
- priv->layer_surface);
- priv->stacked_surface =
- zphoc_layer_shell_effects_v1_get_stacked_layer_surface (layer_shell_effects,
- priv->layer_surface);
-
- /* Catch up with alpha values set before map */
- if (!G_APPROX_VALUE (priv->alpha, 1.0, FLT_EPSILON))
- set_alpha (self, priv->alpha);
-
- /* Catch up with stackings set before map */
- if (priv->stacked_surface)
- phosh_layer_surface_set_stacked (self, priv->stack_target, priv->stack_above);
-}
-
-
-static void
-phosh_layer_surface_unmap (GtkWidget *widget)
-{
- PhoshLayerSurface *self = PHOSH_LAYER_SURFACE (widget);
- PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
-
- g_clear_pointer (&priv->alpha_surface, zphoc_alpha_layer_surface_v1_destroy);
- g_clear_pointer (&priv->stacked_surface, zphoc_stacked_layer_surface_v1_destroy);
- g_clear_pointer (&priv->layer_surface, zwlr_layer_surface_v1_destroy);
- priv->wl_surface = NULL;
-
- GTK_WIDGET_CLASS (phosh_layer_surface_parent_class)->unmap (widget);
-}
-
-
static void
phosh_layer_surface_configured_impl (PhoshLayerSurface *layer_surface)
{
@@ -450,6 +484,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
{
GObjectClass *object_class = (GObjectClass *)klass;
GtkWidgetClass *widget_class = (GtkWidgetClass *)klass;
+ GtkPlainClass *plain_class = (GtkPlainClass *)klass;
PhoshLayerSurfaceClass *layer_surface_class = PHOSH_LAYER_SURFACE_CLASS (klass);
object_class->dispose = phosh_layer_surface_dispose;
@@ -457,49 +492,44 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
object_class->get_property = phosh_layer_surface_get_property;
widget_class->realize = phosh_layer_surface_realize;
+ widget_class->unrealize = phosh_layer_surface_unrealize;
widget_class->map = phosh_layer_surface_map;
widget_class->unmap = phosh_layer_surface_unmap;
- layer_surface_class->configured = phosh_layer_surface_configured_impl;
+ plain_class->compute_size = phosh_layer_surface_compute_size;
- props[PHOSH_LAYER_SURFACE_PROP_LAYER_SHELL] =
- g_param_spec_pointer (
- "layer-shell",
- "Wayland Layer Shell Global",
- "The layer shell wayland global",
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ layer_surface_class->configured = phosh_layer_surface_configured_impl;
- props[PHOSH_LAYER_SURFACE_PROP_WL_OUTPUT] =
+ props[PROP_WL_OUTPUT] =
g_param_spec_pointer (
"wl-output",
"Wayland Output",
"The wl_output associated with this surface",
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- props[PHOSH_LAYER_SURFACE_PROP_ANCHOR] =
- g_param_spec_uint (
- "anchor",
- "Anchor edges",
- "The edges to anchor the surface to",
- 0,
- G_MAXUINT,
- 0,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
-
- props[PHOSH_LAYER_SURFACE_PROP_LAYER] =
- g_param_spec_uint (
- "layer",
- "Layer",
- "The layer the surface should be attached to",
- 0,
- G_MAXUINT,
- 0,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS |
- G_PARAM_EXPLICIT_NOTIFY);
-
- props[PHOSH_LAYER_SURFACE_PROP_KBD_INTERACTIVITY] =
+ /**
+ * PhoshLayerSurface:anchor:
+ *
+ * The edges the surface is anchored to
+ */
+ props[PROP_ANCHOR] =
+ g_param_spec_flags ("anchor", "", "",
+ PHOSH_TYPE_LAYER_SURFACE_ANCHOR,
+ PHOSH_LAYER_SURFACE_ANCHOR_NONE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+ /**
+ * PhoshLayerSurface:layer:
+ *
+ * The layer the surface is in
+ */
+ props[PROP_LAYER] =
+ g_param_spec_enum ("layer", "", "",
+ PHOSH_TYPE_LAYER_SURFACE_LAYER,
+ PHOSH_LAYER_SURFACE_LAYER_BACKGROUND,
+ G_PARAM_READWRITE |
+ G_PARAM_STATIC_STRINGS |
+ G_PARAM_EXPLICIT_NOTIFY);
+
+ props[PROP_KBD_INTERACTIVITY] =
g_param_spec_boolean (
"kbd-interactivity",
"Keyboard interactivity",
@@ -507,7 +537,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- props[PHOSH_LAYER_SURFACE_PROP_EXCLUSIVE_ZONE] =
+ props[PROP_EXCLUSIVE_ZONE] =
g_param_spec_int (
"exclusive-zone",
"Exclusive Zone",
@@ -517,7 +547,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- props[PHOSH_LAYER_SURFACE_PROP_MARGIN_LEFT] =
+ props[PROP_MARGIN_LEFT] =
g_param_spec_int (
"margin-left",
"Left margin",
@@ -527,7 +557,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- props[PHOSH_LAYER_SURFACE_PROP_MARGIN_RIGHT] =
+ props[PROP_MARGIN_RIGHT] =
g_param_spec_int (
"margin-right",
"Right margin",
@@ -537,7 +567,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- props[PHOSH_LAYER_SURFACE_PROP_MARGIN_TOP] =
+ props[PROP_MARGIN_TOP] =
g_param_spec_int (
"margin-top",
"Top margin",
@@ -547,7 +577,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- props[PHOSH_LAYER_SURFACE_PROP_MARGIN_BOTTOM] =
+ props[PROP_MARGIN_BOTTOM] =
g_param_spec_int (
"margin-bottom",
"Bottom margin",
@@ -557,7 +587,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- props[PHOSH_LAYER_SURFACE_PROP_LAYER_WIDTH] =
+ props[PROP_LAYER_WIDTH] =
g_param_spec_uint (
"width",
"Width",
@@ -567,7 +597,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- props[PHOSH_LAYER_SURFACE_PROP_LAYER_HEIGHT] =
+ props[PROP_LAYER_HEIGHT] =
g_param_spec_uint (
"height",
"Height",
@@ -578,7 +608,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- props[PHOSH_LAYER_SURFACE_PROP_CONFIGURED_WIDTH] =
+ props[PROP_CONFIGURED_WIDTH] =
g_param_spec_uint (
"configured-width",
"Configured width",
@@ -588,7 +618,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
0,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- props[PHOSH_LAYER_SURFACE_PROP_CONFIGURED_HEIGHT] =
+ props[PROP_CONFIGURED_HEIGHT] =
g_param_spec_uint (
"configured-height",
"Configured height",
@@ -598,7 +628,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
0,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
- props[PHOSH_LAYER_SURFACE_PROP_NAMESPACE] =
+ props[PROP_NAMESPACE] =
g_param_spec_string (
"namespace",
"Namespace",
@@ -606,7 +636,7 @@ phosh_layer_surface_class_init (PhoshLayerSurfaceClass *klass)
"",
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
- g_object_class_install_properties (object_class, PHOSH_LAYER_SURFACE_PROP_LAST_PROP, props);
+ g_object_class_install_properties (object_class, LAST_PROP, props);
/**
* PhoshLayerSurface::configured
@@ -635,13 +665,9 @@ phosh_layer_surface_init (PhoshLayerSurface *self)
GtkWidget *
-phosh_layer_surface_new (gpointer layer_shell,
- gpointer wl_output)
+phosh_layer_surface_new (gpointer wl_output)
{
- return g_object_new (PHOSH_TYPE_LAYER_SURFACE,
- "layer-shell", layer_shell,
- "wl-output", wl_output,
- NULL);
+ return g_object_new (PHOSH_TYPE_LAYER_SURFACE, "wl-output", wl_output, NULL);
}
@@ -715,10 +741,10 @@ phosh_layer_surface_set_size (PhoshLayerSurface *self, int width, int height)
}
if (priv->height != old_height)
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_LAYER_SURFACE_PROP_LAYER_HEIGHT]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_LAYER_HEIGHT]);
if (priv->width != old_width)
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_LAYER_SURFACE_PROP_LAYER_WIDTH]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_LAYER_WIDTH]);
}
@@ -758,13 +784,13 @@ phosh_layer_surface_set_margins (PhoshLayerSurface *self, int top, int right, in
zwlr_layer_surface_v1_set_margin (priv->layer_surface, top, right, bottom, left);
if (old_top != top)
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_LAYER_SURFACE_PROP_MARGIN_TOP]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_MARGIN_TOP]);
if (old_bottom != bottom)
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_LAYER_SURFACE_PROP_MARGIN_BOTTOM]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_MARGIN_BOTTOM]);
if (old_left != left)
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_LAYER_SURFACE_PROP_MARGIN_LEFT]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_MARGIN_LEFT]);
if (old_right != right)
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_LAYER_SURFACE_PROP_MARGIN_RIGHT]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_MARGIN_RIGHT]);
}
@@ -794,7 +820,7 @@ phosh_layer_surface_set_exclusive_zone (PhoshLayerSurface *self, int zone)
if (priv->layer_surface)
zwlr_layer_surface_v1_set_exclusive_zone (priv->layer_surface, zone);
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_LAYER_SURFACE_PROP_EXCLUSIVE_ZONE]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_EXCLUSIVE_ZONE]);
}
@@ -821,7 +847,7 @@ phosh_layer_surface_set_kbd_interactivity (PhoshLayerSurface *self, gboolean int
if (priv->layer_surface)
zwlr_layer_surface_v1_set_keyboard_interactivity (priv->layer_surface, interactivity);
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_LAYER_SURFACE_PROP_KBD_INTERACTIVITY]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_KBD_INTERACTIVITY]);
}
/**
@@ -832,7 +858,7 @@ phosh_layer_surface_set_kbd_interactivity (PhoshLayerSurface *self, gboolean int
*
* Returns: The layer
*/
-guint32
+PhoshLayerSurfaceLayer
phosh_layer_surface_get_layer (PhoshLayerSurface *self)
{
PhoshLayerSurfacePrivate *priv;
@@ -851,7 +877,7 @@ phosh_layer_surface_get_layer (PhoshLayerSurface *self)
* Sets the layer a layer-surface belongs to `layer`.
*/
void
-phosh_layer_surface_set_layer (PhoshLayerSurface *self, guint32 layer)
+phosh_layer_surface_set_layer (PhoshLayerSurface *self, PhoshLayerSurfaceLayer layer)
{
PhoshLayerSurfacePrivate *priv;
@@ -866,7 +892,7 @@ phosh_layer_surface_set_layer (PhoshLayerSurface *self, guint32 layer)
if (priv->layer_surface)
zwlr_layer_surface_v1_set_layer (priv->layer_surface, layer);
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_LAYER_SURFACE_PROP_LAYER]);
+ g_object_notify_by_pspec (G_OBJECT (self), props[PROP_LAYER]);
}
/**
@@ -952,6 +978,17 @@ phosh_layer_surface_get_configured_height (PhoshLayerSurface *self)
}
+const char *
+phosh_layer_surface_get_namespace (PhoshLayerSurface *self)
+{
+ PhoshLayerSurfacePrivate *priv = phosh_layer_surface_get_instance_private (self);
+
+ g_return_val_if_fail (PHOSH_IS_LAYER_SURFACE (self), NULL);
+
+ return priv->namespace;
+}
+
+
void
phosh_layer_surface_set_alpha (PhoshLayerSurface *self, double alpha)
{
@@ -1013,3 +1050,10 @@ phosh_layer_surface_set_stacked_below (PhoshLayerSurface *self, PhoshLayerSurfac
phosh_layer_surface_set_stacked (self, target, FALSE);
}
+
+
+void
+phosh_layer_surface_destroy (PhoshLayerSurface *self)
+{
+ gtk_plain_destroy (GTK_PLAIN (self));
+}
diff --git a/phosh/src/layersurface.h b/phosh/src/layersurface.h
index dd1a31367..388de21b5 100644
--- a/phosh/src/layersurface.h
+++ b/phosh/src/layersurface.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2018 Purism SPC
+ * 2026 Phosh.mobi e.V.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
@@ -12,7 +13,24 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_LAYER_SURFACE (phosh_layer_surface_get_type ())
-G_DECLARE_DERIVABLE_TYPE (PhoshLayerSurface, phosh_layer_surface, PHOSH, LAYER_SURFACE, GtkWindow)
+G_DECLARE_DERIVABLE_TYPE (PhoshLayerSurface, phosh_layer_surface, PHOSH, LAYER_SURFACE, GtkPlain)
+
+/* Must match the Waland protocol values */
+typedef enum {
+ PHOSH_LAYER_SURFACE_ANCHOR_NONE = 0,
+ PHOSH_LAYER_SURFACE_ANCHOR_TOP = (1 << 0),
+ PHOSH_LAYER_SURFACE_ANCHOR_BOTTOM = (1 << 1),
+ PHOSH_LAYER_SURFACE_ANCHOR_LEFT = (1 << 2),
+ PHOSH_LAYER_SURFACE_ANCHOR_RIGHT = (1 << 3),
+} PhoshLayerSurfaceAnchor;
+
+/* Must match the Wayland protocol values */
+typedef enum {
+ PHOSH_LAYER_SURFACE_LAYER_BACKGROUND = 0,
+ PHOSH_LAYER_SURFACE_LAYER_BOTTOM = 1,
+ PHOSH_LAYER_SURFACE_LAYER_TOP = 2,
+ PHOSH_LAYER_SURFACE_LAYER_OVERLAY = 3,
+} PhoshLayerSurfaceLayer;
/**
* PhoshLayerSurfaceClass
@@ -39,4 +57,7 @@ struct _PhoshLayerSurfaceClass
void (*_phosh_reserved9) (void);
};
+void
+phosh_layer_surface_set_child (PhoshLayerSurface *self, GtkWidget *child);
+
G_END_DECLS
diff --git a/phosh/src/location-manager.c b/phosh/src/location-manager.c
index 9c3496a19..1e62a2c25 100644
--- a/phosh/src/location-manager.c
+++ b/phosh/src/location-manager.c
@@ -251,7 +251,7 @@ handle_authorize_app (PhoshDBusGeoClue2Agent *object,
/* Cancel any ongoing prompt */
if (self->prompt)
- gtk_widget_destroy (GTK_WIDGET (self->prompt));
+ gtk_window_destroy (GTK_WINDOW (self->prompt));
if (self->invocation) {
phosh_dbus_geo_clue2_agent_complete_authorize_app (
diff --git a/phosh/src/lockscreen-bg.c b/phosh/src/lockscreen-bg.c
index 79c64d1bf..56490e004 100644
--- a/phosh/src/lockscreen-bg.c
+++ b/phosh/src/lockscreen-bg.c
@@ -76,24 +76,31 @@ phosh_lockscreen_bg_configured (PhoshLayerSurface *layer_surface)
}
-static gboolean
-phosh_lockscreen_bg_draw (GtkWidget *widget, cairo_t *cr)
+static void
+phosh_lockscreen_bg_snapshot (GtkWidget *widget, GtkSnapshot *snapshot)
{
- GtkStyleContext *context;
PhoshLockscreenBg *self = PHOSH_LOCKSCREEN_BG (widget);
+ graphene_rect_t bounds;
int x = 0, y = 0, width, height;
+ cairo_t *cr;
- g_return_val_if_fail (PHOSH_IS_LOCKSCREEN_BG (self), GDK_EVENT_PROPAGATE);
+ g_return_if_fail (PHOSH_IS_LOCKSCREEN_BG (self));
if (!self->configured)
- return GDK_EVENT_PROPAGATE;
+ return;
+ bounds.origin.x = 0;
+ bounds.origin.y = 0;
+ bounds.size.width = gtk_widget_get_width (GTK_WIDGET (self));
+ bounds.size.height = gtk_widget_get_height (GTK_WIDGET (self));
+
+ cr = gtk_snapshot_append_cairo (snapshot, &bounds);
cairo_save (cr);
- context = gtk_widget_get_style_context (GTK_WIDGET (self));
- width = gtk_widget_get_allocated_width (GTK_WIDGET (self));
- height = gtk_widget_get_allocated_height (GTK_WIDGET (self));
- gtk_render_background (context, cr, 0, 0, width, height);
+ width = gtk_widget_get_width (GTK_WIDGET (self));
+ height = gtk_widget_get_height (GTK_WIDGET (self));
+ // FIXME Port to GTK 4
+ // gtk_render_background (context, cr, 0, 0, width, height);
if (self->pixbuf && self->use_background) {
gdk_cairo_set_source_pixbuf (cr, self->pixbuf, x, y);
@@ -101,8 +108,7 @@ phosh_lockscreen_bg_draw (GtkWidget *widget, cairo_t *cr)
}
cairo_restore (cr);
-
- return GDK_EVENT_PROPAGATE;
+ cairo_destroy (cr);
}
@@ -138,7 +144,7 @@ phosh_lockscreen_bg_class_init (PhoshLockscreenBgClass *klass)
object_class->finalize = phosh_lockscreen_bg_finalize;
- widget_class->draw = phosh_lockscreen_bg_draw;
+ widget_class->snapshot = phosh_lockscreen_bg_snapshot;
layer_surface_class->configured = phosh_lockscreen_bg_configured;
@@ -162,10 +168,9 @@ phosh_lockscreen_bg_init (PhoshLockscreenBg *self)
PhoshLockscreenBg *
-phosh_lockscreen_bg_new (struct zwlr_layer_shell_v1 *layer_shell, struct wl_output *wl_output)
+phosh_lockscreen_bg_new (struct wl_output *wl_output)
{
return g_object_new (PHOSH_TYPE_LOCKSCREEN_BG,
- "layer-shell", layer_shell,
"wl-output", wl_output,
"anchor", (ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
diff --git a/phosh/src/lockscreen-bg.h b/phosh/src/lockscreen-bg.h
index 11a396792..999a6a45c 100644
--- a/phosh/src/lockscreen-bg.h
+++ b/phosh/src/lockscreen-bg.h
@@ -18,8 +18,7 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (PhoshLockscreenBg, phosh_lockscreen_bg, PHOSH, LOCKSCREEN_BG,
PhoshLayerSurface)
-PhoshLockscreenBg * phosh_lockscreen_bg_new (struct zwlr_layer_shell_v1 *layer_shell,
- struct wl_output *wl_output);
+PhoshLockscreenBg * phosh_lockscreen_bg_new (struct wl_output *wl_output);
void phosh_lockscreen_bg_set_image (PhoshLockscreenBg *self,
PhoshBackgroundImage *image);
diff --git a/phosh/src/lockscreen-manager.c b/phosh/src/lockscreen-manager.c
index 9ba16e1a3..f1130d449 100644
--- a/phosh/src/lockscreen-manager.c
+++ b/phosh/src/lockscreen-manager.c
@@ -11,6 +11,7 @@
#include "background-cache.h"
#include "background-image.h"
+#include "layersurface-priv.h"
#include "lockscreen-manager-priv.h"
#include "lockscreen-priv.h"
#include "lockshield.h"
@@ -21,8 +22,6 @@
#include "util.h"
#include
-#include
-#include
#define SCREENSAVER_SETTINGS "org.gnome.desktop.screensaver"
#define KEY_PICTURE_URI "picture-uri"
@@ -200,6 +199,7 @@ on_lockscreen_unlock (PhoshLockscreenManager *self, PhoshLockscreen *lockscreen)
PhoshShell *shell = phosh_shell_get_default ();
PhoshMonitorManager *monitor_manager = phosh_shell_get_monitor_manager (shell);
PhoshMonitor *primary_monitor = phosh_shell_get_primary_monitor (shell);
+ PhoshLayerSurface *lockscreen_layer_surface = PHOSH_LAYER_SURFACE (lockscreen);
g_return_if_fail (PHOSH_IS_LOCKSCREEN (lockscreen));
g_return_if_fail (lockscreen == PHOSH_LOCKSCREEN (self->lockscreen));
@@ -207,7 +207,7 @@ on_lockscreen_unlock (PhoshLockscreenManager *self, PhoshLockscreen *lockscreen)
g_signal_handlers_disconnect_by_data (monitor_manager, self);
g_signal_handlers_disconnect_by_data (primary_monitor, self);
g_signal_handlers_disconnect_by_data (shell, self);
- g_clear_pointer (&self->lockscreen, phosh_cp_widget_destroy);
+ g_clear_pointer (&lockscreen_layer_surface, phosh_layer_surface_destroy);
/* Unlock all other outputs */
g_clear_pointer (&self->shields, g_ptr_array_unref);
@@ -235,7 +235,6 @@ lock_monitor (PhoshLockscreenManager *self,
PhoshMonitor *monitor)
{
PhoshShell *shell = phosh_shell_get_default ();
- PhoshWayland *wl = phosh_wayland_get_default ();
GtkWidget *shield;
/* Primary monitor is handled via on_primary_monitor_changed */
@@ -243,7 +242,7 @@ lock_monitor (PhoshLockscreenManager *self,
return;
g_debug ("Adding shield for %s", monitor->name);
- shield = phosh_lockshield_new (phosh_wayland_get_zwlr_layer_shell_v1 (wl), monitor);
+ shield = phosh_lockshield_new (monitor);
g_object_set_data (G_OBJECT (shield), "phosh-monitor", monitor);
@@ -395,7 +394,7 @@ lockscreen_lock (PhoshLockscreenManager *self)
g_message ("No primary monitor to lock");
/* Lock all other outputs */
- self->shields = g_ptr_array_new_with_free_func ((GDestroyNotify) (gtk_widget_destroy));
+ self->shields = g_ptr_array_new_with_free_func ((GDestroyNotify) (gtk_window_destroy));
for (int i = 0; i < phosh_monitor_manager_get_num_monitors (monitor_manager); i++) {
PhoshMonitor *monitor = phosh_monitor_manager_get_monitor (monitor_manager, i);
diff --git a/phosh/src/lockscreen.c b/phosh/src/lockscreen.c
index 065eefa73..dab84eb61 100644
--- a/phosh/src/lockscreen.c
+++ b/phosh/src/lockscreen.c
@@ -30,7 +30,7 @@
#include
#include
-#include
+#include
#include
@@ -73,7 +73,7 @@ enum {
static guint signals[N_SIGNALS] = { 0 };
typedef struct {
- HdyDeck *deck;
+ AdwNavigationView *deck;
GtkWidget *carousel;
PhoshLockscreenPage default_page;
gboolean require_unlock;
@@ -105,9 +105,10 @@ typedef struct {
PhoshAuth *auth;
GSettings *lockscreen_settings;
+ /* Volume Gesture */
struct {
- GtkGesture *swipe_gesture;
- double x_start;
+ GtkGesture *gesture;
+ double x_start, y_start;
double base;
} brightness;
@@ -115,7 +116,7 @@ typedef struct {
GtkWidget *extra_page;
/* widget box */
- PhoshWidgetBox *widget_box;
+ GtkWidget *widget_box;
/* Call page */
GtkBox *box_call_display;
@@ -133,33 +134,35 @@ G_DEFINE_TYPE_WITH_PRIVATE (PhoshLockscreen, phosh_lockscreen, PHOSH_TYPE_LAYER_
static gboolean
is_valid (PhoshLockscreen *self, GtkGesture *gesture, double *x_center)
{
- double y_center, v_x, v_y;
+ double y_center, scale;
uint height;
gboolean active;
active = gtk_gesture_get_bounding_box_center (gesture, x_center, &y_center);
- if (!active)
+ if (!active) {
return FALSE;
+ }
- height = gtk_widget_get_allocated_height (GTK_WIDGET (self));
+ height = gtk_widget_get_height (GTK_WIDGET (self));
/* Swipe must happen in the upper screen half */
- if (y_center > 0.5 * height)
- return FALSE;
-
- if (!gtk_gesture_swipe_get_velocity (GTK_GESTURE_SWIPE (gesture), &v_x, &v_y))
+ if (y_center > 0.5 * height) {
return FALSE;
+ }
- if (ABS (v_x) > 3.0 * ABS (v_y))
+ scale = gtk_gesture_zoom_get_scale_delta (GTK_GESTURE_ZOOM (gesture));
+ /* We don't want to actually zoom */
+ if (scale >= 0.9 && scale <= 1.1) {
return TRUE;
+ }
return FALSE;
}
static void
-on_swipe_gesture_update (PhoshLockscreen *self,
- GdkEventSequence *sequence,
- GtkGesture *gesture)
+on_zoom_gesture_update (PhoshLockscreen *self,
+ GdkEventSequence *sequence,
+ GtkGesture *gesture)
{
PhoshLockscreenPrivate *priv = phosh_lockscreen_get_instance_private (self);
PhoshBrightnessManager *manager;
@@ -173,11 +176,8 @@ on_swipe_gesture_update (PhoshLockscreen *self,
return;
manager = phosh_shell_get_brightness_manager (phosh_shell_get_default ());
- width = gtk_widget_get_allocated_width (GTK_WIDGET (self));
-
- brightness = priv->brightness.base;
- /* Use at least 1% steps to avoid too many updates */
- brightness += 0.01 * (int)(100 * (x_center - priv->brightness.x_start) / width);
+ width = gtk_widget_get_width (GTK_WIDGET (self));
+ brightness = priv->brightness.base + (x_center - priv->brightness.x_start) / width;
g_debug ("Brightness gesture updating: %f", brightness);
phosh_brightness_manager_set_value (manager, CLAMP (brightness, 0.0, 1.0), TRUE);
@@ -185,9 +185,9 @@ on_swipe_gesture_update (PhoshLockscreen *self,
static void
-on_swipe_gesture_begin (PhoshLockscreen *self,
- GdkEventSequence *sequence,
- GtkGesture *gesture)
+on_zoom_gesture_begin (PhoshLockscreen *self,
+ GdkEventSequence *sequence,
+ GtkGesture *gesture)
{
gdouble x_center;
PhoshLockscreenPrivate *priv = phosh_lockscreen_get_instance_private (self);
@@ -207,6 +207,7 @@ on_swipe_gesture_begin (PhoshLockscreen *self,
priv->brightness.base);
}
+static void phosh_lockscreen_add_background (PhoshLockscreen *self);
static void
phosh_lockscreen_map (GtkWidget *widget)
@@ -216,6 +217,9 @@ phosh_lockscreen_map (GtkWidget *widget)
GTK_WIDGET_CLASS (phosh_lockscreen_parent_class)->map (widget);
+ if (!priv->background)
+ phosh_lockscreen_add_background (self);
+
phosh_layer_surface_set_stacked_below (PHOSH_LAYER_SURFACE (priv->background),
PHOSH_LAYER_SURFACE (self));
}
@@ -286,10 +290,14 @@ clear_input (PhoshLockscreen *self, gboolean clear_all)
{
PhoshLockscreenPrivate *priv = phosh_lockscreen_get_instance_private (self);
- if (clear_all)
+ if (clear_all) {
gtk_editable_delete_text (GTK_EDITABLE (priv->entry_pin), 0, -1);
- else
- g_signal_emit_by_name (priv->entry_pin, "backspace", NULL);
+ } else {
+ int position = gtk_editable_get_position (GTK_EDITABLE (priv->entry_pin));
+ if (position == 0)
+ return;
+ gtk_editable_delete_text (GTK_EDITABLE (priv->entry_pin), position - 1, position);
+ }
}
@@ -436,8 +444,9 @@ on_osk_visibility_changed (PhoshLockscreen *self,
g_assert (PHOSH_IS_LOCKSCREEN (self));
priv = phosh_lockscreen_get_instance_private (self);
- if (!phosh_osk_manager_get_visible (osk))
+ if (!phosh_osk_manager_get_visible (osk)) {
g_object_set (priv->entry_pin, "im-module", "gtk-im-context-none", NULL);
+ }
}
@@ -480,23 +489,27 @@ submit_cb (PhoshLockscreen *self)
static gboolean
-key_press_event_cb (PhoshLockscreen *self, GdkEventKey *event, gpointer data)
+key_press_event_cb (PhoshLockscreen *self,
+ guint keyval,
+ guint keycode,
+ GdkModifierType state,
+ GtkEventControllerKey *controller)
{
PhoshLockscreenPrivate *priv;
gboolean handled = FALSE;
- gboolean on_unlock_page, with_control;
+ gboolean on_unlock_page;
g_assert (PHOSH_IS_LOCKSCREEN (self));
priv = phosh_lockscreen_get_instance_private (self);
on_unlock_page = phosh_lockscreen_get_page (self) == PHOSH_LOCKSCREEN_PAGE_UNLOCK;
- with_control = event->state & GDK_CONTROL_MASK;
- if (gtk_entry_im_context_filter_keypress (GTK_ENTRY (priv->entry_pin), event)) {
+ // FIXME Port to GTK 4
+ if (gtk_event_controller_key_forward (controller, priv->entry_pin)) {
show_unlock_page (self);
handled = TRUE;
} else {
- switch (event->keyval) {
+ switch (keyval) {
case GDK_KEY_space:
show_unlock_page (self);
handled = TRUE;
@@ -522,17 +535,6 @@ key_press_event_cb (PhoshLockscreen *self, GdkEventKey *event, gpointer data)
handled = TRUE;
}
break;
- case GDK_KEY_Left:
- if (!on_unlock_page && with_control && hdy_deck_get_can_swipe_back (priv->deck)) {
- hdy_deck_navigate (priv->deck, HDY_NAVIGATION_DIRECTION_BACK);
- handled = TRUE;
- }
- break;
- case GDK_KEY_Right:
- if (!on_unlock_page && with_control && hdy_deck_get_can_swipe_forward (priv->deck)) {
- hdy_deck_navigate (priv->deck, HDY_NAVIGATION_DIRECTION_FORWARD);
- handled = TRUE;
- }
default:
/* nothing to do */
break;
@@ -567,7 +569,7 @@ wall_clock_notify_cb (PhoshLockscreen *self,
static void
carousel_position_notified_cb (PhoshLockscreen *self,
GParamSpec *pspec,
- HdyCarousel *carousel)
+ AdwCarousel *carousel)
{
PhoshLockscreenPrivate *priv = phosh_lockscreen_get_instance_private (self);
g_clear_handle_id (&priv->idle_timer, g_source_remove);
@@ -576,7 +578,7 @@ carousel_position_notified_cb (PhoshLockscreen *self,
static void
carousel_page_changed_cb (PhoshLockscreen *self,
guint index,
- HdyCarousel *carousel)
+ AdwCarousel *carousel)
{
PhoshLockscreenPrivate *priv = phosh_lockscreen_get_instance_private (self);
PhoshShell *shell = phosh_shell_get_default ();
@@ -630,6 +632,8 @@ static void
on_calls_call_added (PhoshLockscreen *self, const char *path)
{
PhoshLockscreenPrivate *priv;
+ AdwNavigationPage *visible_page;
+ const char *visible_page_tag;
g_return_if_fail (PHOSH_IS_LOCKSCREEN (self));
priv = phosh_lockscreen_get_instance_private (self);
@@ -637,7 +641,17 @@ on_calls_call_added (PhoshLockscreen *self, const char *path)
update_active_call (self, path);
- hdy_deck_set_visible_child (priv->deck, GTK_WIDGET (priv->box_call_display));
+ visible_page = adw_navigation_view_get_visible_page (priv->deck);
+ visible_page_tag = adw_navigation_page_get_tag (visible_page);
+
+ if (g_str_equal (visible_page_tag, "box_widget_box")) {
+ adw_navigation_view_push_by_tag (priv->deck, "box_info");
+ adw_navigation_view_push_by_tag (priv->deck, "box_call_display");
+ } else if (g_str_equal (visible_page_tag, "box_info")) {
+ adw_navigation_view_push_by_tag (priv->deck, "box_call_display");
+ } else {
+ /* Already in box_call_display, so nothing to do. */
+ }
}
@@ -645,6 +659,8 @@ static void
on_calls_call_removed (PhoshLockscreen *self, const char *path)
{
PhoshLockscreenPrivate *priv;
+ AdwNavigationPage *visible_page;
+ const char *visible_page_tag;
g_return_if_fail (path != NULL);
g_return_if_fail (PHOSH_IS_LOCKSCREEN (self));
@@ -657,7 +673,16 @@ on_calls_call_removed (PhoshLockscreen *self, const char *path)
g_clear_pointer (&priv->active, g_free);
- hdy_deck_set_visible_child (priv->deck, GTK_WIDGET (priv->box_info));
+ visible_page = adw_navigation_view_get_visible_page (priv->deck);
+ visible_page_tag = adw_navigation_page_get_tag (visible_page);
+
+ if (g_str_equal (visible_page_tag, "box_widget_box")) {
+ adw_navigation_view_push_by_tag (priv->deck, "box_info");
+ } else if (g_str_equal (visible_page_tag, "box_call_display")) {
+ adw_navigation_view_pop (priv->deck);
+ } else {
+ /* Already in box_info, so nothing to do. */
+ }
}
@@ -672,48 +697,28 @@ create_call_notification_row (gpointer item, gpointer data)
}
-static void
-on_deck_visible_child_changed (PhoshLockscreen *self, GParamSpec *pspec, HdyDeck *deck)
+static AdwNavigationPage *
+on_deck_get_next_page (PhoshLockscreen *self, AdwNavigationView *deck)
{
- GtkWidget *visible_child;
PhoshLockscreenPrivate *priv;
- gboolean swipe_forward = TRUE;
- gboolean swipe_back = TRUE;
+ AdwNavigationPage *visible_page;
+ const char *visible_page_tag, *next_page_tag;
- g_return_if_fail (HDY_IS_DECK (deck));
- g_return_if_fail (PHOSH_IS_LOCKSCREEN (self));
priv = phosh_lockscreen_get_instance_private (self);
+ visible_page = adw_navigation_view_get_visible_page (deck);
+ visible_page_tag = adw_navigation_page_get_tag (visible_page);
+
+ if (g_str_equal (visible_page_tag, "box_widget_box")) {
+ next_page_tag = "box_info";
+ } else if (g_str_equal (visible_page_tag, "box_info")) {
+ if (!priv->active)
+ return NULL;
+ next_page_tag = "box_call_display";
+ } else {
+ return NULL;
+ }
- visible_child = hdy_deck_get_visible_child (deck);
-
- /* Avoid forward swipe to calls page if there's no active call */
- if (visible_child == priv->box_info &&
- phosh_calls_manager_get_active_call_handle (priv->calls_manager) == NULL)
- swipe_forward = FALSE;
-
- /* Avoid backward swipe to widget-box if there's no plugin */
- if (visible_child == priv->box_info && !phosh_widget_box_has_plugins (priv->widget_box))
- swipe_back = FALSE;
-
- hdy_deck_set_can_swipe_forward (deck, swipe_forward);
- hdy_deck_set_can_swipe_back (deck, swipe_back);
-}
-
-
-static void
-on_deck_transition_running_changed (PhoshLockscreen *self)
-{
- PhoshLockscreenPrivate *priv;
-
- g_return_if_fail (PHOSH_IS_LOCKSCREEN (self));
- priv = phosh_lockscreen_get_instance_private (self);
-
- if (hdy_deck_get_transition_running (priv->deck))
- return;
-
- /* Otherwise we might see stale information */
- /* See https://gitlab.gnome.org/World/Phosh/phosh/-/issues/922 */
- gtk_widget_queue_draw (priv->lbl_clock);
+ return g_object_ref (adw_navigation_view_find_page (deck, next_page_tag));
}
@@ -733,7 +738,7 @@ create_notification_row (gpointer item, gpointer data)
phosh_notification_frame_bind_model (PHOSH_NOTIFICATION_FRAME (frame), item);
gtk_widget_set_visible (frame, TRUE);
- gtk_container_add (GTK_CONTAINER (row), frame);
+ gtk_list_box_row_set_child (GTK_LIST_BOX_ROW (row), frame);
return row;
}
@@ -769,7 +774,7 @@ on_call_notification_activated (PhoshLockscreen *self,
g_return_if_fail (PHOSH_IS_LOCKSCREEN (self));
priv = phosh_lockscreen_get_instance_private (self);
- hdy_deck_set_visible_child (priv->deck, GTK_WIDGET (priv->box_call_display));
+ adw_navigation_view_push_by_tag (priv->deck, "box_call_display");
}
@@ -833,12 +838,10 @@ static void
phosh_lockscreen_add_background (PhoshLockscreen *self)
{
PhoshLockscreenPrivate *priv = phosh_lockscreen_get_instance_private (self);
- PhoshWayland *wl = phosh_wayland_get_default ();
struct wl_output *wl_output;
wl_output = phosh_layer_surface_get_wl_output (PHOSH_LAYER_SURFACE (self));
- priv->background = phosh_lockscreen_bg_new (phosh_wayland_get_zwlr_layer_shell_v1 (wl),
- wl_output);
+ priv->background = phosh_lockscreen_bg_new (wl_output);
g_object_bind_property (self, "visible", priv->background, "visible", G_BINDING_SYNC_CREATE);
}
@@ -858,15 +861,6 @@ phosh_lockscreen_constructed (GObject *object)
G_OBJECT_CLASS (phosh_lockscreen_parent_class)->constructed (object);
- /* window properties */
- gtk_window_set_title (GTK_WINDOW (self), "phosh lockscreen");
- gtk_window_set_decorated (GTK_WINDOW (self), FALSE);
-
- gtk_widget_add_events (GTK_WIDGET (self), GDK_KEY_PRESS_MASK);
- g_signal_connect (G_OBJECT (self),
- "key_press_event",
- G_CALLBACK (key_press_event_cb),
- NULL);
g_signal_connect (G_OBJECT (self),
"show",
G_CALLBACK (on_show),
@@ -949,10 +943,15 @@ phosh_lockscreen_constructed (GObject *object)
if (plugins)
phosh_widget_box_set_plugins (PHOSH_WIDGET_BOX (priv->widget_box), plugins);
- on_deck_visible_child_changed (self, NULL, priv->deck);
- on_info_reveal_child_changed (self);
+ if (!phosh_widget_box_has_plugins (PHOSH_WIDGET_BOX (priv->widget_box))) {
+ AdwNavigationPage *box_info = adw_navigation_view_find_page (priv->deck, "box_info");
+ AdwNavigationPage *pages[] = {box_info};
+ adw_navigation_view_replace (priv->deck, pages, 1);
+ } else {
+ adw_navigation_view_push_by_tag (priv->deck, "box_info");
+ }
- phosh_lockscreen_add_background (self);
+ on_info_reveal_child_changed (self);
}
static void
@@ -961,7 +960,7 @@ deck_back_clicked_cb (GtkWidget *sender,
{
PhoshLockscreenPrivate *priv = phosh_lockscreen_get_instance_private (self);
- hdy_deck_set_visible_child (priv->deck, GTK_WIDGET (priv->box_info));
+ adw_navigation_view_pop (priv->deck);
}
@@ -971,7 +970,7 @@ deck_forward_clicked_cb (GtkWidget *sender,
{
PhoshLockscreenPrivate *priv = phosh_lockscreen_get_instance_private (self);
- hdy_deck_set_visible_child (priv->deck, GTK_WIDGET (priv->box_info));
+ adw_navigation_view_push_by_tag (priv->deck, "box_info");
}
@@ -980,14 +979,16 @@ phosh_lockscreen_dispose (GObject *object)
{
PhoshLockscreen *self = PHOSH_LOCKSCREEN (object);
PhoshLockscreenPrivate *priv = phosh_lockscreen_get_instance_private (self);
+ PhoshLayerSurface *background_layer_surface = PHOSH_LAYER_SURFACE (priv->background);
+
+ gtk_widget_dispose_template (GTK_WIDGET (self), PHOSH_TYPE_LOCKSCREEN);
g_clear_object (&priv->notification_settings);
g_clear_handle_id (&priv->idle_timer, g_source_remove);
g_clear_object (&priv->calls_manager);
g_clear_pointer (&priv->active, g_free);
g_clear_object (&priv->lockscreen_settings);
-
- g_clear_pointer (&priv->background, phosh_cp_widget_destroy);
+ g_clear_pointer (&background_layer_surface, phosh_layer_surface_destroy);
G_OBJECT_CLASS (phosh_lockscreen_parent_class)->dispose (object);
}
@@ -1031,7 +1032,7 @@ on_unlock_submit (PhoshLockscreen *self)
if (length == 0)
return;
- input = gtk_entry_get_text (GTK_ENTRY (priv->entry_pin));
+ input = gtk_editable_get_text (GTK_EDITABLE (priv->entry_pin));
phosh_lockscreen_set_unlock_status (self, _("Checking…"));
gtk_widget_set_sensitive (GTK_WIDGET (self), FALSE);
@@ -1105,11 +1106,8 @@ phosh_lockscreen_class_init (PhoshLockscreenClass *klass)
* session should be unlocked.
*/
signals[LOCKSCREEN_UNLOCK] = g_signal_new ("lockscreen-unlock",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE,
- 0);
+ G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+ NULL, G_TYPE_NONE, 0);
/**
* PhoshLockscreen::wakeup-output
* @self: The #PhoshLockscreen emitting this signal
@@ -1118,11 +1116,8 @@ phosh_lockscreen_class_init (PhoshLockscreenClass *klass)
* up.
*/
signals[WAKEUP_OUTPUT] = g_signal_new ("wakeup-output",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE,
- 0);
+ G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+ NULL, G_TYPE_NONE, 0);
g_type_ensure (PHOSH_TYPE_KEYPAD);
g_type_ensure (PHOSH_TYPE_WIDGET_BOX);
@@ -1130,27 +1125,28 @@ phosh_lockscreen_class_init (PhoshLockscreenClass *klass)
gtk_widget_class_set_template_from_resource (widget_class,
"/mobi/phosh/ui/lockscreen.ui");
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, carousel);
+#if 0
+ gtk_widget_class_bind_template_child_full (widget_class,
+ "zoom_gesture",
+ FALSE,
+ G_PRIVATE_OFFSET (PhoshLockscreen,
+ brightness.gesture));
+#endif
gtk_widget_class_bind_template_callback_full (widget_class,
"carousel_position_notified_cb",
G_CALLBACK (carousel_position_notified_cb));
gtk_widget_class_bind_template_callback_full (widget_class,
"carousel_page_changed_cb",
G_CALLBACK (carousel_page_changed_cb));
- gtk_widget_class_bind_template_child_full (widget_class,
- "swipe_gesture",
- FALSE,
- G_PRIVATE_OFFSET (PhoshLockscreen,
- brightness.swipe_gesture));
-
- gtk_widget_class_bind_template_callback (widget_class, on_swipe_gesture_begin);
- gtk_widget_class_bind_template_callback (widget_class, on_swipe_gesture_update);
+ //gtk_widget_class_bind_template_callback (widget_class, key_press_event_cb);
+ //gtk_widget_class_bind_template_callback (widget_class, on_zoom_gesture_begin);
+ //gtk_widget_class_bind_template_callback (widget_class, on_zoom_gesture_update);
/* main deck */
gtk_widget_class_bind_template_callback (widget_class, deck_forward_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, deck_forward_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, deck_back_clicked_cb);
- gtk_widget_class_bind_template_callback (widget_class, on_deck_visible_child_changed);
- gtk_widget_class_bind_template_callback (widget_class, on_deck_transition_running_changed);
+ gtk_widget_class_bind_template_callback (widget_class, on_deck_get_next_page);
/* unlock page */
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, box_unlock);
@@ -1158,16 +1154,15 @@ phosh_lockscreen_class_init (PhoshLockscreenClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, keypad_revealer);
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, entry_pin);
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, lbl_unlock_status);
- gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen,
- long_press_del_gesture);
+ gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, long_press_del_gesture);
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, btn_submit);
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, btn_keyboard);
- gtk_widget_class_bind_template_callback (widget_class, delete_button_clicked_cb);
- gtk_widget_class_bind_template_callback (widget_class, input_changed_cb);
gtk_widget_class_bind_template_callback (widget_class, long_press_del_cb);
+ gtk_widget_class_bind_template_callback (widget_class, delete_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, osk_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, submit_cb);
+ gtk_widget_class_bind_template_callback (widget_class, input_changed_cb);
/* info page */
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, box_info);
@@ -1176,8 +1171,7 @@ phosh_lockscreen_class_init (PhoshLockscreenClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, lbl_date);
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, list_calls);
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, list_notifications);
- gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen,
- rev_call_notifications);
+ gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, rev_call_notifications);
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, rev_media_player);
gtk_widget_class_bind_template_child_private (widget_class, PhoshLockscreen, rev_notifications);
gtk_widget_class_bind_template_callback (widget_class, on_call_notification_activated);
@@ -1208,23 +1202,17 @@ phosh_lockscreen_init (PhoshLockscreen *self)
GtkWidget *
-phosh_lockscreen_new (GType lockscreen_type,
- gpointer layer_shell,
- gpointer wl_output,
+phosh_lockscreen_new (GType lockscreen_type,
+ gpointer layer_shell,
+ gpointer wl_output,
PhoshCallsManager *calls_manager)
{
g_assert (g_type_is_a (lockscreen_type, phosh_lockscreen_get_type ()));
return g_object_new (lockscreen_type,
- "layer-shell", layer_shell,
"wl-output", wl_output,
- "anchor", (ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
- ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
- ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
- ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT),
"layer", ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY,
"kbd-interactivity", TRUE,
"exclusive-zone", -1,
- "namespace", "phosh lockscreen",
"calls-manager", calls_manager,
NULL);
}
@@ -1248,7 +1236,7 @@ phosh_lockscreen_get_page (PhoshLockscreen *self)
* is animating (or being manually swiped) from one page to another. By rounding like this, the
* key_press_event_cb starts accepting input as soon as at least half the unlock page has swiped
* in. */
- position = round (hdy_carousel_get_position (HDY_CAROUSEL (priv->carousel)));
+ position = round (adw_carousel_get_position (ADW_CAROUSEL (priv->carousel)));
if (position == 0)
return PHOSH_LOCKSCREEN_PAGE_INFO;
@@ -1294,7 +1282,7 @@ phosh_lockscreen_set_page (PhoshLockscreen *self, PhoshLockscreenPage page)
break;
}
- hdy_carousel_scroll_to (HDY_CAROUSEL (priv->carousel), scroll_to);
+ adw_carousel_scroll_to (ADW_CAROUSEL (priv->carousel), scroll_to, TRUE);
}
/**
@@ -1330,7 +1318,7 @@ phosh_lockscreen_get_pin_entry (PhoshLockscreen *self)
g_return_val_if_fail (PHOSH_IS_LOCKSCREEN (self), "");
priv = phosh_lockscreen_get_instance_private (self);
- return gtk_entry_get_text (GTK_ENTRY (priv->entry_pin));
+ return gtk_editable_get_text (GTK_EDITABLE (priv->entry_pin));
}
/**
@@ -1391,7 +1379,7 @@ phosh_lockscreen_add_extra_page (PhoshLockscreen *self, GtkWidget *widget)
priv = phosh_lockscreen_get_instance_private (self);
priv->extra_page = widget;
- hdy_carousel_insert (HDY_CAROUSEL (priv->carousel), priv->extra_page, 1);
+ adw_carousel_insert (ADW_CAROUSEL (priv->carousel), priv->extra_page, 1);
}
/**
@@ -1413,7 +1401,7 @@ phosh_lockscreen_set_unlock_status (PhoshLockscreen *self, const char *status)
/**
* phosh_lockscreen_set_bg_image:
- * @self: The lockscrenn
+ * @self: The lockscreen
* @image: The background image to set
*/
void
diff --git a/phosh/src/lockscreen.h b/phosh/src/lockscreen.h
index baac5b313..e8370b1b5 100644
--- a/phosh/src/lockscreen.h
+++ b/phosh/src/lockscreen.h
@@ -37,7 +37,8 @@ G_DECLARE_DERIVABLE_TYPE (PhoshLockscreen, phosh_lockscreen, PHOSH, LOCKSCREEN,
* keypad. It allows to implement a custom authentication mechanism. To indicate success the
* `lockscreen-unlock` signal should be emitted.
*/
-struct _PhoshLockscreenClass {
+struct _PhoshLockscreenClass
+{
PhoshLayerSurfaceClass parent_class;
void (*unlock_submit) (PhoshLockscreen *self);
@@ -54,10 +55,10 @@ struct _PhoshLockscreenClass {
};
-void phosh_lockscreen_set_page (PhoshLockscreen *self,
+void phosh_lockscreen_set_page (PhoshLockscreen *self,
PhoshLockscreenPage page);
PhoshLockscreenPage phosh_lockscreen_get_page (PhoshLockscreen *self);
-void phosh_lockscreen_set_default_page (PhoshLockscreen *self,
+void phosh_lockscreen_set_default_page (PhoshLockscreen *self,
PhoshLockscreenPage page);
const char * phosh_lockscreen_get_pin_entry (PhoshLockscreen *self);
diff --git a/phosh/src/lockshield.c b/phosh/src/lockshield.c
index edc7a2a57..a4a48eac6 100644
--- a/phosh/src/lockshield.c
+++ b/phosh/src/lockshield.c
@@ -35,9 +35,7 @@ phosh_lockshield_constructed (GObject *object)
G_OBJECT_CLASS (phosh_lockshield_parent_class)->constructed (object);
- gtk_style_context_add_class (
- gtk_widget_get_style_context (GTK_WIDGET (self)),
- "phosh-lockshield");
+ gtk_widget_add_css_class (GTK_WIDGET (self), "phosh-lockshield");
}
@@ -57,11 +55,9 @@ phosh_lockshield_init (PhoshLockshield *self)
GtkWidget *
-phosh_lockshield_new (struct zwlr_layer_shell_v1 *layer_shell,
- PhoshMonitor *monitor)
+phosh_lockshield_new (PhoshMonitor *monitor)
{
return g_object_new (PHOSH_TYPE_LOCKSHIELD,
- "layer-shell", layer_shell,
"wl-output", monitor->wl_output,
"anchor", ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
diff --git a/phosh/src/lockshield.h b/phosh/src/lockshield.h
index be3845e23..b548368e0 100644
--- a/phosh/src/lockshield.h
+++ b/phosh/src/lockshield.h
@@ -13,5 +13,4 @@
G_DECLARE_FINAL_TYPE (PhoshLockshield, phosh_lockshield, PHOSH, LOCKSHIELD, PhoshLayerSurface)
-GtkWidget *phosh_lockshield_new (struct zwlr_layer_shell_v1 *layer_shell,
- PhoshMonitor *monitor);
+GtkWidget *phosh_lockshield_new (PhoshMonitor *monitor);
diff --git a/phosh/src/main.c b/phosh/src/main.c
index f3b6fc05a..81508837a 100644
--- a/phosh/src/main.c
+++ b/phosh/src/main.c
@@ -11,7 +11,6 @@
#include "phosh-config.h"
-#include "audio-manager.h"
#include "shell-priv.h"
#include "phosh-wayland.h"
#include "wall-clock.h"
@@ -19,7 +18,7 @@
#include "background-cache.h"
#include "metainfo-cache.h"
-#include
+#include
#include
#include
@@ -31,7 +30,8 @@ static gboolean
quit (gpointer unused)
{
g_debug ("Cleaning up");
- gtk_main_quit ();
+ // FIXME Port to GTK 4
+ // gtk_main_quit ();
return G_SOURCE_REMOVE;
}
@@ -110,7 +110,7 @@ main (int argc, char *argv[])
g_autoptr (PhoshMetainfoCache) metainfo_cache = NULL;
g_autoptr (GTimer) timer = g_timer_new ();
g_autoptr (PhoshWallClock) wall_clock = NULL;
- g_autoptr (PhoshAudioManager) audio_manager = NULL;
+ g_autoptr (GMainLoop) loop = NULL;
const GOptionEntry options [] = {
{"unlocked", 'U', 0, G_OPTION_ARG_NONE, &unlocked,
@@ -124,7 +124,8 @@ main (int argc, char *argv[])
opt_context = g_option_context_new ("- A phone graphical shell");
g_option_context_add_main_entries (opt_context, options, NULL);
- g_option_context_add_group (opt_context, gtk_get_option_group (FALSE));
+ // FIXME Port to GTK 4
+ // g_option_context_add_group (opt_context, gtk_get_option_group (FALSE));
if (!g_option_context_parse (opt_context, &argc, &argv, &err)) {
g_warning ("%s", err->message);
return 1;
@@ -136,8 +137,8 @@ main (int argc, char *argv[])
textdomain (GETTEXT_PACKAGE);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
- gtk_init (&argc, &argv);
- hdy_init ();
+ gtk_init ();
+ adw_init ();
lfb_init (PHOSH_APP_ID, NULL);
g_unix_signal_add (SIGTERM, on_shutdown_signal, NULL);
@@ -148,7 +149,6 @@ main (int argc, char *argv[])
wl = phosh_wayland_get_default ();
background_cache = phosh_background_cache_get_default ();
metainfo_cache = phosh_metainfo_cache_get_default ();
- audio_manager = phosh_audio_manager_get_default ();
shell = phosh_shell_new ();
phosh_shell_set_default (shell);
@@ -157,7 +157,8 @@ main (int argc, char *argv[])
if (!(unlocked || phosh_shell_started_by_display_manager (shell)) || locked)
phosh_shell_lock (shell);
- gtk_main ();
+ loop = g_main_loop_new (NULL, FALSE);
+ g_main_loop_run (loop);
return EXIT_SUCCESS;
}
diff --git a/phosh/src/media-player.c b/phosh/src/media-player.c
index 1977640fa..4e14263bf 100644
--- a/phosh/src/media-player.c
+++ b/phosh/src/media-player.c
@@ -22,8 +22,6 @@
#include
-#include
-
#define ART_PIXEL_SIZE 48
#define SEEK_SECOND 1000000
#define SEEK_BACK (-10 * SEEK_SECOND)
@@ -160,15 +158,14 @@ update_position (PhoshMediaPlayer *self)
{
PhoshMediaPlayerPrivate *priv = phosh_media_player_get_instance_private (self);
g_autofree char *position_text = NULL;
- double level = 0.0;
+ double level;
if (priv->track_position >= 0)
position_text = cui_call_format_duration ((double) priv->track_position / G_USEC_PER_SEC);
gtk_label_set_label (GTK_LABEL (priv->lbl_position), position_text ?: "-");
- if (priv->track_position > 0 && priv->track_length > 0)
- level = ((double) priv->track_position) / priv->track_length;
+ level = priv->track_position >= 0 ? ((double) priv->track_position) / priv->track_length : 0.0;
gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (priv->prb_position), level);
}
@@ -839,6 +836,8 @@ phosh_media_player_dispose (GObject *object)
g_clear_pointer (&priv->url, g_free);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_MEDIA_PLAYER);
+
G_OBJECT_CLASS (phosh_media_player_parent_class)->dispose (object);
}
diff --git a/phosh/src/meson.build b/phosh/src/meson.build
index d160d6ccf..cf8328368 100644
--- a/phosh/src/meson.build
+++ b/phosh/src/meson.build
@@ -4,7 +4,6 @@ subdir('notifications')
subdir('wwan')
subdir('search')
subdir('settings')
-subdir('gtk-list-models')
phosh_enums_header_subdir = 'phosh'
@@ -66,6 +65,7 @@ phosh_enum_headers = files(
'monitor/monitor.h',
'notifications/notification.h',
'notifications/notify-manager.h',
+ 'layersurface.h',
'phosh-wayland.h',
'rotation-manager.h',
'shell-priv.h',
@@ -124,7 +124,6 @@ phosh_tool_headers = files(
'app-grid-folder-button.h',
'app-grid.h',
'app-list-model.h',
- 'audio-manager.h',
'auth-prompt-option.h',
'auto-brightness-bucket.h',
'auto-brightness.h',
@@ -203,9 +202,6 @@ phosh_tool_sources = files(
'app-grid-folder-button.c',
'app-grid.c',
'app-list-model.c',
- 'audio-manager.c',
- 'audio/audio-device.c',
- 'audio/audio-devices.c',
'auth-prompt-option.c',
'auto-brightness-bucket.c',
'auto-brightness.c',
@@ -312,8 +308,6 @@ libphosh_headers = files(
phosh_headers = files(
'app-tracker.h',
'arrow.h',
- 'audio/audio-device.h',
- 'audio/audio-devices.h',
'auth.h',
'background-manager.h',
'backlight-sysfs.h',
@@ -467,18 +461,18 @@ phosh_deps = [
glib_dep,
gmodule_dep,
gmobile_dep,
+ gnome_bg_dep,
gnome_bluetooth_custom_dep,
gnome_bluetooth_headers_dep,
gnome_desktop_dep,
gobject_dep,
gsettings_desktop_schemas_dep,
gtk_dep,
- gtk_wayland_dep,
+ libadwaita_dep,
libcall_ui_dep,
gudev_dep,
libfeedback_dep,
libgvc_dep,
- libhandy_dep,
libnm_dep,
libpolkit_agent_dep,
libsystemd_dep,
@@ -500,7 +494,6 @@ phosh_lib_inc = [
phosh_wwan_inc,
proto_inc,
dbus_inc,
- phosh_gtk_list_models_inc,
]
# A static library used by tests and tools
@@ -511,7 +504,6 @@ phosh_tool_lib = static_library(
phosh_tool_headers,
phosh_generated_headers,
phosh_generated_sources,
- phosh_gtk_list_models_sources,
],
include_directories: phosh_lib_inc,
dependencies: phosh_deps,
@@ -627,9 +619,9 @@ if enable_introspection or bindings_lib
includes: [
'Gcr-3',
'Gio-2.0',
- 'Gtk-3.0',
- 'GnomeDesktop-3.0',
- 'Handy-1',
+ 'Gtk-4.0',
+ 'GnomeDesktop-4.0',
+ 'Adw-1',
'NM-1.0',
'GnomeBluetooth-3.0',
],
diff --git a/phosh/src/monitor-manager.c b/phosh/src/monitor-manager.c
index e7b416fac..9d37cf146 100644
--- a/phosh/src/monitor-manager.c
+++ b/phosh/src/monitor-manager.c
@@ -23,8 +23,6 @@
#include "dbus/gsd-color-dbus.h"
-#include
-
#define GSD_COLOR_BUS_NAME "org.gnome.SettingsDaemon.Color"
#define GSD_COLOR_OBJECT_PATH "/org/gnome/SettingsDaemon/Color"
@@ -49,7 +47,6 @@ enum {
PROP_0,
PROP_SENSOR_PROXY_MANAGER,
PROP_N_MONITORS,
- PROP_NIGHT_LIGHT_TEMP,
PROP_LAST_PROP
};
static GParamSpec *props[PROP_LAST_PROP];
@@ -1228,9 +1225,6 @@ phosh_monitor_manager_get_property (GObject *object,
case PROP_N_MONITORS:
g_value_set_int (value, self->monitors->len);
break;
- case PROP_NIGHT_LIGHT_TEMP:
- g_value_set_uint (value, self->night_light_temp);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -1260,8 +1254,6 @@ on_gsd_color_temperature_changed (PhoshMonitorManager*self)
if (!success)
g_warning ("Failed to set gamma for %s", monitor->name);
}
-
- g_object_notify_by_pspec (G_OBJECT (self), props[PROP_NIGHT_LIGHT_TEMP]);
}
@@ -1382,15 +1374,6 @@ phosh_monitor_manager_class_init (PhoshMonitorManagerClass *klass)
g_param_spec_int ("n-monitors", "", "",
0, G_MAXINT, 0,
G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
- /**
- * PhoshMonitorManager:night-light-temp:
- *
- * Night light color temperature
- */
- props[PROP_NIGHT_LIGHT_TEMP] =
- g_param_spec_uint ("night-light-temp", "", "",
- 0, G_MAXUINT, 0,
- G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, PROP_LAST_PROP, props);
@@ -1691,19 +1674,3 @@ phosh_monitor_manager_get_night_light_supported (PhoshMonitorManager *self)
return phosh_dbus_display_config_get_night_light_supported (PHOSH_DBUS_DISPLAY_CONFIG (self));
}
-
-/**
- * phosh_monitor_manager_get_night_light_temp:
- * @self: The monitor manager
- *
- * Get the night light color temperature
- *
- * Returns: The night light color temperature in K
- */
-guint32
-phosh_monitor_manager_get_night_light_temp (PhoshMonitorManager *self)
-{
- g_return_val_if_fail (PHOSH_IS_MONITOR_MANAGER (self), 0);
-
- return self->night_light_temp;
-}
diff --git a/phosh/src/monitor-manager.h b/phosh/src/monitor-manager.h
index f55a09bf8..0864bdfbe 100644
--- a/phosh/src/monitor-manager.h
+++ b/phosh/src/monitor-manager.h
@@ -54,6 +54,5 @@ gboolean phosh_monitor_manager_enable_fallback (PhoshMoni
void phosh_monitor_manager_set_power_save_mode (PhoshMonitorManager *self,
PhoshMonitorPowerSaveMode mode);
gboolean phosh_monitor_manager_get_night_light_supported (PhoshMonitorManager *self);
-guint32 phosh_monitor_manager_get_night_light_temp (PhoshMonitorManager *self);
G_END_DECLS
diff --git a/phosh/src/monitor/head.c b/phosh/src/monitor/head.c
index 38e41f7ca..df8ba39a4 100644
--- a/phosh/src/monitor/head.c
+++ b/phosh/src/monitor/head.c
@@ -10,8 +10,6 @@
#include "head-priv.h"
-#include
-
/**
* PhoshHead:
*
diff --git a/phosh/src/monitor/monitor.c b/phosh/src/monitor/monitor.c
index 413e70025..6a5444ac8 100644
--- a/phosh/src/monitor/monitor.c
+++ b/phosh/src/monitor/monitor.c
@@ -18,8 +18,6 @@
#include
#include
-#include
-
/**
* PhoshMonitor:
*
diff --git a/phosh/src/network-auth-prompt.c b/phosh/src/network-auth-prompt.c
index de5b4a8c4..baf195be4 100644
--- a/phosh/src/network-auth-prompt.c
+++ b/phosh/src/network-auth-prompt.c
@@ -45,7 +45,7 @@ struct _PhoshNetworkAuthPrompt
GtkWidget *wpa_grid;
GtkWidget *wpa_password_entry;
- GcrSecureEntryBuffer *password_buffer;
+ GtkPasswordEntryBuffer *password_buffer;
GtkWidget *vpn_grid;
@@ -165,12 +165,12 @@ network_connection_get_key_type (NMConnection *connection)
static void
network_prompt_set_grid (PhoshNetworkAuthPrompt *self, GtkWidget *grid)
{
- g_autoptr (GList) children = gtk_container_get_children (GTK_CONTAINER (self->main_box));
+ GtkWidget *child = gtk_widget_get_first_child (self->main_box);
- if (children)
- gtk_container_remove (GTK_CONTAINER (self->main_box), GTK_WIDGET (children->data));
+ if (child)
+ gtk_box_remove (GTK_BOX (self->main_box), child);
- gtk_container_add (GTK_CONTAINER (self->main_box), grid);
+ gtk_box_append (GTK_BOX (self->main_box), grid);
}
@@ -250,7 +250,7 @@ on_network_prompt_password_changed (PhoshNetworkAuthPrompt *self, GtkEntry *entr
secret = g_object_get_data (G_OBJECT (entry), "secret");
g_return_if_fail (secret);
g_free (secret->value);
- secret->value = g_strdup (gtk_entry_get_text (entry));
+ secret->value = g_strdup (gtk_editable_get_text (GTK_EDITABLE (entry)));
if (!password || !*password)
return
@@ -262,7 +262,7 @@ on_network_prompt_password_changed (PhoshNetworkAuthPrompt *self, GtkEntry *entr
static GtkWidget *
build_credentials_entry (PhoshNetworkAuthPrompt *self, PhoshNMSecret *secret)
{
- GtkEntryBuffer *buffer = gcr_secure_entry_buffer_new ();
+ GtkEntryBuffer *buffer = gtk_password_entry_buffer_new ();
GtkWidget *entry = g_object_new (PHOSH_TYPE_PASSWORD_ENTRY,
"valign", GTK_ALIGN_CENTER,
"hexpand", TRUE,
@@ -282,16 +282,18 @@ build_credentials_entry (PhoshNetworkAuthPrompt *self, PhoshNMSecret *secret)
static void
network_prompt_setup_vpn_dialog (PhoshNetworkAuthPrompt *self)
{
- g_autoptr (GList) children = NULL;
+ GtkWidget *child;
gboolean focus = FALSE;
g_return_if_fail (PHOSH_IS_NETWORK_AUTH_PROMPT (self));
network_prompt_set_grid (self, self->vpn_grid);
- children = gtk_container_get_children (GTK_CONTAINER (self->vpn_grid));
- for (GList *elem = children; elem; elem = elem->next)
- gtk_container_remove (GTK_CONTAINER (self->vpn_grid), GTK_WIDGET (elem->data));
+ child = gtk_widget_get_first_child (self->vpn_grid);
+ while (child != NULL) {
+ gtk_grid_remove (GTK_GRID (self->vpn_grid), child);
+ child = gtk_widget_get_first_child (self->vpn_grid);
+ }
for (int i = 0; i < self->secrets->len; i++) {
g_autofree char *l = NULL;
@@ -377,6 +379,15 @@ network_prompt_connect_clicked_cb (PhoshNetworkAuthPrompt *self)
}
+static void
+phosh_network_auth_prompt_dispose (GObject *object)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_NETWORK_AUTH_PROMPT);
+
+ G_OBJECT_CLASS (phosh_network_auth_prompt_parent_class)->dispose (object);
+}
+
+
static void
phosh_network_auth_prompt_finalize (GObject *object)
{
@@ -423,6 +434,7 @@ phosh_network_auth_prompt_class_init (PhoshNetworkAuthPromptClass *klass)
GObjectClass *object_class = (GObjectClass *)klass;
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = phosh_network_auth_prompt_dispose;
object_class->finalize = phosh_network_auth_prompt_finalize;
/**
diff --git a/phosh/src/notifications/dbus-notification.c b/phosh/src/notifications/dbus-notification.c
index a23d1ed22..083e682d3 100644
--- a/phosh/src/notifications/dbus-notification.c
+++ b/phosh/src/notifications/dbus-notification.c
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2020 Purism SPC
- * 2025 Phosh.mobi e.V.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
@@ -10,11 +9,9 @@
#define G_LOG_DOMAIN "phosh-dbus-notification"
#include "phosh-config.h"
-
#include "dbus-notification.h"
#include "notify-manager.h"
#include "shell-priv.h"
-#include "util.h"
#include
#include
@@ -32,72 +29,26 @@
typedef struct _PhoshDBusNotification {
PhoshNotification parent;
- GCancellable *cancel;
} PhoshDBusNotification;
G_DEFINE_TYPE (PhoshDBusNotification, phosh_dbus_notification, PHOSH_TYPE_NOTIFICATION)
-static void
-on_app_activated (GObject *source_object, GAsyncResult *res, gpointer user_data)
-{
- g_autoptr (PhoshDBusNotification) self = user_data;
- g_autoptr (GError) err = NULL;
- GAppInfo *info;
- gboolean success;
-
- info = phosh_notification_get_app_info (PHOSH_NOTIFICATION (self));
- success = phosh_util_activate_action_finish (res, &err);
- if (!success) {
- g_warning ("Failed to activate %s: %s", g_app_info_get_id (info), err->message);
- return;
- }
-
- g_debug ("Activated '%s'", g_app_info_get_id (info));
-}
-
-
static void
phosh_dbus_notification_do_action (PhoshNotification *notification, guint id, const char *action)
{
- PhoshDBusNotification *self = PHOSH_DBUS_NOTIFICATION (notification);
PhoshNotifyManager *nm = phosh_notify_manager_get_default ();
- GAppInfo *info;
-
- info = phosh_notification_get_app_info (notification);
- if (info) {
- phosh_util_activate_action (info,
- NULL,
- NULL,
- self->cancel,
- on_app_activated,
- g_object_ref (self));
- }
- phosh_dbus_notifications_emit_action_invoked (PHOSH_DBUS_NOTIFICATIONS (nm), id, action);
-}
-
-static void
-phosh_dbus_notification_finalize (GObject *object)
-{
- PhoshDBusNotification *self = PHOSH_DBUS_NOTIFICATION (object);
-
- g_cancellable_cancel (self->cancel);
- g_clear_object (&self->cancel);
-
- G_OBJECT_CLASS (phosh_dbus_notification_parent_class)->finalize (object);
+ phosh_dbus_notifications_emit_action_invoked (PHOSH_DBUS_NOTIFICATIONS (nm), id, action);
}
static void
phosh_dbus_notification_class_init (PhoshDBusNotificationClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
PhoshNotificationClass *notification_class = PHOSH_NOTIFICATION_CLASS (klass);
- object_class->finalize = phosh_dbus_notification_finalize;
-
notification_class->do_action = phosh_dbus_notification_do_action;
}
@@ -105,7 +56,6 @@ phosh_dbus_notification_class_init (PhoshDBusNotificationClass *klass)
static void
phosh_dbus_notification_init (PhoshDBusNotification *self)
{
- self->cancel = g_cancellable_new ();
}
diff --git a/phosh/src/notifications/notification-banner.c b/phosh/src/notifications/notification-banner.c
index ce7a9a524..567beea3d 100644
--- a/phosh/src/notifications/notification-banner.c
+++ b/phosh/src/notifications/notification-banner.c
@@ -16,8 +16,6 @@
#include "shell-priv.h"
#include "util.h"
-#include
-
#define BANNER_MIN_WIDTH 360
/**
@@ -64,7 +62,7 @@ phosh_notification_banner_slide (double value, gpointer user_data)
PhoshNotificationBanner *self = PHOSH_NOTIFICATION_BANNER (user_data);
int margin, height;
- gtk_window_get_size (GTK_WINDOW (self), NULL, &height);
+ height = gtk_widget_get_height (GTK_WIDGET (self));
margin = -(height * 0.9) * (self->slide_up ? value : (1.0 - value));
phosh_layer_surface_set_margins (PHOSH_LAYER_SURFACE (self), margin, 0, 0, 0);
@@ -80,7 +78,7 @@ phosh_notification_banner_slide_done (gpointer user_data)
g_clear_pointer (&self->animation, phosh_animation_unref);
if (self->slide_up)
- gtk_widget_destroy (GTK_WIDGET (self));
+ gtk_window_destroy (GTK_WINDOW (self));
}
@@ -105,7 +103,7 @@ expired (PhoshNotification *notification,
self);
phosh_animation_start (self->animation);
} else {
- gtk_widget_destroy (GTK_WIDGET (self));
+ gtk_window_destroy (GTK_WINDOW (self));
}
}
@@ -121,7 +119,7 @@ closed (PhoshNotification *notification,
clear_handler (self);
/* Close the banner */
- gtk_widget_destroy (GTK_WIDGET (self));
+ gtk_window_destroy (GTK_WINDOW (self));
}
@@ -136,7 +134,7 @@ phosh_notification_banner_set_notification (PhoshNotificationBanner *self,
content = phosh_notification_frame_new (TRUE, NULL);
phosh_notification_frame_bind_notification (PHOSH_NOTIFICATION_FRAME (content),
self->notification);
- gtk_container_add (GTK_CONTAINER (self), content);
+ gtk_window_set_child (GTK_WINDOW (self), content);
self->handler_expired = g_signal_connect (self->notification, "expired",
G_CALLBACK (expired), self);
@@ -206,7 +204,7 @@ phosh_notification_banner_map (GtkWidget *widget)
GTK_WIDGET_CLASS (phosh_notification_banner_parent_class)->map (widget);
- height = gtk_widget_get_allocated_height (widget);
+ height = gtk_widget_get_height (widget);
phosh_layer_surface_set_size (PHOSH_LAYER_SURFACE (widget), -1, height);
phosh_animation_start (self->animation);
@@ -269,7 +267,6 @@ phosh_notification_banner_new (PhoshNotification *notification)
"width-request", BANNER_MIN_WIDTH,
"valign", GTK_ALIGN_CENTER,
/* layer surface */
- "layer-shell", phosh_wayland_get_zwlr_layer_shell_v1 (wl),
"wl-output", monitor ? monitor->wl_output : NULL,
"anchor", ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP,
"width", MIN (width, 450),
diff --git a/phosh/src/notifications/notification-content.c b/phosh/src/notifications/notification-content.c
index 6103cd88d..3acdd70c9 100644
--- a/phosh/src/notifications/notification-content.c
+++ b/phosh/src/notifications/notification-content.c
@@ -150,12 +150,15 @@ set_actions (PhoshNotificationContent *self, PhoshNotification *notification)
{
GStrv actions;
g_auto (GStrv) filters = NULL;
+ GtkWidget *child;
- gtk_container_foreach (GTK_CONTAINER (self->box_actions),
- (GtkCallback) gtk_widget_destroy,
- NULL);
+ child = gtk_widget_get_first_child (self->box_actions);
+ while (child != NULL) {
+ gtk_box_remove (GTK_BOX (self->box_actions), child);
+ child = gtk_widget_get_first_child (self->box_actions);
+ }
- if (notification == NULL)
+ if (notification == NULL)
return;
actions = phosh_notification_get_actions (notification);
@@ -171,8 +174,7 @@ set_actions (PhoshNotificationContent *self, PhoshNotification *notification)
/* The default action is already triggered by the notification body */
if (g_strcmp0 (actions[i], "default") == 0) {
- GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (self->msg_body));
- gtk_style_context_add_class (context, "phosh-notification-body");
+ gtk_widget_add_css_class (self->msg_body, "phosh-notification-body");
continue;
}
@@ -204,9 +206,9 @@ set_actions (PhoshNotificationContent *self, PhoshNotification *notification)
"vexpand", TRUE,
"visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (btn), lbl);
+ gtk_button_set_child ( GTK_BUTTON (btn), lbl);
- gtk_container_add (GTK_CONTAINER (self->box_actions), btn);
+ gtk_box_append (GTK_BOX (self->box_actions), btn);
}
}
@@ -314,6 +316,15 @@ phosh_notification_content_get_property (GObject *object,
}
+static void
+phosh_notification_content_dispose (GObject *object)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_NOTIFICATION_CONTENT);
+
+ G_OBJECT_CLASS (phosh_notification_content_parent_class)->dispose (object);
+}
+
+
static void
phosh_notification_content_finalize (GObject *object)
{
@@ -332,6 +343,7 @@ phosh_notification_content_class_init (PhoshNotificationContentClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = phosh_notification_content_dispose;
object_class->finalize = phosh_notification_content_finalize;
object_class->set_property = phosh_notification_content_set_property;
object_class->get_property = phosh_notification_content_get_property;
diff --git a/phosh/src/notifications/notification-frame.c b/phosh/src/notifications/notification-frame.c
index b29435a07..ba1fdb549 100644
--- a/phosh/src/notifications/notification-frame.c
+++ b/phosh/src/notifications/notification-frame.c
@@ -38,7 +38,7 @@ static GParamSpec *props[LAST_PROP];
struct _PhoshNotificationFrame {
- GtkEventBox parent;
+ GtkBox parent;
GListModel *model;
gulong model_watch;
@@ -70,7 +70,7 @@ struct _PhoshNotificationFrame {
typedef struct _PhoshNotificationFrame PhoshNotificationFrame;
-G_DEFINE_TYPE (PhoshNotificationFrame, phosh_notification_frame, GTK_TYPE_EVENT_BOX)
+G_DEFINE_TYPE (PhoshNotificationFrame, phosh_notification_frame, GTK_TYPE_BOX)
#define DRAG_THRESHOLD_DISTANCE 16
@@ -133,6 +133,15 @@ phosh_notification_frame_get_property (GObject *object,
}
+static void
+phosh_notification_frame_dispose (GObject *object)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_NOTIFICATION_FRAME);
+
+ G_OBJECT_CLASS (phosh_notification_frame_parent_class)->dispose (object);
+}
+
+
static void
phosh_notification_frame_finalize (GObject *object)
{
@@ -148,30 +157,31 @@ phosh_notification_frame_finalize (GObject *object)
G_OBJECT_CLASS (phosh_notification_frame_parent_class)->finalize (object);
}
-
-static gboolean
+static void
motion_notify (PhoshNotificationFrame *self,
- GdkEventMotion *event)
+ double x,
+ double y)
{
if (self->start_x >= 0 && self->start_y >= 0) {
- int current_x, current_y;
+ graphene_point_t src = {x, y};
+ graphene_point_t current;
double dx, dy;
+ gboolean success;
- gtk_widget_translate_coordinates (GTK_WIDGET (self->box),
- gtk_widget_get_toplevel (GTK_WIDGET (self)),
- event->x, event->y,
- ¤t_x, ¤t_y);
+ success = gtk_widget_compute_point (GTK_WIDGET (self->box),
+ GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (self))),
+ &src,
+ ¤t);
+ g_return_if_fail (success);
- dx = current_x - self->start_x;
- dy = current_y - self->start_y;
+ dx = current.x - self->start_x;
+ dy = current.y - self->start_y;
if (sqrt (dx * dx + dy * dy) > DRAG_THRESHOLD_DISTANCE) {
gtk_gesture_set_state (self->header_click_gesture, GTK_EVENT_SEQUENCE_DENIED);
gtk_gesture_set_state (self->list_click_gesture, GTK_EVENT_SEQUENCE_DENIED);
}
}
-
- return GDK_EVENT_PROPAGATE;
}
@@ -183,26 +193,29 @@ pressed (PhoshNotificationFrame *self,
GtkGesture *gesture,
GtkGesture *other_gesture)
{
- GdkEventSequence *sequence =
- gtk_gesture_single_get_current_sequence (GTK_GESTURE_SINGLE (gesture));
+ graphene_point_t src, dst;
+ gboolean success;
if (n_press != 1) {
- gtk_gesture_set_sequence_state (gesture, sequence, GTK_EVENT_SEQUENCE_DENIED);
+ gtk_gesture_set_state (gesture,GTK_EVENT_SEQUENCE_DENIED);
return;
}
- gtk_widget_translate_coordinates (self->box,
- gtk_widget_get_toplevel (GTK_WIDGET (self)),
- x, y,
- &self->start_x, &self->start_y);
+ src.x = x;
+ src.y = y;
+ success = gtk_widget_compute_point (self->box,
+ GTK_WIDGET (gtk_widget_get_root (GTK_WIDGET (self))),
+ &src,
+ &dst);
+ g_return_if_fail (success);
/* When the title row is clicked we proxy it to the first item */
self->active_row =
gtk_list_box_get_row_at_y (GTK_LIST_BOX (self->list_notifs),
gesture == self->header_click_gesture ? 0 : y);
- gtk_gesture_set_sequence_state (other_gesture, sequence, GTK_EVENT_SEQUENCE_DENIED);
+ gtk_gesture_set_state (other_gesture, GTK_EVENT_SEQUENCE_DENIED);
}
static void
@@ -367,6 +380,7 @@ phosh_notification_frame_class_init (PhoshNotificationFrameClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = phosh_notification_frame_dispose;
object_class->finalize = phosh_notification_frame_finalize;
object_class->set_property = phosh_notification_frame_set_property;
object_class->get_property = phosh_notification_frame_get_property;
diff --git a/phosh/src/notifications/notification-frame.h b/phosh/src/notifications/notification-frame.h
index bda5f3e2b..3d8ccc3aa 100644
--- a/phosh/src/notifications/notification-frame.h
+++ b/phosh/src/notifications/notification-frame.h
@@ -18,7 +18,7 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_NOTIFICATION_FRAME (phosh_notification_frame_get_type ())
-G_DECLARE_FINAL_TYPE (PhoshNotificationFrame, phosh_notification_frame, PHOSH, NOTIFICATION_FRAME, GtkEventBox)
+G_DECLARE_FINAL_TYPE (PhoshNotificationFrame, phosh_notification_frame, PHOSH, NOTIFICATION_FRAME, GtkBox)
GtkWidget *phosh_notification_frame_new (gboolean show_body,
diff --git a/phosh/src/notifications/timestamp-label.c b/phosh/src/notifications/timestamp-label.c
index f340b78ed..f2f52378f 100644
--- a/phosh/src/notifications/timestamp-label.c
+++ b/phosh/src/notifications/timestamp-label.c
@@ -22,7 +22,7 @@
struct _PhoshTimestampLabel {
- GtkBin parent;
+ GtkWidget parent;
GtkLabel *label;
GDateTime *date;
@@ -38,7 +38,7 @@ enum {
static GParamSpec *props[LAST_PROP];
-G_DEFINE_TYPE (PhoshTimestampLabel, phosh_timestamp_label, GTK_TYPE_BIN)
+G_DEFINE_TYPE (PhoshTimestampLabel, phosh_timestamp_label, GTK_TYPE_WIDGET)
#define SECONDS_PER_MINUTE 60.0
@@ -315,6 +315,8 @@ phosh_timestamp_label_dispose (GObject *object)
g_clear_pointer (&self->date, g_date_time_unref);
g_clear_handle_id (&(self->refresh_time), g_source_remove);
+ gtk_widget_dispose_template (GTK_WIDGET (self), PHOSH_TYPE_TIMESTAMP_LABEL);
+
G_OBJECT_CLASS (phosh_timestamp_label_parent_class)->dispose (object);
}
@@ -342,6 +344,8 @@ phosh_timestamp_label_class_init (PhoshTimestampLabelClass *klass)
gtk_widget_class_set_template_from_resource (widget_class, "/mobi/phosh/ui/timestamp-label.ui");
gtk_widget_class_bind_template_child (widget_class, PhoshTimestampLabel, label);
+
+ gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
}
diff --git a/phosh/src/notifications/timestamp-label.h b/phosh/src/notifications/timestamp-label.h
index 7010e1b19..562976111 100644
--- a/phosh/src/notifications/timestamp-label.h
+++ b/phosh/src/notifications/timestamp-label.h
@@ -13,7 +13,7 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_TIMESTAMP_LABEL (phosh_timestamp_label_get_type ())
-G_DECLARE_FINAL_TYPE (PhoshTimestampLabel, phosh_timestamp_label, PHOSH, TIMESTAMP_LABEL, GtkBin)
+G_DECLARE_FINAL_TYPE (PhoshTimestampLabel, phosh_timestamp_label, PHOSH, TIMESTAMP_LABEL, GtkWidget)
PhoshTimestampLabel *phosh_timestamp_label_new (void);
void phosh_timestamp_label_set_timestamp (PhoshTimestampLabel *self,
diff --git a/phosh/src/osd-window.c b/phosh/src/osd-window.c
index d0e58c447..e5a869a16 100644
--- a/phosh/src/osd-window.c
+++ b/phosh/src/osd-window.c
@@ -119,7 +119,7 @@ phosh_osd_window_set_property (GObject *obj,
case PROP_ICON_NAME:
g_free (self->icon_name);
self->icon_name = g_value_dup_string (value);
- gtk_image_set_from_icon_name (GTK_IMAGE (self->icon), self->icon_name, GTK_ICON_SIZE_INVALID);
+ gtk_image_set_from_icon_name (GTK_IMAGE (self->icon), self->icon_name);
break;
case PROP_LEVEL:
set_level (self, g_value_get_double (value));
@@ -169,7 +169,7 @@ phosh_osd_window_get_property (GObject *obj,
static void
on_button_released (PhoshOsdWindow *self)
{
- gtk_widget_destroy (GTK_WIDGET (self));
+ gtk_window_destroy (GTK_WINDOW (self));
}
@@ -181,11 +181,19 @@ phosh_osd_window_map (GtkWidget *widget)
GTK_WIDGET_CLASS (phosh_osd_window_parent_class)->map (widget);
- width = gtk_widget_get_allocated_width (widget);
+ width = gtk_widget_get_width (widget);
phosh_layer_surface_set_size (PHOSH_LAYER_SURFACE (self), width, -1);
}
+static void
+phosh_osd_window_dispose (GObject *obj)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (obj), PHOSH_TYPE_OSD_WINDOW);
+
+ G_OBJECT_CLASS (phosh_osd_window_parent_class)->dispose (obj);
+}
+
static void
phosh_osd_window_finalize (GObject *obj)
{
@@ -207,6 +215,7 @@ phosh_osd_window_class_init (PhoshOsdWindowClass *klass)
object_class->get_property = phosh_osd_window_get_property;
object_class->set_property = phosh_osd_window_set_property;
+ object_class->dispose = phosh_osd_window_dispose;
object_class->finalize = phosh_osd_window_finalize;
widget_class->map = phosh_osd_window_map;
@@ -270,8 +279,6 @@ static void
phosh_osd_window_init (PhoshOsdWindow *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
-
- gtk_widget_add_events (GTK_WIDGET (self), GDK_BUTTON_RELEASE_MASK);
}
diff --git a/phosh/src/overview.c b/phosh/src/overview.c
index 61aea0bc6..be30361fe 100644
--- a/phosh/src/overview.c
+++ b/phosh/src/overview.c
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2018 Purism SPC
- * 2025 Phosh.mobi e.V.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
@@ -18,12 +17,10 @@
#include "shell-priv.h"
#include "toplevel-manager.h"
#include "toplevel-thumbnail.h"
-#include "util.h"
+#include
#include
-#include
-
#define OVERVIEW_ICON_SIZE 64
/**
@@ -55,12 +52,9 @@ static GParamSpec *props[LAST_PROP];
typedef struct {
/* Running activities */
- HdyCarousel *carousel_running_activities;
- GtkWidget *app_grid;
- PhoshActivity *activity;
-
- PhoshAppTracker *app_tracker; /* unowned */
- PhoshSplashManager *splash_manager; /* unowned */
+ GtkWidget *carousel_running_activities;
+ GtkWidget *app_grid;
+ PhoshActivity *activity;
int has_activities;
} PhoshOverviewPrivate;
@@ -73,157 +67,6 @@ struct _PhoshOverview {
G_DEFINE_TYPE_WITH_PRIVATE (PhoshOverview, phosh_overview, GTK_TYPE_BOX)
-static PhoshToplevel *get_toplevel_from_activity (PhoshActivity *activity);
-static void on_activity_clicked (PhoshOverview *self, PhoshActivity *activity);
-static int get_last_app_id_pos (PhoshOverview *self, const char *app_id);
-
-
-static PhoshActivity *
-find_activity_by_app_info (PhoshOverview *self, GAppInfo *needle)
-{
- g_autoptr (GList) children = NULL;
- PhoshOverviewPrivate *priv = phosh_overview_get_instance_private (self);
-
- children = gtk_container_get_children (GTK_CONTAINER (priv->carousel_running_activities));
- for (GList *l = children; l; l = l->next) {
- PhoshActivity *activity = PHOSH_ACTIVITY (l->data);
- GAppInfo *app_info = phosh_activity_get_app_info (activity);
-
- if (app_info && g_app_info_equal (needle, app_info))
- return activity;
- }
-
- return NULL;
-}
-
-
-static PhoshActivity *
-find_activity_by_app_id (PhoshOverview *self, const char *needle)
-{
- g_autoptr (GList) children = NULL;
- g_autoptr (GAppInfo) needle_info = NULL;
-
- g_return_val_if_fail (needle, NULL);
- needle_info = G_APP_INFO (phosh_get_desktop_app_info_for_app_id (needle));
- if (!needle_info)
- return NULL;
-
- return find_activity_by_app_info (self, needle_info);
-}
-
-
-static PhoshActivity *
-create_new_activity (PhoshOverview *self,
- GAppInfo *info,
- PhoshToplevel *toplevel,
- const char *app_id,
- const char *parent_app_id)
-{
- PhoshOverviewPrivate *priv = phosh_overview_get_instance_private (self);
- PhoshShell *shell = phosh_shell_get_default ();
- PhoshActivity *activity;
- int width, height, pos = 0;
- gboolean fullscreen = FALSE, maximized = FALSE;
-
- phosh_shell_get_usable_area (shell, NULL, NULL, &width, &height);
-
- if (toplevel) {
- maximized = phosh_toplevel_is_maximized (toplevel);
- fullscreen = phosh_toplevel_is_fullscreen (toplevel);
- }
-
- activity = g_object_new (PHOSH_TYPE_ACTIVITY,
- "app-info", info,
- "app-id", app_id,
- "parent-app-id", parent_app_id,
- "win-width", width,
- "win-height", height,
- "maximized", maximized,
- "fullscreen", fullscreen,
- NULL);
-
- g_object_connect (activity,
- "swapped-signal::clicked", on_activity_clicked, self,
- NULL);
-
- if (!toplevel) {
- gboolean light_mode = !phosh_splash_manager_get_prefer_dark (priv->splash_manager);
- phosh_util_toggle_style_class (GTK_WIDGET (activity), "light", light_mode);
- }
-
- if (parent_app_id)
- pos = get_last_app_id_pos (self, parent_app_id);
-
- if (pos)
- hdy_carousel_insert (priv->carousel_running_activities, GTK_WIDGET (activity), pos);
- else
- gtk_container_add (GTK_CONTAINER (priv->carousel_running_activities), GTK_WIDGET (activity));
-
- return activity;
-}
-
-
-static void
-on_app_launch_started (PhoshOverview *self,
- GAppInfo *info,
- const char *startup_id,
- PhoshAppTracker *app_tracker)
-{
- PhoshActivity *activity;
-
- g_return_if_fail (PHOSH_IS_OVERVIEW (self));
- g_return_if_fail (G_IS_APP_INFO (info));
-
- g_debug ("Building splash for '%s'", g_app_info_get_id (info));
-
- activity = create_new_activity (self, info, NULL, NULL, NULL);
-
- g_object_set_data_full (G_OBJECT (activity),
- "startup-id",
- g_strdup (startup_id),
- g_free);
-}
-
-
-static void
-on_app_ready (PhoshOverview *self,
- GAppInfo *info,
- const char *startup_id,
- PhoshAppTracker *app_tracker)
-{
- g_return_if_fail (PHOSH_IS_OVERVIEW (self));
- g_return_if_fail (G_IS_APP_INFO (info));
-
- g_debug ("Activity '%s' started", g_app_info_get_id (info));
-}
-
-
-static void
-on_app_failed (PhoshOverview *self,
- GAppInfo *info,
- const char *startup_id,
- PhoshAppTracker *app_tracker)
-{
- PhoshActivity *activity;
-
- g_return_if_fail (PHOSH_IS_OVERVIEW (self));
- g_return_if_fail (G_IS_APP_INFO (info));
-
- activity = find_activity_by_app_info (self, info);
- if (!activity) {
- g_debug ("Activity '%s' already gone", g_app_info_get_id (info));
- return;
- }
-
- if (get_toplevel_from_activity (activity))
- return;
-
- /* TODO: show error state / notification */
- g_debug ("Activity '%s' failed to start, closing", g_app_info_get_id (info));
- gtk_widget_destroy (GTK_WIDGET (activity));
-}
-
-
static void
phosh_overview_get_property (GObject *object,
guint property_id,
@@ -249,12 +92,8 @@ get_toplevel_from_activity (PhoshActivity *activity)
{
PhoshToplevel *toplevel;
g_return_val_if_fail (PHOSH_IS_ACTIVITY (activity), NULL);
-
toplevel = g_object_get_data (G_OBJECT (activity), "toplevel");
- if (!toplevel) {
- g_return_val_if_fail (!phosh_activity_get_has_thumbnail (activity), NULL);
- return NULL;
- }
+ g_return_val_if_fail (PHOSH_IS_TOPLEVEL (toplevel), NULL);
return toplevel;
}
@@ -263,21 +102,22 @@ get_toplevel_from_activity (PhoshActivity *activity)
static PhoshActivity *
find_activity_by_toplevel (PhoshOverview *self, PhoshToplevel *needle)
{
- g_autoptr (GList) children = NULL;
+ guint len;
+ PhoshActivity *activity = NULL;
PhoshOverviewPrivate *priv = phosh_overview_get_instance_private (self);
- children = gtk_container_get_children (GTK_CONTAINER (priv->carousel_running_activities));
- for (GList *l = children; l; l = l->next) {
- PhoshActivity *activity = PHOSH_ACTIVITY (l->data);
+ len = adw_carousel_get_n_pages (ADW_CAROUSEL (priv->carousel_running_activities));
+ for (guint i = 0; i < len; i++) {
PhoshToplevel *toplevel;
+ activity = PHOSH_ACTIVITY (adw_carousel_get_nth_page (ADW_CAROUSEL (priv->carousel_running_activities), i));
toplevel = get_toplevel_from_activity (activity);
if (toplevel == needle)
- return activity;
+ break;
}
- g_return_val_if_reached (NULL);
- return NULL;
+ g_return_val_if_fail (activity, NULL);
+ return activity;
}
@@ -285,7 +125,7 @@ static void
scroll_to_activity (PhoshOverview *self, PhoshActivity *activity)
{
PhoshOverviewPrivate *priv = phosh_overview_get_instance_private (self);
- hdy_carousel_scroll_to (priv->carousel_running_activities, GTK_WIDGET (activity));
+ adw_carousel_scroll_to (ADW_CAROUSEL (priv->carousel_running_activities), GTK_WIDGET (activity), TRUE);
gtk_widget_grab_focus (GTK_WIDGET (activity));
}
@@ -293,33 +133,18 @@ scroll_to_activity (PhoshOverview *self, PhoshActivity *activity)
static void
on_activity_clicked (PhoshOverview *self, PhoshActivity *activity)
{
- PhoshOverviewPrivate *priv = phosh_overview_get_instance_private (self);
PhoshToplevel *toplevel;
-
g_return_if_fail (PHOSH_IS_OVERVIEW (self));
g_return_if_fail (PHOSH_IS_ACTIVITY (activity));
toplevel = get_toplevel_from_activity (activity);
+ g_return_if_fail (toplevel);
- if (toplevel) {
- g_return_if_fail (toplevel);
-
- g_debug ("Will raise %s (%s)",
- phosh_activity_get_app_id (activity),
- phosh_toplevel_get_title (toplevel));
-
- phosh_toplevel_activate (toplevel, phosh_wayland_get_wl_seat (phosh_wayland_get_default ()));
-
- phosh_splash_manager_lower_all (priv->splash_manager);
- } else {
- const char *startup_id = g_object_get_data (G_OBJECT (activity), "startup-id");
-
- if (startup_id)
- phosh_splash_manager_raise (priv->splash_manager, startup_id);
- else
- g_warning ("No startup-id for %s, can't raise splash", phosh_activity_get_app_id (activity));
- }
+ g_debug ("Will raise %s (%s)",
+ phosh_activity_get_app_id (activity),
+ phosh_toplevel_get_title (toplevel));
+ phosh_toplevel_activate (toplevel, phosh_wayland_get_wl_seat (phosh_wayland_get_default ()));
g_signal_emit (self, signals[ACTIVITY_RAISED], 0);
}
@@ -377,7 +202,8 @@ on_toplevel_closed (PhoshToplevel *toplevel, PhoshOverview *overview)
activity = find_activity_by_toplevel (overview, toplevel);
g_return_if_fail (PHOSH_IS_ACTIVITY (activity));
- gtk_widget_destroy (GTK_WIDGET (activity));
+ adw_carousel_remove (ADW_CAROUSEL (priv->carousel_running_activities),
+ GTK_WIDGET (activity));
if (priv->activity == activity)
priv->activity = NULL;
@@ -396,7 +222,6 @@ on_toplevel_activated_changed (PhoshToplevel *toplevel, GParamSpec *pspec, Phosh
if (phosh_toplevel_is_activated (toplevel)) {
activity = find_activity_by_toplevel (overview, toplevel);
priv->activity = activity;
- g_return_if_fail (PHOSH_IS_ACTIVITY (activity));
scroll_to_activity (overview, activity);
}
}
@@ -409,6 +234,7 @@ on_thumbnail_ready_changed (PhoshThumbnail *thumbnail, GParamSpec *pspec, PhoshA
g_return_if_fail (PHOSH_IS_ACTIVITY (activity));
phosh_activity_set_thumbnail (activity, thumbnail);
+ g_object_unref (thumbnail);
}
@@ -455,7 +281,9 @@ on_activity_has_focus_changed (PhoshOverview *self, GParamSpec *pspec, PhoshActi
priv = phosh_overview_get_instance_private (self);
if (gtk_widget_has_focus (GTK_WIDGET (activity)))
- hdy_carousel_scroll_to (priv->carousel_running_activities, GTK_WIDGET (activity));
+ adw_carousel_scroll_to (ADW_CAROUSEL (priv->carousel_running_activities),
+ GTK_WIDGET (activity),
+ TRUE);
}
@@ -465,21 +293,19 @@ get_last_app_id_pos (PhoshOverview *self, const char *app_id)
PhoshOverviewPrivate *priv;
g_autoptr (GList) children = NULL;
int pos;
+ guint len;
if (!app_id)
return 0;
priv = phosh_overview_get_instance_private (self);
- children = gtk_container_get_children (GTK_CONTAINER (priv->carousel_running_activities));
- pos = g_list_length (children);
- for (GList *l = g_list_last (children); l; l = l->prev) {
- PhoshActivity *a = PHOSH_ACTIVITY (l->data);
+ len = adw_carousel_get_n_pages (ADW_CAROUSEL (priv->carousel_running_activities));
+ for (pos = len - 1; pos >= 0; pos--) {
+ PhoshActivity *a = PHOSH_ACTIVITY (adw_carousel_get_nth_page (ADW_CAROUSEL (priv->carousel_running_activities), pos));
if (g_strcmp0 (phosh_activity_get_app_id (a), app_id) == 0)
break;
-
- pos--;
}
return pos;
@@ -487,17 +313,19 @@ get_last_app_id_pos (PhoshOverview *self, const char *app_id)
static void
-toplevel_to_activity (PhoshOverview *self, PhoshToplevel *toplevel)
+add_activity (PhoshOverview *self, PhoshToplevel *toplevel)
{
- PhoshOverviewPrivate *priv = phosh_overview_get_instance_private (self);
- PhoshActivity *activity;
+ PhoshOverviewPrivate *priv;
+ GtkWidget *activity;
const char *app_id, *title;
const char *parent_app_id = NULL;
int width, height;
PhoshToplevelManager *m = phosh_shell_get_toplevel_manager (phosh_shell_get_default ());
PhoshToplevel *parent = NULL;
+ gint pos;
g_return_if_fail (PHOSH_IS_OVERVIEW (self));
+ priv = phosh_overview_get_instance_private (self);
app_id = phosh_toplevel_get_app_id (toplevel);
title = phosh_toplevel_get_title (toplevel);
@@ -507,34 +335,27 @@ toplevel_to_activity (PhoshOverview *self, PhoshToplevel *toplevel)
if (parent)
parent_app_id = phosh_toplevel_get_app_id (parent);
- activity = find_activity_by_app_id (self, app_id);
- if (activity && get_toplevel_from_activity (activity)) {
- /* Multi window apps */
- g_debug ("Existing activity '%s' already has a toplevel", app_id);
- activity = NULL;
- }
-
+ g_debug ("Building activator for '%s' (%s)", app_id, title);
phosh_shell_get_usable_area (phosh_shell_get_default (), NULL, NULL, &width, &height);
- if (activity) {
- g_debug ("Using existing activity for '%s' (%s)", app_id, title);
- g_object_set (activity,
- "win-width", width,
- "win-height", height,
- "maximized", phosh_toplevel_is_maximized (toplevel),
- "fullscreen", phosh_toplevel_is_fullscreen (toplevel),
- NULL);
-
- g_object_set_data (G_OBJECT (activity), "startup-id", NULL);
- request_thumbnail (activity, toplevel);
- } else {
- g_debug ("Building activator for '%s' (%s)", app_id, title);
- activity = create_new_activity (self, NULL, toplevel, app_id, parent_app_id);
- }
-
+ activity = g_object_new (PHOSH_TYPE_ACTIVITY,
+ "app-id", app_id,
+ "parent-app-id", parent_app_id,
+ "win-width", width,
+ "win-height", height,
+ "maximized", phosh_toplevel_is_maximized (toplevel),
+ "fullscreen", phosh_toplevel_is_fullscreen (toplevel),
+ NULL);
g_object_set_data (G_OBJECT (activity), "toplevel", toplevel);
- gtk_widget_set_visible (GTK_WIDGET (activity), TRUE);
+
+ pos = get_last_app_id_pos (self, parent_app_id);
+ if (pos)
+ adw_carousel_insert (ADW_CAROUSEL (priv->carousel_running_activities), activity, pos);
+ else
+ adw_carousel_append (ADW_CAROUSEL (priv->carousel_running_activities), activity);
+ gtk_widget_set_visible (activity, TRUE);
g_object_connect (activity,
+ "swapped-signal::clicked", on_activity_clicked, self,
"swapped-signal::closed", on_activity_closed, self,
"swapped-signal::fullscreened", on_activity_fullscreened, self,
"swapped-signal::notify::has-focus", on_activity_has_focus_changed, self,
@@ -545,7 +366,6 @@ toplevel_to_activity (PhoshOverview *self, PhoshToplevel *toplevel)
"object-signal::closed", on_toplevel_closed, self,
"object-signal::notify::activated", on_toplevel_activated_changed, self,
NULL);
-
g_object_bind_property (toplevel, "maximized", activity, "maximized", G_BINDING_DEFAULT);
g_object_bind_property (toplevel, "fullscreen", activity, "fullscreen", G_BINDING_DEFAULT);
@@ -562,12 +382,12 @@ set_has_activities (PhoshOverview *self)
PhoshOverviewPrivate *priv = phosh_overview_get_instance_private (self);
gboolean has_activities;
- has_activities = !!hdy_carousel_get_n_pages (HDY_CAROUSEL (priv->carousel_running_activities));
+ has_activities = !!adw_carousel_get_n_pages (ADW_CAROUSEL (priv->carousel_running_activities));
if (priv->has_activities == has_activities)
return;
priv->has_activities = has_activities;
- gtk_widget_set_visible (GTK_WIDGET (priv->carousel_running_activities), has_activities);
+ gtk_widget_set_visible (priv->carousel_running_activities, has_activities);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_HAS_ACTIVITIES]);
}
@@ -583,28 +403,29 @@ get_running_activities (PhoshOverview *self)
for (guint i = 0; i < toplevels_num; i++) {
PhoshToplevel *toplevel = phosh_toplevel_manager_get_toplevel (toplevel_manager, i);
- toplevel_to_activity (self, toplevel);
+ add_activity (self, toplevel);
}
}
static void
-on_toplevel_added (PhoshOverview *self, PhoshToplevel *toplevel)
+on_toplevel_added (PhoshOverview *self, PhoshToplevel *toplevel, PhoshToplevelManager *manager)
{
g_return_if_fail (PHOSH_IS_OVERVIEW (self));
g_return_if_fail (PHOSH_IS_TOPLEVEL (toplevel));
-
- toplevel_to_activity (self, toplevel);
+ g_return_if_fail (PHOSH_IS_TOPLEVEL_MANAGER (manager));
+ add_activity (self, toplevel);
}
static void
-on_toplevel_changed (PhoshOverview *self, PhoshToplevel *toplevel)
+on_toplevel_changed (PhoshOverview *self, PhoshToplevel *toplevel, PhoshToplevelManager *manager)
{
PhoshActivity *activity;
g_return_if_fail (PHOSH_IS_OVERVIEW (self));
g_return_if_fail (PHOSH_IS_TOPLEVEL (toplevel));
+ g_return_if_fail (PHOSH_IS_TOPLEVEL_MANAGER (manager));
if (phosh_shell_get_state (phosh_shell_get_default ()) & PHOSH_STATE_OVERVIEW)
return;
@@ -616,27 +437,6 @@ on_toplevel_changed (PhoshOverview *self, PhoshToplevel *toplevel)
}
-static void
-on_toplevel_missing (PhoshOverview *self, GAppInfo *info)
-{
- PhoshActivity *activity;
-
- g_return_if_fail (PHOSH_IS_OVERVIEW (self));
- g_return_if_fail (G_IS_APP_INFO (info));
-
- activity = find_activity_by_app_info (self, info);
- if (!activity)
- return;
-
- /* Activity is not a splash screen, so keep it */
- if (phosh_activity_get_has_thumbnail (activity))
- return;
-
- g_warning ("App %s didn't present a toplevel, hiding splash", g_app_info_get_id (info));
- gtk_widget_destroy (GTK_WIDGET (activity));
-}
-
-
static void
on_n_pages_changed (PhoshOverview *self)
{
@@ -648,24 +448,25 @@ on_n_pages_changed (PhoshOverview *self)
static void
phosh_overview_size_allocate (GtkWidget *widget,
- GtkAllocation *alloc)
+ int width, int height, int baseline)
{
PhoshOverview *self = PHOSH_OVERVIEW (widget);
PhoshOverviewPrivate *priv = phosh_overview_get_instance_private (self);
- g_autoptr (GList) children = NULL;
- int width, height;
+ guint len;
+ int win_width, win_height;
- phosh_shell_get_usable_area (phosh_shell_get_default (), NULL, NULL, &width, &height);
- children = gtk_container_get_children (GTK_CONTAINER (priv->carousel_running_activities));
+ phosh_shell_get_usable_area (phosh_shell_get_default (), NULL, NULL, &win_width, &win_height);
+ len = adw_carousel_get_n_pages (ADW_CAROUSEL (priv->carousel_running_activities));
- for (GList *l = children; l; l = l->next) {
- g_object_set (l->data,
- "win-width", width,
- "win-height", height,
+ for (guint i = 0; i < len; i++) {
+ GtkWidget *a = adw_carousel_get_nth_page (ADW_CAROUSEL (priv->carousel_running_activities), i);
+ g_object_set (a,
+ "win-width", win_width,
+ "win-height", win_height,
NULL);
}
- GTK_WIDGET_CLASS (phosh_overview_parent_class)->size_allocate (widget, alloc);
+ GTK_WIDGET_CLASS (phosh_overview_parent_class)->size_allocate (widget, width, height, baseline);
}
@@ -679,13 +480,12 @@ on_app_launched (PhoshOverview *self, GAppInfo *info, GtkWidget *widget)
static void
-on_page_changed (PhoshOverview *self, guint index, HdyCarousel *carousel)
+on_page_changed (PhoshOverview *self, guint index, AdwCarousel *carousel)
{
PhoshActivity *activity;
PhoshToplevel *toplevel;
- g_autoptr (GList) list = NULL;
g_return_if_fail (PHOSH_IS_OVERVIEW (self));
- g_return_if_fail (HDY_IS_CAROUSEL (carousel));
+ g_return_if_fail (ADW_IS_CAROUSEL (carousel));
/* Carousel is empty */
if (((int)index < 0))
@@ -699,8 +499,7 @@ on_page_changed (PhoshOverview *self, guint index, HdyCarousel *carousel)
if (!(phosh_shell_get_state (phosh_shell_get_default ()) & PHOSH_STATE_OVERVIEW))
return;
- list = gtk_container_get_children (GTK_CONTAINER (carousel));
- activity = PHOSH_ACTIVITY (g_list_nth_data (list, index));
+ activity = PHOSH_ACTIVITY (adw_carousel_get_nth_page (carousel, index));
toplevel = get_toplevel_from_activity (activity);
phosh_toplevel_activate (toplevel, phosh_wayland_get_wl_seat (phosh_wayland_get_default ()));
@@ -709,6 +508,15 @@ on_page_changed (PhoshOverview *self, guint index, HdyCarousel *carousel)
}
+static void
+phosh_overview_dispose (GObject *object)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_OVERVIEW);
+
+ G_OBJECT_CLASS (phosh_overview_parent_class)->dispose (object);
+}
+
+
static void
phosh_overview_constructed (GObject *object)
{
@@ -721,7 +529,6 @@ phosh_overview_constructed (GObject *object)
g_object_connect (toplevel_manager,
"swapped-object-signal::toplevel-added", on_toplevel_added, self,
"swapped-object-signal::toplevel-changed", on_toplevel_changed, self,
- "swapped-object-signal::toplevel-missing", on_toplevel_missing, self,
NULL);
get_running_activities (self);
@@ -735,6 +542,7 @@ phosh_overview_class_init (PhoshOverviewClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->constructed = phosh_overview_constructed;
+ object_class->dispose = phosh_overview_dispose;
object_class->get_property = phosh_overview_get_property;
widget_class->size_allocate = phosh_overview_size_allocate;
@@ -797,23 +605,10 @@ phosh_overview_class_init (PhoshOverviewClass *klass)
static void
phosh_overview_init (PhoshOverview *self)
{
- PhoshShell *shell = phosh_shell_get_default ();
PhoshOverviewPrivate *priv = phosh_overview_get_instance_private (self);
priv->has_activities = -1;
gtk_widget_init_template (GTK_WIDGET (self));
-
- priv->app_tracker = phosh_shell_get_app_tracker (shell);
- /* Allow it to be empty for tests */
- if (priv->app_tracker) {
- g_object_connect (priv->app_tracker,
- "swapped-object-signal::app-launch-started", on_app_launch_started, self,
- "swapped-object-signal::app-failed", on_app_failed, self,
- "swapped-object-signal::app-ready", on_app_ready, self,
- NULL);
- }
-
- priv->splash_manager = phosh_shell_get_splash_manager (shell);
}
diff --git a/phosh/src/overview.h b/phosh/src/overview.h
index 807df8108..cc437a66f 100644
--- a/phosh/src/overview.h
+++ b/phosh/src/overview.h
@@ -12,7 +12,7 @@
G_BEGIN_DECLS
-#define PHOSH_TYPE_OVERVIEW (phosh_overview_get_type ())
+#define PHOSH_TYPE_OVERVIEW (phosh_overview_get_type())
G_DECLARE_FINAL_TYPE (PhoshOverview, phosh_overview, PHOSH, OVERVIEW, GtkBox)
diff --git a/phosh/src/password-entry.c b/phosh/src/password-entry.c
index 0c8d7d1d9..45b0f7996 100644
--- a/phosh/src/password-entry.c
+++ b/phosh/src/password-entry.c
@@ -43,11 +43,23 @@ on_icon_press (PhoshPasswordEntry *self, gpointer user_data)
}
+static void
+phosh_password_entry_dispose (GObject *object)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_PASSWORD_ENTRY);
+
+ G_OBJECT_CLASS (phosh_password_entry_parent_class)->dispose (object);
+}
+
+
static void
phosh_password_entry_class_init (PhoshPasswordEntryClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = phosh_password_entry_dispose;
+
gtk_widget_class_set_template_from_resource (widget_class,
"/mobi/phosh/ui/password-entry.ui");
gtk_widget_class_bind_template_callback (widget_class, on_icon_press);
diff --git a/phosh/src/phosh-wayland.c b/phosh/src/phosh-wayland.c
index cba8a12c5..6d7d7389d 100644
--- a/phosh/src/phosh-wayland.c
+++ b/phosh/src/phosh-wayland.c
@@ -12,7 +12,7 @@
#include "phosh-enums.h"
#include "phosh-wayland.h"
-#include
+#include
/**
* PhoshWayland:
diff --git a/phosh/src/phosh.gresources.xml b/phosh/src/phosh.gresources.xml
index 7a22d0f1f..9f5ec2dbe 100644
--- a/phosh/src/phosh.gresources.xml
+++ b/phosh/src/phosh.gresources.xml
@@ -14,12 +14,12 @@
ui/bt-status-page.ui
ui/call-notification.ui
ui/cell-broadcast-prompt.ui
- ui/channel-bar.ui
ui/emergency-contact-row.ui
ui/emergency-menu.ui
ui/end-session-dialog.ui
ui/feedback-status-page.ui
ui/gtk-mount-prompt.ui
+ ui/gvc-channel-bar.ui
ui/home.ui
ui/keypad.ui
ui/lockscreen.ui
@@ -52,6 +52,7 @@
stylesheet/adwaita-dark.css
stylesheet/adwaita-hc-light.css
stylesheet/common.css
+ ../data/icons/fake-app.svg
../data/icons/app-icon-unknown.svg
diff --git a/phosh/src/polkit-auth-agent.c b/phosh/src/polkit-auth-agent.c
index de230296c..6ab86e65e 100644
--- a/phosh/src/polkit-auth-agent.c
+++ b/phosh/src/polkit-auth-agent.c
@@ -8,8 +8,6 @@
#define G_LOG_DOMAIN "phosh-polkit-auth-agent"
-#include "phosh-config.h"
-
#include "polkit-auth-agent.h"
#include "polkit-auth-prompt.h"
#include "shell-priv.h"
@@ -18,12 +16,9 @@
#include
#ifdef PHOSH_POLKIT_AUTH_DEBUG
-#define auth_debug(...) g_debug (__VA_ARGS__)
+#define auth_debug(...) g_debug(__VA_ARGS__)
#else
-static void
-auth_debug (const char *str, ...)
-{
-}
+static void auth_debug(const char *str, ...) {}
#endif
/**
@@ -38,29 +33,30 @@ auth_debug (const char *str, ...)
typedef struct {
/* not holding ref */
PhoshPolkitAuthAgent *agent;
- GCancellable *cancellable;
+ GCancellable *cancellable;
gulong handler_id;
/* copies */
- char *action_id;
- char *message;
- char *icon_name;
- PolkitDetails *details;
- char *cookie;
- GList *identities;
+ char *action_id;
+ char *message;
+ char *icon_name;
+ PolkitDetails *details;
+ char *cookie;
+ GList *identities;
GTask *simple;
} AuthRequest;
-struct _PhoshPolkitAuthAgent {
- PolkitAgentListener parent;
+struct _PhoshPolkitAuthAgent
+{
+ PolkitAgentListener parent;
GList *scheduled_requests;
- AuthRequest *current_request;
+ AuthRequest *current_request;
PhoshPolkitAuthPrompt *current_prompt;
gpointer handle;
- GCancellable *cancellable;
+ GCancellable *cancellable;
};
G_DEFINE_TYPE (PhoshPolkitAuthAgent, phosh_polkit_auth_agent, POLKIT_AGENT_TYPE_LISTENER);
@@ -125,7 +121,7 @@ agent_register_async (PhoshPolkitAuthAgent *self,
}
static void
-on_agent_registered (GObject *source_object,
+agent_registered_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
@@ -180,39 +176,39 @@ on_prompt_done (PhoshPolkitAuthPrompt *prompt, gboolean cancelled, AuthRequest *
static void
auth_request_initiate (AuthRequest *request)
{
- g_auto (GStrv) user_names = NULL;
+ g_auto(GStrv) user_names = NULL;
GPtrArray *p;
GList *l;
p = g_ptr_array_new ();
for (l = request->identities; l != NULL; l = l->next) {
- if (POLKIT_IS_UNIX_USER (l->data)) {
- PolkitUnixUser *user = POLKIT_UNIX_USER (l->data);
- int uid;
- char buf[4096];
- struct passwd pwd;
- struct passwd *ppwd;
- int ret;
-
- uid = polkit_unix_user_get_uid (user);
- ret = getpwuid_r (uid, &pwd, buf, sizeof (buf), &ppwd);
- if (!ret) {
- if (!g_utf8_validate (pwd.pw_name, -1, NULL))
- g_warning ("Invalid UTF-8 in username for uid %d. Skipping", uid);
- else
- g_ptr_array_add (p, g_strdup (pwd.pw_name));
+ if (POLKIT_IS_UNIX_USER (l->data)) {
+ PolkitUnixUser *user = POLKIT_UNIX_USER (l->data);
+ int uid;
+ char buf[4096];
+ struct passwd pwd;
+ struct passwd *ppwd;
+ int ret;
+
+ uid = polkit_unix_user_get_uid (user);
+ ret = getpwuid_r (uid, &pwd, buf, sizeof (buf), &ppwd);
+ if (!ret) {
+ if (!g_utf8_validate (pwd.pw_name, -1, NULL))
+ g_warning ("Invalid UTF-8 in username for uid %d. Skipping", uid);
+ else
+ g_ptr_array_add (p, g_strdup (pwd.pw_name));
+ } else {
+ g_warning ("Error looking up user name for uid %d: %d", uid, ret);
+ }
} else {
- g_warning ("Error looking up user name for uid %d: %d", uid, ret);
+ g_warning ("Unsupporting identity of GType %s", g_type_name (G_TYPE_FROM_INSTANCE (l->data)));
}
- } else {
- g_warning ("Unsupporting identity of GType %s", g_type_name (G_TYPE_FROM_INSTANCE (l->data)));
- }
}
g_ptr_array_add (p, NULL);
user_names = (char **) g_ptr_array_free (p, FALSE);
- g_debug ("New prompt for %s", request->message);
+ g_debug("New prompt for %s", request->message);
/* We must not issue a new prompt when there's one already */
g_return_if_fail (!request->agent->current_prompt);
request->agent->current_prompt = PHOSH_POLKIT_AUTH_PROMPT (
@@ -322,16 +318,16 @@ on_request_cancelled (GCancellable *cancellable,
static void
-initiate_authentication (PolkitAgentListener *listener,
- const char *action_id,
- const char *message,
- const char *icon_name,
- PolkitDetails *details,
- const char *cookie,
- GList *identities,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+initiate_authentication (PolkitAgentListener *listener,
+ const char *action_id,
+ const char *message,
+ const char *icon_name,
+ PolkitDetails *details,
+ const char *cookie,
+ GList *identities,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
PhoshPolkitAuthAgent *self = PHOSH_POLKIT_AUTH_AGENT (listener);
AuthRequest *request;
@@ -359,9 +355,9 @@ initiate_authentication (PolkitAgentListener *listener,
}
static gboolean
-initiate_authentication_finish (PolkitAgentListener *listener,
- GAsyncResult *res,
- GError **error)
+initiate_authentication_finish (PolkitAgentListener *listener,
+ GAsyncResult *res,
+ GError **error)
{
return g_task_propagate_boolean (G_TASK (res), error);
}
@@ -375,7 +371,7 @@ phosh_polkit_auth_agent_constructed (GObject *object)
G_OBJECT_CLASS (phosh_polkit_auth_agent_parent_class)->constructed (object);
self->cancellable = g_cancellable_new ();
- agent_register_async (self, self->cancellable, on_agent_registered, NULL);
+ agent_register_async (self, self->cancellable, agent_registered_cb, NULL);
}
diff --git a/phosh/src/polkit-auth-agent.h b/phosh/src/polkit-auth-agent.h
index 788af9a70..d0d0b6b0a 100644
--- a/phosh/src/polkit-auth-agent.h
+++ b/phosh/src/polkit-auth-agent.h
@@ -8,18 +8,21 @@
#pragma once
+#include "phosh-config.h"
+
#define POLKIT_AGENT_I_KNOW_API_IS_SUBJECT_TO_CHANGE
#include
+#include
+
G_BEGIN_DECLS
-#define PHOSH_TYPE_POLKIT_AUTH_AGENT phosh_polkit_auth_agent_get_type ()
+#define PHOSH_TYPE_POLKIT_AUTH_AGENT (phosh_polkit_auth_agent_get_type())
-G_DECLARE_FINAL_TYPE (PhoshPolkitAuthAgent, phosh_polkit_auth_agent, PHOSH, POLKIT_AUTH_AGENT,
- PolkitAgentListener)
+G_DECLARE_FINAL_TYPE (PhoshPolkitAuthAgent, phosh_polkit_auth_agent, PHOSH, POLKIT_AUTH_AGENT, PolkitAgentListener)
PhoshPolkitAuthAgent * phosh_polkit_auth_agent_new (void);
-void phosh_polkit_authentication_agent_register (PhoshPolkitAuthAgent *agent,
- GError **error);
+void phosh_polkit_authentication_agent_register (PhoshPolkitAuthAgent *agent,
+ GError **error);
G_END_DECLS
diff --git a/phosh/src/polkit-auth-prompt.c b/phosh/src/polkit-auth-prompt.c
index 45a497c5a..31d48dc87 100644
--- a/phosh/src/polkit-auth-prompt.c
+++ b/phosh/src/polkit-auth-prompt.c
@@ -13,8 +13,6 @@
#include "phosh-config.h"
-#include "accounts-dbus.h"
-#include "accounts-user-dbus.h"
#include "polkit-auth-prompt.h"
#define GCR_API_SUBJECT_TO_CHANGE
@@ -24,7 +22,6 @@
#include
#include
-#include
/**
* PhoshPolkitAuthPrompt:
@@ -50,7 +47,7 @@ enum {
DONE,
N_SIGNALS
};
-static guint signals[N_SIGNALS];
+static guint signals[N_SIGNALS] = { 0 };
struct _PhoshPolkitAuthPrompt {
PhoshSystemModalDialog parent;
@@ -72,15 +69,11 @@ struct _PhoshPolkitAuthPrompt {
char *cookie;
GStrv user_names;
- const char *user_name;
- GCancellable *cancel;
-
PolkitIdentity *identity;
PolkitAgentSession *session;
gboolean done_emitted;
};
-
G_DEFINE_TYPE (PhoshPolkitAuthPrompt, phosh_polkit_auth_prompt, PHOSH_TYPE_SYSTEM_MODAL_DIALOG);
@@ -148,93 +141,6 @@ set_icon_name (PhoshPolkitAuthPrompt *self, const char *icon_name)
}
-static void
-on_accounts_user_proxy_ready (GObject *source, GAsyncResult *result, gpointer data)
-{
- PhoshPolkitAuthPrompt *self = data;
- g_autoptr (GError) error = NULL;
- g_autoptr (PhoshDBusAccountsUser) user = NULL;
- const char *real_name = NULL;
- const char *icon_path = NULL;
- g_autoptr (GFile) icon_file = NULL;
- g_autoptr (GIcon) icon = NULL;
-
- user = phosh_dbus_accounts_user_proxy_new_finish (result, &error);
- if (error) {
- if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- g_debug ("Skipping create user proxy: %s", error->message);
- else
- g_warning ("Failed to create user proxy %s: %s", self->user_name, error->message);
- return;
- }
- g_debug ("Created proxy for user name: %s", self->user_name);
-
- real_name = phosh_dbus_accounts_user_get_real_name (user);
- hdy_avatar_set_text (HDY_AVATAR (self->img_icon), real_name);
- gtk_label_set_text (GTK_LABEL (self->lbl_user_name), real_name);
-
- icon_path = phosh_dbus_accounts_user_get_icon_file (user);
- icon_file = g_file_new_for_path (icon_path);
- icon = g_file_icon_new (icon_file);
- hdy_avatar_set_loadable_icon (HDY_AVATAR (self->img_icon), G_LOADABLE_ICON (icon));
-}
-
-
-static void
-on_find_user_by_name_ready (GObject *source, GAsyncResult *result, gpointer data)
-{
- g_autoptr (PhoshDBusAccounts) accounts = PHOSH_DBUS_ACCOUNTS (source);
- PhoshPolkitAuthPrompt *self = data;
- g_autoptr (GError) error = NULL;
- g_autofree char *user_path = NULL;
-
- phosh_dbus_accounts_call_find_user_by_name_finish (accounts, &user_path, result, &error);
- if (error) {
- if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- g_debug ("Skipping find user: %s", error->message);
- else
- g_warning ("Failed to find user %s: %s", self->user_name, error->message);
- return;
- }
- g_debug ("Found user for user name: %s at %s", self->user_name, user_path);
-
- g_debug ("Creating proxy for user name: %s", self->user_name);
- phosh_dbus_accounts_user_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
- G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS,
- "org.freedesktop.Accounts",
- user_path,
- self->cancel,
- on_accounts_user_proxy_ready,
- self);
-}
-
-
-static void
-on_accounts_proxy_ready (GObject *source, GAsyncResult *result, gpointer data)
-{
- PhoshDBusAccounts *accounts;
- PhoshPolkitAuthPrompt *self = data;
- g_autoptr (GError) error = NULL;
-
- accounts = phosh_dbus_accounts_proxy_new_finish (result, &error);
- if (error) {
- if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- g_debug ("Skipping create Accounts proxy: %s", error->message);
- else
- g_warning ("Failed to create Accounts proxy: %s", error->message);
- return;
- }
- g_debug ("Created Accounts proxy for user name: %s", self->user_name);
-
- g_debug ("Finding user for user name: %s", self->user_name);
- phosh_dbus_accounts_call_find_user_by_name (accounts,
- self->user_name,
- self->cancel,
- on_find_user_by_name_ready,
- self);
-}
-
-
static void
set_user_names (PhoshPolkitAuthPrompt *self, const GStrv user_names)
{
@@ -274,33 +180,20 @@ set_user_names (PhoshPolkitAuthPrompt *self, const GStrv user_names)
return;
}
- hdy_avatar_set_text (HDY_AVATAR (self->img_icon), user_name);
gtk_label_set_text (GTK_LABEL (self->lbl_user_name), user_name);
-
- self->user_name = user_name;
- g_debug ("Creating Accounts proxy for user name: %s", self->user_name);
- phosh_dbus_accounts_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
- (G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
- G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS),
- "org.freedesktop.Accounts",
- "/org/freedesktop/Accounts",
- self->cancel,
- on_accounts_proxy_ready,
- self);
-
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_USER_NAMES]);
}
static void
-phosh_polkit_auth_prompt_set_property (GObject *object,
- guint property_id,
+phosh_polkit_auth_prompt_set_property (GObject *obj,
+ guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
- PhoshPolkitAuthPrompt *self = PHOSH_POLKIT_AUTH_PROMPT (object);
+ PhoshPolkitAuthPrompt *self = PHOSH_POLKIT_AUTH_PROMPT (obj);
- switch (property_id) {
+ switch (prop_id) {
case PROP_ACTION_ID:
set_action_id (self, g_value_get_string (value));
break;
@@ -317,38 +210,38 @@ phosh_polkit_auth_prompt_set_property (GObject *object,
set_user_names (self, g_value_get_boxed (value));
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
}
}
static void
-phosh_polkit_auth_prompt_get_property (GObject *object,
- guint property_id,
+phosh_polkit_auth_prompt_get_property (GObject *obj,
+ guint prop_id,
GValue *value,
GParamSpec *pspec)
{
- PhoshPolkitAuthPrompt *self = PHOSH_POLKIT_AUTH_PROMPT (object);
+ PhoshPolkitAuthPrompt *self = PHOSH_POLKIT_AUTH_PROMPT (obj);
- switch (property_id) {
+ switch (prop_id) {
case PROP_ACTION_ID:
- g_value_set_string (value, self->action_id ?: "");
+ g_value_set_string (value, self->action_id?: "");
break;
case PROP_COOKIE:
- g_value_set_string (value, self->cookie ?: "");
+ g_value_set_string (value, self->cookie?: "");
break;
case PROP_MESSAGE:
- g_value_set_string (value, self->message ?: "");
+ g_value_set_string (value, self->message?: "");
break;
case PROP_ICON_NAME:
- g_value_set_string (value, self->icon_name ?: "");
+ g_value_set_string (value, self->icon_name?: "");
break;
case PROP_USER_NAMES:
g_value_set_boxed (value, self->user_names ? g_strdupv (self->user_names) : NULL);
break;
default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
break;
}
}
@@ -383,7 +276,7 @@ on_auth_session_request (PhoshPolkitAuthPrompt *self,
gtk_label_set_text (GTK_LABEL (self->lbl_password), request);
gtk_entry_set_visibility (GTK_ENTRY (self->entry_password), echo_on);
- gtk_entry_set_text (GTK_ENTRY (self->entry_password), "");
+ gtk_editable_set_text (GTK_EDITABLE (self->entry_password), "");
gtk_widget_grab_focus (self->entry_password);
}
@@ -496,24 +389,23 @@ on_btn_authenticate_clicked (PhoshPolkitAuthPrompt *self, GtkButton *btn)
static void
-phosh_polkit_auth_prompt_dispose (GObject *object)
+phosh_polkit_auth_prompt_dispose (GObject *obj)
{
- PhoshPolkitAuthPrompt *self = PHOSH_POLKIT_AUTH_PROMPT (object);
+ PhoshPolkitAuthPrompt *self = PHOSH_POLKIT_AUTH_PROMPT (obj);
- g_cancellable_cancel (self->cancel);
- g_clear_object (&self->cancel);
- self->user_name = NULL;
g_clear_object (&self->identity);
g_clear_object (&self->session);
- G_OBJECT_CLASS (phosh_polkit_auth_prompt_parent_class)->dispose (object);
+ gtk_widget_dispose_template (GTK_WIDGET (obj), PHOSH_TYPE_POLKIT_AUTH_PROMPT);
+
+ G_OBJECT_CLASS (phosh_polkit_auth_prompt_parent_class)->dispose (obj);
}
static void
-phosh_polkit_auth_prompt_finalize (GObject *object)
+phosh_polkit_auth_prompt_finalize (GObject *obj)
{
- PhoshPolkitAuthPrompt *self = PHOSH_POLKIT_AUTH_PROMPT (object);
+ PhoshPolkitAuthPrompt *self = PHOSH_POLKIT_AUTH_PROMPT (obj);
g_free (self->message);
g_free (self->icon_name);
@@ -521,7 +413,7 @@ phosh_polkit_auth_prompt_finalize (GObject *object)
g_free (self->cookie);
g_strfreev (self->user_names);
- G_OBJECT_CLASS (phosh_polkit_auth_prompt_parent_class)->finalize (object);
+ G_OBJECT_CLASS (phosh_polkit_auth_prompt_parent_class)->finalize (obj);
}
@@ -532,9 +424,7 @@ phosh_polkit_auth_prompt_constructed (GObject *object)
G_OBJECT_CLASS (phosh_polkit_auth_prompt_parent_class)->constructed (object);
- self->cancel = g_cancellable_new ();
-
- self->password_buffer = gcr_secure_entry_buffer_new ();
+ self->password_buffer = gtk_password_entry_buffer_new ();
gtk_entry_set_buffer (GTK_ENTRY (self->entry_password),
GTK_ENTRY_BUFFER (self->password_buffer));
@@ -545,7 +435,7 @@ phosh_polkit_auth_prompt_constructed (GObject *object)
static void
phosh_polkit_auth_prompt_class_init (PhoshPolkitAuthPromptClass *klass)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GObjectClass *object_class = (GObjectClass *)klass;
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->get_property = phosh_polkit_auth_prompt_get_property;
@@ -593,7 +483,7 @@ phosh_polkit_auth_prompt_class_init (PhoshPolkitAuthPromptClass *klass)
/**
* PolkitAuthPrompt:user-names:
*
- * The user names to authenticate as
+ * The user name's to authenticate as
*/
props[PROP_USER_NAMES] =
g_param_spec_boxed ("user-names", "", "",
diff --git a/phosh/src/polkit-auth-prompt.h b/phosh/src/polkit-auth-prompt.h
index ab0d6d6e2..af923a051 100644
--- a/phosh/src/polkit-auth-prompt.h
+++ b/phosh/src/polkit-auth-prompt.h
@@ -6,14 +6,12 @@
#pragma once
+#include
#include "system-modal-dialog.h"
-G_BEGIN_DECLS
+#define PHOSH_TYPE_POLKIT_AUTH_PROMPT (phosh_polkit_auth_prompt_get_type())
-#define PHOSH_TYPE_POLKIT_AUTH_PROMPT phosh_polkit_auth_prompt_get_type ()
-
-G_DECLARE_FINAL_TYPE (PhoshPolkitAuthPrompt, phosh_polkit_auth_prompt, PHOSH, POLKIT_AUTH_PROMPT,
- PhoshSystemModalDialog);
+G_DECLARE_FINAL_TYPE (PhoshPolkitAuthPrompt, phosh_polkit_auth_prompt, PHOSH, POLKIT_AUTH_PROMPT, PhoshSystemModalDialog);
GtkWidget *phosh_polkit_auth_prompt_new (const char *action_id,
const char *message,
@@ -21,4 +19,4 @@ GtkWidget *phosh_polkit_auth_prompt_new (const char *action_id,
const char *cookie,
GStrv user_names);
-G_END_DECLS
+
diff --git a/phosh/src/power-menu-manager.c b/phosh/src/power-menu-manager.c
index ef81e962b..81e8513d9 100644
--- a/phosh/src/power-menu-manager.c
+++ b/phosh/src/power-menu-manager.c
@@ -8,10 +8,10 @@
#define G_LOG_DOMAIN "phosh-power-menu-manager"
+#include "layersurface-priv.h"
#include "power-menu-manager.h"
#include "power-menu.h"
#include "shell-priv.h"
-#include "util.h"
/**
* PhoshPowerMenuManager:
@@ -36,7 +36,10 @@ G_DEFINE_TYPE (PhoshPowerMenuManager, phosh_power_menu_manager, G_TYPE_OBJECT)
static void
close_menu (PhoshPowerMenuManager *self)
{
- g_clear_pointer (&self->dialog, phosh_cp_widget_destroy);
+ PhoshPowerMenu *dialog = g_steal_pointer (&self->dialog);
+
+ if (dialog)
+ phosh_layer_surface_destroy (PHOSH_LAYER_SURFACE (dialog));
}
@@ -172,7 +175,7 @@ phosh_power_menu_manager_finalize (GObject *object)
g_action_map_remove_action (G_ACTION_MAP (phosh_shell_get_default ()), "power.toggle-menu");
g_clear_object (&self->menu_actions);
- g_clear_pointer (&self->dialog, phosh_cp_widget_destroy);
+ close_menu (self);
G_OBJECT_CLASS (phosh_power_menu_manager_parent_class)->finalize (object);
}
diff --git a/phosh/src/power-menu.c b/phosh/src/power-menu.c
index 9d590ce25..455e7ad09 100644
--- a/phosh/src/power-menu.c
+++ b/phosh/src/power-menu.c
@@ -92,6 +92,15 @@ phosh_power_menu_get_property (GObject *object,
}
+static void
+phosh_power_menu_dispose (GObject *object)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_POWER_MENU);
+
+ G_OBJECT_CLASS (phosh_power_menu_parent_class)->dispose (object);
+}
+
+
static void
phosh_power_menu_class_init (PhoshPowerMenuClass *klass)
{
@@ -100,6 +109,7 @@ phosh_power_menu_class_init (PhoshPowerMenuClass *klass)
object_class->get_property = phosh_power_menu_get_property;
object_class->set_property = phosh_power_menu_set_property;
+ object_class->dispose = phosh_power_menu_dispose;
/**
* PowerMenu:show-suspend:
diff --git a/phosh/src/quick-setting.c b/phosh/src/quick-setting.c
index e68cf87b3..8d2555c5c 100644
--- a/phosh/src/quick-setting.c
+++ b/phosh/src/quick-setting.c
@@ -184,9 +184,7 @@ static void
launch_action_else_emit (PhoshQuickSetting *self)
{
PhoshQuickSettingPrivate *priv = phosh_quick_setting_get_instance_private (self);
- GActionGroup *group;
GVariant *param = NULL;
- g_auto (GStrv) str_array = NULL;
if (priv->long_press_action_name == NULL) {
g_signal_emit (self, signals[LONG_PRESSED], 0);
@@ -196,15 +194,7 @@ launch_action_else_emit (PhoshQuickSetting *self)
if (priv->long_press_action_target != NULL)
param = g_variant_new_parsed (priv->long_press_action_target, NULL);
- str_array = g_strsplit (priv->long_press_action_name, ".", 2);
- if (g_strv_length (str_array) != 2) {
- g_warning ("Malformed action-name %s", priv->long_press_action_name);
- return;
- }
-
- group = gtk_widget_get_action_group (GTK_WIDGET (self), str_array[0]);
- g_return_if_fail (group);
- g_action_group_activate_action (group, str_array[1], param);
+ gtk_widget_activate_action_variant (GTK_WIDGET (self), priv->long_press_action_name, param);
}
@@ -260,27 +250,29 @@ on_status_page_done (PhoshQuickSetting *self)
static void
-phosh_quick_setting_finalize (GObject *object)
+phosh_quick_setting_dispose (GObject *object)
{
PhoshQuickSetting *self = PHOSH_QUICK_SETTING (object);
- PhoshQuickSettingPrivate *priv = phosh_quick_setting_get_instance_private (self);
- g_clear_object (&priv->status_page);
- g_clear_pointer (&priv->long_press_action_name, g_free);
- g_clear_pointer (&priv->long_press_action_target, g_free);
+ phosh_quick_setting_set_status_icon (self, NULL);
- G_OBJECT_CLASS (phosh_quick_setting_parent_class)->finalize (object);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_QUICK_SETTING);
+
+ G_OBJECT_CLASS (phosh_quick_setting_parent_class)->dispose (object);
}
static void
-phosh_quick_setting_destroy (GtkWidget *widget)
+phosh_quick_setting_finalize (GObject *object)
{
- PhoshQuickSetting *self = PHOSH_QUICK_SETTING (widget);
+ PhoshQuickSetting *self = PHOSH_QUICK_SETTING (object);
+ PhoshQuickSettingPrivate *priv = phosh_quick_setting_get_instance_private (self);
- phosh_quick_setting_set_status_icon (self, NULL);
+ g_clear_object (&priv->status_page);
+ g_clear_pointer (&priv->long_press_action_name, g_free);
+ g_clear_pointer (&priv->long_press_action_target, g_free);
- GTK_WIDGET_CLASS (phosh_quick_setting_parent_class)->destroy (widget);
+ G_OBJECT_CLASS (phosh_quick_setting_parent_class)->finalize (object);
}
@@ -292,10 +284,9 @@ phosh_quick_setting_class_init (PhoshQuickSettingClass *klass)
object_class->set_property = phosh_quick_setting_set_property;
object_class->get_property = phosh_quick_setting_get_property;
+ object_class->dispose = phosh_quick_setting_dispose;
object_class->finalize = phosh_quick_setting_finalize;
- widget_class->destroy = phosh_quick_setting_destroy;
-
/**
* PhoshQuickSetting:active:
*
@@ -466,7 +457,7 @@ phosh_quick_setting_set_showing_status (PhoshQuickSetting *self, gboolean showin
else
icon_name = "go-next-symbolic";
- gtk_image_set_from_icon_name (priv->arrow, icon_name, -1);
+ gtk_image_set_from_icon_name (priv->arrow, icon_name);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_SHOWING_STATUS]);
}
@@ -540,7 +531,7 @@ phosh_quick_setting_set_status_icon (PhoshQuickSetting *self, PhoshStatusIcon *s
if (priv->status_icon) {
g_clear_pointer (&priv->label_binding, g_binding_unbind);
g_clear_pointer (&priv->active_binding, g_binding_unbind);
- gtk_container_remove (GTK_CONTAINER (priv->box), GTK_WIDGET (priv->status_icon));
+ gtk_box_remove (priv->box, GTK_WIDGET (priv->status_icon));
}
priv->status_icon = status_icon;
@@ -559,8 +550,7 @@ phosh_quick_setting_set_status_icon (PhoshQuickSetting *self, PhoshStatusIcon *s
g_signal_connect_object (status_icon, "destroy", G_CALLBACK (on_status_icon_destroy), self,
G_CONNECT_SWAPPED);
- gtk_box_pack_start (priv->box, GTK_WIDGET (priv->status_icon), 0, 0, 0);
- gtk_box_reorder_child (priv->box, GTK_WIDGET (priv->status_icon), 0);
+ gtk_box_prepend (priv->box, GTK_WIDGET (priv->status_icon));
}
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_STATUS_PAGE]);
diff --git a/phosh/src/quick-settings-box.c b/phosh/src/quick-settings-box.c
index 14cc011d8..1b760eb51 100644
--- a/phosh/src/quick-settings-box.c
+++ b/phosh/src/quick-settings-box.c
@@ -42,7 +42,7 @@ enum {
static GParamSpec *props[PROP_LAST_PROP];
struct _PhoshQuickSettingsBox {
- GtkContainer parent;
+ GtkWidget parent;
guint max_columns;
guint spacing;
@@ -54,7 +54,11 @@ struct _PhoshQuickSettingsBox {
PhoshQuickSetting *to_show_child;
};
-G_DEFINE_TYPE (PhoshQuickSettingsBox, phosh_quick_settings_box, GTK_TYPE_CONTAINER);
+static void phosh_quick_settings_box_buildable_iface_init (GtkBuildableIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (PhoshQuickSettingsBox, phosh_quick_settings_box, GTK_TYPE_WIDGET,
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
+ phosh_quick_settings_box_buildable_iface_init));
static void
@@ -106,13 +110,16 @@ phosh_quick_settings_box_get_property (GObject *object,
static void
-phosh_quick_settings_box_destroy (GtkWidget *widget)
+phosh_quick_settings_box_dispose (GObject *object)
{
- PhoshQuickSettingsBox *self = PHOSH_QUICK_SETTINGS_BOX (widget);
-
- GTK_WIDGET_CLASS (phosh_quick_settings_box_parent_class)->destroy (widget);
+ PhoshQuickSettingsBox *self = PHOSH_QUICK_SETTINGS_BOX (object);
if (self->children != NULL) {
+ g_autoptr (GPtrArray) children = g_ptr_array_copy (self->children, NULL, NULL);
+
+ for (int i = 0; i < children->len; i++)
+ phosh_quick_settings_box_remove (self, g_ptr_array_index (children, i));
+
g_ptr_array_free (self->children, TRUE);
self->children = NULL;
}
@@ -121,6 +128,10 @@ phosh_quick_settings_box_destroy (GtkWidget *widget)
gtk_widget_unparent (GTK_WIDGET (self->revealer));
self->revealer = NULL;
}
+
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_QUICK_SETTINGS_BOX);
+
+ G_OBJECT_CLASS (phosh_quick_settings_box_parent_class)->dispose (object);
}
@@ -246,7 +257,9 @@ compute_child_height (PhoshQuickSettingsBox *self)
int nat_height = 0;
for (int i = 0; i < self->children->len; i++) {
- gtk_widget_get_preferred_height (g_ptr_array_index (self->children, i), NULL, &nat_height);
+ gtk_widget_measure (g_ptr_array_index (self->children, i),
+ GTK_ORIENTATION_VERTICAL, -1,
+ NULL, &nat_height, NULL, NULL);
height = MAX (height, nat_height);
}
@@ -261,7 +274,9 @@ compute_child_width (PhoshQuickSettingsBox *self)
int nat_width = 0;
for (int i = 0; i < self->children->len; i++) {
- gtk_widget_get_preferred_width (g_ptr_array_index (self->children, i), NULL, &nat_width);
+ gtk_widget_measure (g_ptr_array_index (self->children, i),
+ GTK_ORIENTATION_HORIZONTAL, -1,
+ NULL, &nat_width, NULL, NULL);
width = MAX (width, nat_width);
}
@@ -277,6 +292,61 @@ phosh_quick_settings_box_get_request_mode (GtkWidget *widget)
}
+static void
+phosh_quick_settings_box_get_preferred_height (GtkWidget *widget, int *minimum_height,
+ int *natural_height)
+{
+ PhoshQuickSettingsBox *self = PHOSH_QUICK_SETTINGS_BOX (widget);
+ int len = 0;
+ int child_height;
+ int cols;
+ int rows;
+
+ g_debug ("%p: Querying for preferred height", self);
+
+ for (int i = 0; i < self->children->len; i++)
+ if (gtk_widget_get_visible (g_ptr_array_index (self->children, i)))
+ len += 1;
+
+ if (len == 0) {
+ g_debug ("%p: No visible children so preferred height is 0", self);
+ *natural_height = 0;
+ *minimum_height = 0;
+ return;
+ }
+
+ g_debug ("%p: Configuration: children = %d/%d\tcolumns = %d\tspacing = %d",
+ self, len, self->children->len, self->max_columns, self->spacing);
+
+ child_height = compute_child_height (self);
+ cols = self->max_columns;
+ rows = (int) ceil ((float) len / cols);
+
+ g_debug ("%p: Computed child height = %d", self, child_height);
+
+ *minimum_height = rows * (child_height + self->spacing) - self->spacing;
+ *natural_height = *minimum_height;
+
+ g_debug ("%p: Computed preferred height: minimum = %d\tnatural = %d",
+ self, *minimum_height, *natural_height);
+
+ if (self->shown_child != NULL) {
+ int rev_min_height = 0;
+ int rev_nat_height = 0;
+ gtk_widget_measure (GTK_WIDGET (self->revealer),
+ GTK_ORIENTATION_VERTICAL, -1,
+ &rev_min_height, &rev_nat_height, NULL, NULL);
+ *minimum_height += rev_min_height;
+ *natural_height += rev_nat_height;
+
+ g_debug ("%p: Revealer preferred height: minimum = %d\tnatural = %d",
+ self, rev_min_height, rev_nat_height);
+ g_debug ("%p: Adjusted preferred height: minimum = %d\tnatural = %d",
+ self, *minimum_height, *natural_height);
+ }
+}
+
+
static void
phosh_quick_settings_box_get_preferred_width (GtkWidget *widget, int *minimum_width,
int *natural_width)
@@ -316,7 +386,9 @@ phosh_quick_settings_box_get_preferred_width (GtkWidget *widget, int *minimum_wi
if (self->shown_child != NULL) {
int rev_min_width = 0;
int rev_nat_width = 0;
- gtk_widget_get_preferred_width (GTK_WIDGET (self->revealer), &rev_min_width, &rev_nat_width);
+ gtk_widget_measure (GTK_WIDGET (self->revealer),
+ GTK_ORIENTATION_HORIZONTAL, -1,
+ &rev_min_width, &rev_nat_width, NULL, NULL);
*minimum_width = MAX (*minimum_width, rev_min_width);
*natural_width = MAX (*natural_width, rev_nat_width);
@@ -328,6 +400,68 @@ phosh_quick_settings_box_get_preferred_width (GtkWidget *widget, int *minimum_wi
}
+static void
+phosh_quick_settings_box_get_preferred_width_for_height (GtkWidget *widget, int height,
+ int *minimum_width, int *natural_width)
+{
+ PhoshQuickSettingsBox *self = PHOSH_QUICK_SETTINGS_BOX (widget);
+ int len = 0;
+ int child_width;
+ int child_height;
+ int cols;
+ int rows;
+
+ g_debug ("%p: Querying preferred width for height = %d", self, height);
+
+ for (int i = 0; i < self->children->len; i++)
+ if (gtk_widget_get_visible (g_ptr_array_index (self->children, i)))
+ len += 1;
+
+ if (len == 0) {
+ g_debug ("%p: No visible children so preferred width is 0", self);
+ *natural_width = 0;
+ *minimum_width = 0;
+ return;
+ }
+
+ g_debug ("%p: Configuration: children = %d/%d\tcolumns = %d\tspacing = %d",
+ self, len, self->children->len, self->max_columns, self->spacing);
+
+ child_width = compute_child_width (self);
+ child_height = compute_child_height (self);
+ rows = (int) floor ((float) (height + self->spacing) / (child_height + self->spacing));
+ cols = (int) ceil ((float) len / rows);
+ cols = MIN (cols, self->max_columns);
+ rows = (int) ceil ((float) len / cols);
+
+ g_debug ("%p: Computed children values: width = %d\theight = %d\tcols = %d\trows = %d",
+ self, child_width, child_height, cols, rows);
+
+ g_return_if_fail (cols > 0 && rows > 0);
+
+ *minimum_width = cols * (child_width + self->spacing) - self->spacing;
+ *natural_width = *minimum_width;
+
+ g_debug ("%p: Computed preferred width: minimum = %d\tnatural = %d",
+ self, *minimum_width, *natural_width);
+
+ if (self->shown_child != NULL) {
+ int rev_min_width = 0;
+ int rev_nat_width = 0;
+ gtk_widget_measure (GTK_WIDGET (self->revealer),
+ GTK_ORIENTATION_HORIZONTAL, height,
+ &rev_min_width, &rev_nat_width, NULL, NULL);
+ *minimum_width = MAX (rev_min_width, *minimum_width);
+ *natural_width = MAX (rev_nat_width, *natural_width);
+
+ g_debug ("%p: Revealer preferred width: minimum = %d\tnatural = %d",
+ self, rev_min_width, rev_nat_width);
+ g_debug ("%p: Adjusted preferred width: minimum = %d\tnatural = %d",
+ self, *minimum_width, *natural_width);
+ }
+}
+
+
static void
phosh_quick_settings_box_get_preferred_height_for_width (GtkWidget *widget, int width,
int *minimum_height, int *natural_height)
@@ -375,8 +509,9 @@ phosh_quick_settings_box_get_preferred_height_for_width (GtkWidget *widget, int
if (self->shown_child != NULL) {
int rev_min_height = 0;
int rev_nat_height = 0;
- gtk_widget_get_preferred_height_for_width (GTK_WIDGET (self->revealer), width, &rev_min_height,
- &rev_nat_height);
+ gtk_widget_measure (GTK_WIDGET (self->revealer),
+ GTK_ORIENTATION_VERTICAL, width,
+ &rev_min_height, &rev_nat_height, NULL, NULL);
*minimum_height += rev_min_height;
*natural_height += rev_nat_height;
@@ -388,6 +523,24 @@ phosh_quick_settings_box_get_preferred_height_for_width (GtkWidget *widget, int
}
+static void
+phosh_quick_settings_box_measure (GtkWidget *widget,
+ GtkOrientation orientation, int for_size,
+ int* minimum, int* natural,
+ int* minimum_baseline, int* natural_baseline)
+{
+ if (orientation == GTK_ORIENTATION_HORIZONTAL && for_size == -1)
+ phosh_quick_settings_box_get_preferred_width (widget, minimum, natural);
+ else if (orientation == GTK_ORIENTATION_HORIZONTAL && for_size != -1)
+ phosh_quick_settings_box_get_preferred_width_for_height (widget, for_size, minimum, natural);
+ else if (orientation == GTK_ORIENTATION_VERTICAL && for_size == -1)
+ phosh_quick_settings_box_get_preferred_height (widget, minimum, natural);
+ else if (orientation == GTK_ORIENTATION_VERTICAL && for_size != -1)
+ phosh_quick_settings_box_get_preferred_height_for_width (widget, for_size, minimum, natural);
+ else
+ g_assert_not_reached ();
+}
+
static void
allocate_children (PhoshQuickSettingsBox *self,
int x, int y, int width, int height,
@@ -405,7 +558,7 @@ allocate_children (PhoshQuickSettingsBox *self,
if (self->shown_child == NULL) {
rect.width = 0;
rect.height = 0;
- gtk_widget_size_allocate (GTK_WIDGET (self->revealer), &rect);
+ gtk_widget_size_allocate (GTK_WIDGET (self->revealer), &rect, 0);
}
rect.width = width;
@@ -417,7 +570,7 @@ allocate_children (PhoshQuickSettingsBox *self,
PhoshQuickSetting *child = g_ptr_array_index (self->children, i);
i += 1;
if (gtk_widget_get_visible (GTK_WIDGET (child))) {
- gtk_widget_size_allocate (GTK_WIDGET (child), &rect);
+ gtk_widget_size_allocate (GTK_WIDGET (child), &rect, 0);
if (self->shown_child == child)
show_at_this_row = TRUE;
break;
@@ -435,7 +588,7 @@ allocate_children (PhoshQuickSettingsBox *self,
rect.x = x;
rect.height = revealer_height;
rect.width = revealer_width;
- gtk_widget_size_allocate (GTK_WIDGET (self->revealer), &rect);
+ gtk_widget_size_allocate (GTK_WIDGET (self->revealer), &rect, 0);
rect.x = ltr ? x : x + (cols - 1) * (width + self->spacing);
rect.height = height;
rect.width = width;
@@ -447,9 +600,10 @@ allocate_children (PhoshQuickSettingsBox *self,
static void
-phosh_quick_settings_box_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
+phosh_quick_settings_box_size_allocate (GtkWidget *widget, int width, int height, int baseline)
{
PhoshQuickSettingsBox *self = PHOSH_QUICK_SETTINGS_BOX (widget);
+ GtkAllocation allocation = {0, 0, width, height};
int len = 0;
int child_width;
int child_height;
@@ -463,24 +617,25 @@ phosh_quick_settings_box_size_allocate (GtkWidget *widget, GtkAllocation *alloca
g_debug ("%p: Doing size allocation", self);
- GTK_WIDGET_CLASS (phosh_quick_settings_box_parent_class)->size_allocate (widget, allocation);
-
for (int i = 0; i < self->children->len; i++)
if (gtk_widget_get_visible (g_ptr_array_index (self->children, i)))
len += 1;
if (len == 0) {
g_debug ("%p: Exiting allocation as there are no visible children", self);
+ allocation.width = 0;
+ allocation.height = 0;
+ gtk_widget_size_allocate (GTK_WIDGET (self->revealer), &allocation, 0);
return;
}
g_debug ("%p: Allocation: x = %d\ty = %d\twidth = %d\theight = %d",
- self, allocation->x, allocation->y, allocation->width, allocation->height);
+ self, allocation.x, allocation.y, allocation.width, allocation.height);
if (self->shown_child) {
- gtk_widget_get_preferred_height_for_width (GTK_WIDGET (self->revealer),
- allocation->width, NULL,
- &revealer_height);
+ gtk_widget_measure (GTK_WIDGET (self->revealer),
+ GTK_ORIENTATION_VERTICAL, allocation.width,
+ NULL, &revealer_height, NULL, NULL);
} else {
revealer_height = 0;
}
@@ -492,9 +647,9 @@ phosh_quick_settings_box_size_allocate (GtkWidget *widget, GtkAllocation *alloca
"child height = %d",
self, revealer_width, revealer_height, child_width, child_height);
- g_return_if_fail (allocation->width >= child_width && allocation->height >= child_height);
+ g_return_if_fail (allocation.width >= child_width && allocation.height >= child_height);
- cols = (int) floor ((float) (allocation->width + self->spacing) / (child_width + self->spacing));
+ cols = (int) floor ((float) (allocation.width + self->spacing) / (child_width + self->spacing));
cols = MIN (cols, self->max_columns);
rows = (int) ceil ((float) len / cols);
g_debug ("%p: cols = %d\trows = %d", self, cols, rows);
@@ -502,21 +657,21 @@ phosh_quick_settings_box_size_allocate (GtkWidget *widget, GtkAllocation *alloca
total_width = cols * (child_width + self->spacing) - self->spacing;
total_height = rows * (child_height + self->spacing) - self->spacing;
- if (total_width <= allocation->width && total_height <= allocation->height) {
- extra_space = allocation->width - total_width;
+ if (total_width <= allocation.width && total_height <= allocation.height) {
+ extra_space = allocation.width - total_width;
child_width += extra_space / cols;
- revealer_width = allocation->width;
+ revealer_width = allocation.width;
- extra_space = allocation->height - total_height;
+ extra_space = allocation.height - total_height;
revealer_height = MIN (extra_space, revealer_height);
- extra_space = allocation->height - total_height - revealer_height;
+ extra_space = allocation.height - total_height - revealer_height;
child_height += extra_space / rows;
} else {
cols = 1;
rows = len;
- child_width = allocation->width;
- child_height = (allocation->height - revealer_height + self->spacing) / rows - self->spacing;
- revealer_width = allocation->width;
+ child_width = allocation.width;
+ child_height = (allocation.height - revealer_height + self->spacing) / rows - self->spacing;
+ revealer_width = allocation.width;
}
g_return_if_fail (child_width >= 0 && child_height >= 0);
@@ -526,7 +681,7 @@ phosh_quick_settings_box_size_allocate (GtkWidget *widget, GtkAllocation *alloca
self, revealer_width, revealer_height, child_width, child_height);
allocate_children (self,
- allocation->x, allocation->y, child_width, child_height,
+ allocation.x, allocation.y, child_width, child_height,
cols, rows,
revealer_width, revealer_height);
}
@@ -534,8 +689,7 @@ phosh_quick_settings_box_size_allocate (GtkWidget *widget, GtkAllocation *alloca
static void
hide_status_page (PhoshQuickSettingsBox *self)
{
- PhoshStatusPage *status_page = phosh_quick_setting_get_status_page (self->shown_child);
- gtk_container_remove (GTK_CONTAINER (self->revealer), GTK_WIDGET (status_page));
+ gtk_revealer_set_child (self->revealer, NULL);
phosh_quick_setting_set_showing_status (self->shown_child, FALSE);
self->shown_child = NULL;
}
@@ -545,7 +699,7 @@ static void
show_status_page (PhoshQuickSettingsBox *self)
{
PhoshStatusPage *status_page = phosh_quick_setting_get_status_page (self->shown_child);
- gtk_container_add (GTK_CONTAINER (self->revealer), GTK_WIDGET (status_page));
+ gtk_revealer_set_child (self->revealer, GTK_WIDGET (status_page));
phosh_quick_setting_set_showing_status (self->shown_child, TRUE);
gtk_revealer_set_reveal_child (self->revealer, TRUE);
}
@@ -604,15 +758,14 @@ on_status_page_changed (PhoshQuickSettingsBox *self, GParamSpec *pspec, PhoshQui
gtk_widget_set_margin_bottom (GTK_WIDGET (status_page), self->spacing);
if (child == self->shown_child) {
- GtkWidget *existing_status = gtk_bin_get_child (GTK_BIN (self->revealer));
- gtk_container_remove (GTK_CONTAINER (self->revealer), existing_status);
+ gtk_revealer_set_child (self->revealer, NULL);
if (status_page == NULL) {
phosh_quick_setting_set_showing_status (self->shown_child, FALSE);
self->shown_child = NULL;
gtk_revealer_set_reveal_child (self->revealer, FALSE);
} else {
- gtk_container_add (GTK_CONTAINER (self->revealer), GTK_WIDGET (status_page));
+ gtk_revealer_set_child (self->revealer, GTK_WIDGET (status_page));
}
} else if (child == self->to_show_child && status_page == NULL) {
self->to_show_child = NULL;
@@ -656,60 +809,20 @@ on_visible_changed (PhoshQuickSettingsBox *self, GParamSpec *pspec, PhoshQuickSe
}
-static void
-container_add (GtkContainer *container, GtkWidget *widget)
-{
- phosh_quick_settings_box_add (PHOSH_QUICK_SETTINGS_BOX (container),
- PHOSH_QUICK_SETTING (widget));
-}
-
-
-static void
-container_remove (GtkContainer *container, GtkWidget *widget)
-{
- phosh_quick_settings_box_remove (PHOSH_QUICK_SETTINGS_BOX (container),
- PHOSH_QUICK_SETTING (widget));
-}
-
-
-static void
-phosh_quick_settings_box_forall (GtkContainer *container, gboolean include_internals,
- GtkCallback callback, gpointer data)
-{
- PhoshQuickSettingsBox *self = PHOSH_QUICK_SETTINGS_BOX (container);
-
- if (self->children != NULL) {
- g_autoptr (GPtrArray) children = g_ptr_array_copy (self->children, NULL, NULL);
-
- for (int i = 0; i < children->len; i++)
- callback (g_ptr_array_index (children, i), data);
- }
-
- if (include_internals)
- callback (GTK_WIDGET (self->revealer), data);
-}
-
-
static void
phosh_quick_settings_box_class_init (PhoshQuickSettingsBoxClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
object_class->set_property = phosh_quick_settings_box_set_property;
object_class->get_property = phosh_quick_settings_box_get_property;
+ object_class->dispose = phosh_quick_settings_box_dispose;
- widget_class->destroy = phosh_quick_settings_box_destroy;
widget_class->get_request_mode = phosh_quick_settings_box_get_request_mode;
- widget_class->get_preferred_width = phosh_quick_settings_box_get_preferred_width;
- widget_class->get_preferred_height_for_width = phosh_quick_settings_box_get_preferred_height_for_width;
+ widget_class->measure = phosh_quick_settings_box_measure;
widget_class->size_allocate = phosh_quick_settings_box_size_allocate;
- container_class->add = container_add;
- container_class->remove = container_remove;
- container_class->forall = phosh_quick_settings_box_forall;
-
/**
* PhoshQuickSettingsBox:columns:
*
@@ -758,11 +871,36 @@ phosh_quick_settings_box_init (PhoshQuickSettingsBox *self)
self->children = g_ptr_array_new ();
gtk_widget_init_template (GTK_WIDGET (self));
- gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
gtk_widget_set_parent (GTK_WIDGET (self->revealer), GTK_WIDGET (self));
}
+static GtkBuildableIface *parent_buildable_iface;
+
+static void
+phosh_quick_settings_box_buildable_add_child (GtkBuildable *buildable,
+ GtkBuilder *builder,
+ GObject *child,
+ const char *type)
+{
+ PhoshQuickSettingsBox *self = PHOSH_QUICK_SETTINGS_BOX (buildable);
+
+ if (PHOSH_IS_QUICK_SETTING (child))
+ phosh_quick_settings_box_add (self, PHOSH_QUICK_SETTING (child));
+ else
+ parent_buildable_iface->add_child (buildable, builder, child, type);
+}
+
+
+static void
+phosh_quick_settings_box_buildable_iface_init (GtkBuildableIface *iface)
+{
+ parent_buildable_iface = g_type_interface_peek_parent (iface);
+
+ iface->add_child = phosh_quick_settings_box_buildable_add_child;
+}
+
+
GtkWidget *
phosh_quick_settings_box_new (guint max_columns, guint spacing)
{
diff --git a/phosh/src/quick-settings-box.h b/phosh/src/quick-settings-box.h
index 3c60064fb..8b55dc82a 100644
--- a/phosh/src/quick-settings-box.h
+++ b/phosh/src/quick-settings-box.h
@@ -12,7 +12,7 @@
G_BEGIN_DECLS
#define PHOSH_TYPE_QUICK_SETTINGS_BOX phosh_quick_settings_box_get_type ()
-G_DECLARE_FINAL_TYPE (PhoshQuickSettingsBox, phosh_quick_settings_box, PHOSH, QUICK_SETTINGS_BOX, GtkContainer)
+G_DECLARE_FINAL_TYPE (PhoshQuickSettingsBox, phosh_quick_settings_box, PHOSH, QUICK_SETTINGS_BOX, GtkWidget)
GtkWidget *phosh_quick_settings_box_new (guint max_columns, guint spacing);
void phosh_quick_settings_box_set_max_columns (PhoshQuickSettingsBox *self, guint max_columns);
diff --git a/phosh/src/quick-settings.c b/phosh/src/quick-settings.c
index 1d69dfdce..b24f8ce94 100644
--- a/phosh/src/quick-settings.c
+++ b/phosh/src/quick-settings.c
@@ -36,7 +36,7 @@
*/
struct _PhoshQuickSettings {
- GtkBin parent;
+ GtkWidget parent;
PhoshQuickSettingsBox *box;
@@ -45,7 +45,7 @@ struct _PhoshQuickSettings {
GPtrArray *custom_quick_settings;
};
-G_DEFINE_TYPE (PhoshQuickSettings, phosh_quick_settings, GTK_TYPE_BIN);
+G_DEFINE_TYPE (PhoshQuickSettings, phosh_quick_settings, GTK_TYPE_WIDGET);
static void
@@ -96,13 +96,9 @@ on_bt_clicked (PhoshQuickSettings *self, PhoshQuickSetting *child)
static void
on_battery_clicked (PhoshQuickSettings *self, PhoshQuickSetting *child)
{
- GActionGroup *group;
-
- group = gtk_widget_get_action_group (GTK_WIDGET (self), "settings");
- g_return_if_fail (group);
- g_action_group_activate_action (group,
- "launch-panel",
- g_variant_new ("(s@av)", "power", g_variant_new ("av", NULL)));
+ gtk_widget_activate_action_variant (GTK_WIDGET (self),
+ "settings.launch-panel",
+ g_variant_new_string ("power"));
}
@@ -261,6 +257,8 @@ phosh_quick_settings_dispose (GObject *object)
self->custom_quick_settings = NULL;
}
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_QUICK_SETTINGS);
+
G_OBJECT_CLASS (phosh_quick_settings_parent_class)->dispose (object);
}
@@ -295,6 +293,8 @@ phosh_quick_settings_class_init (PhoshQuickSettingsClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_torch_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_docked_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_vpn_clicked);
+
+ gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
}
diff --git a/phosh/src/quick-settings.h b/phosh/src/quick-settings.h
index ef279b8d9..c64ba2530 100644
--- a/phosh/src/quick-settings.h
+++ b/phosh/src/quick-settings.h
@@ -11,7 +11,7 @@
G_BEGIN_DECLS
#define PHOSH_TYPE_QUICK_SETTINGS phosh_quick_settings_get_type ()
-G_DECLARE_FINAL_TYPE (PhoshQuickSettings, phosh_quick_settings, PHOSH, QUICK_SETTINGS, GtkBin)
+G_DECLARE_FINAL_TYPE (PhoshQuickSettings, phosh_quick_settings, PHOSH, QUICK_SETTINGS, GtkWidget)
GtkWidget *phosh_quick_settings_new (void);
void phosh_quick_settings_hide_status (PhoshQuickSettings *self);
diff --git a/phosh/src/revealer.c b/phosh/src/revealer.c
index dd1328072..da4bae2e5 100644
--- a/phosh/src/revealer.c
+++ b/phosh/src/revealer.c
@@ -36,7 +36,7 @@ enum {
static GParamSpec *props[PROP_LAST_PROP];
struct _PhoshRevealer {
- GtkBin parent;
+ GtkWidget parent;
GtkRevealer *revealer;
GtkWidget *child;
@@ -44,7 +44,7 @@ struct _PhoshRevealer {
guint transition_duration;
GtkRevealerTransitionType transition_type;
};
-G_DEFINE_TYPE (PhoshRevealer, phosh_revealer, GTK_TYPE_BIN)
+G_DEFINE_TYPE (PhoshRevealer, phosh_revealer, GTK_TYPE_WIDGET)
static void
@@ -120,13 +120,15 @@ phosh_revealer_get_property (GObject *object,
static void
-phosh_revealer_destroy (GtkWidget *widget)
+phosh_revealer_dispose (GObject *object)
{
- PhoshRevealer *self = PHOSH_REVEALER (widget);
+ PhoshRevealer *self = PHOSH_REVEALER (object);
phosh_revealer_set_child (self, NULL);
- GTK_WIDGET_CLASS (phosh_revealer_parent_class)->destroy (widget);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_REVEALER);
+
+ G_OBJECT_CLASS (phosh_revealer_parent_class)->dispose (object);
}
@@ -138,7 +140,7 @@ phosh_revealer_class_init (PhoshRevealerClass *klass)
object_class->set_property = phosh_revealer_set_property;
object_class->get_property = phosh_revealer_get_property;
- widget_class->destroy = phosh_revealer_destroy;
+ object_class->dispose = phosh_revealer_dispose;
/**
* PhoshRevealer:child:
@@ -186,6 +188,8 @@ phosh_revealer_class_init (PhoshRevealerClass *klass)
gtk_widget_class_bind_template_child (widget_class, PhoshRevealer, revealer);
gtk_widget_class_bind_template_callback (widget_class, on_child_revealed_changed);
+
+ gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
}
@@ -238,12 +242,12 @@ phosh_revealer_set_child (PhoshRevealer *self, GtkWidget *child)
return;
if (self->child)
- gtk_container_remove (GTK_CONTAINER (self->revealer), self->child);
+ gtk_revealer_set_child (self->revealer, self->child);
self->child = child;
if (self->child)
- gtk_container_add (GTK_CONTAINER (self->revealer), self->child);
+ gtk_revealer_set_child (self->revealer, self->child);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_CHILD]);
}
diff --git a/phosh/src/revealer.h b/phosh/src/revealer.h
index e88df1a8f..778c13849 100644
--- a/phosh/src/revealer.h
+++ b/phosh/src/revealer.h
@@ -12,7 +12,7 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_REVEALER (phosh_revealer_get_type ())
-G_DECLARE_FINAL_TYPE (PhoshRevealer, phosh_revealer, PHOSH, REVEALER, GtkBin)
+G_DECLARE_FINAL_TYPE (PhoshRevealer, phosh_revealer, PHOSH, REVEALER, GtkWidget)
PhoshRevealer * phosh_revealer_new (void);
GtkWidget * phosh_revealer_get_child (PhoshRevealer *self);
diff --git a/phosh/src/run-command-dialog.c b/phosh/src/run-command-dialog.c
index 033fac893..ab2ed9a5c 100644
--- a/phosh/src/run-command-dialog.c
+++ b/phosh/src/run-command-dialog.c
@@ -37,7 +37,7 @@ G_DEFINE_TYPE (PhoshRunCommandDialog, phosh_run_command_dialog, PHOSH_TYPE_SYSTE
static void
on_activated (PhoshRunCommandDialog *self, GtkEntry *entry)
{
- const char *command = gtk_entry_get_text (entry);
+ const char *command = gtk_editable_get_text (GTK_EDITABLE (entry));
g_signal_emit (self, signals[SUBMITTED], 0, command);
}
@@ -49,6 +49,14 @@ on_run_command_dialog_canceled (PhoshRunCommandDialog *self)
g_signal_emit (self, signals[CANCELLED], 0);
}
+static void
+phosh_run_command_dialog_dispose (GObject *obj)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (obj), PHOSH_TYPE_RUN_COMMAND_DIALOG);
+
+ G_OBJECT_CLASS (phosh_run_command_dialog_parent_class)->dispose (obj);
+}
+
static void
phosh_run_command_dialog_finalize (GObject *obj)
{
@@ -76,6 +84,7 @@ phosh_run_command_dialog_class_init (PhoshRunCommandDialogClass *klass)
GObjectClass *object_class = (GObjectClass *)klass;
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = phosh_run_command_dialog_dispose;
object_class->finalize = phosh_run_command_dialog_finalize;
/**
diff --git a/phosh/src/screenshot-manager.c b/phosh/src/screenshot-manager.c
index f5b72f007..d5af8269b 100644
--- a/phosh/src/screenshot-manager.c
+++ b/phosh/src/screenshot-manager.c
@@ -394,15 +394,17 @@ on_opaque_timeout (gpointer data)
{
PhoshScreenshotManager *self = data;
GdkDisplay *display = gdk_display_get_default ();
- GtkClipboard *clipboard;
+ GdkClipboard *clipboard;
+ g_autoptr (GdkTexture) texture = NULL;
if (!display) {
g_critical ("Couldn't get GDK display");
goto out;
}
- clipboard = gtk_clipboard_get_for_display (display, GDK_SELECTION_CLIPBOARD);
- gtk_clipboard_set_image (clipboard, self->for_clipboard);
+ clipboard = gdk_display_get_primary_clipboard (display);
+ texture = gdk_texture_new_for_pixbuf (self->for_clipboard);
+ gdk_clipboard_set_texture (clipboard, texture);
g_debug ("Updated clipboard");
self->frames->copy_to_clipboard = FALSE;
screenshot_done (self, TRUE);
diff --git a/phosh/src/session-manager.c b/phosh/src/session-manager.c
index d1c2ae1c7..804bdd911 100644
--- a/phosh/src/session-manager.c
+++ b/phosh/src/session-manager.c
@@ -244,7 +244,8 @@ on_end_session (PhoshSessionManager *self,
static void
on_stop (PhoshSessionManager *self, PhoshDBusSessionManagerClientPrivate *object)
{
- gtk_main_quit ();
+ // FIXME Port to GTK 4
+ // gtk_main_quit ();
}
diff --git a/phosh/src/settings.c b/phosh/src/settings.c
index 7c856fd6a..ed28f9790 100644
--- a/phosh/src/settings.c
+++ b/phosh/src/settings.c
@@ -48,7 +48,7 @@ enum {
static guint signals[N_SIGNALS] = { 0 };
typedef struct _PhoshSettings {
- GtkBin parent;
+ GtkWidget parent;
gboolean on_lockscreen;
gint drag_handle_offset;
@@ -76,7 +76,7 @@ typedef struct _PhoshSettings {
} PhoshSettings;
-G_DEFINE_TYPE (PhoshSettings, phosh_settings, GTK_TYPE_BIN)
+G_DEFINE_TYPE (PhoshSettings, phosh_settings, GTK_TYPE_WIDGET)
static void
@@ -136,16 +136,17 @@ calc_drag_handle_offset (PhoshSettings *self)
{
int h = 0;
int box_height, sw_height, qs_height = 0;
+ graphene_point_t origin = {0, 0}, qs_origin;
int qs_y = 0;
gboolean success;
- h = gtk_widget_get_allocated_height (GTK_WIDGET (self));
+ h = gtk_widget_get_height (GTK_WIDGET (self));
/* On the lock screen the whole surface is fine */
if (self->on_lockscreen)
goto out;
- box_height = gtk_widget_get_allocated_height (self->box_settings);
- sw_height = gtk_widget_get_allocated_height (self->scrolled_window);
+ box_height = gtk_widget_get_height (self->box_settings);
+ sw_height = gtk_widget_get_height (self->scrolled_window);
if (box_height > sw_height) {
h = 0; /* Don't enlarge drag handle if box needs scrolling */
goto out;
@@ -153,15 +154,16 @@ calc_drag_handle_offset (PhoshSettings *self)
g_debug ("Calculating drag offset: on quick-settings");
- success = gtk_widget_translate_coordinates (self->quick_settings, GTK_WIDGET (self),
- 0, 0, NULL, &qs_y);
+ success = gtk_widget_compute_point (self->quick_settings, GTK_WIDGET (self),
+ &origin, &qs_origin);
if (!success) {
g_warning ("Calculating drag offset: Unable to get quick-setting's y coordinate");
goto out;
}
- qs_height = gtk_widget_get_allocated_height (self->quick_settings);
+ qs_y = qs_origin.y;
+ qs_height = gtk_widget_get_height (self->quick_settings);
h = qs_y + qs_height;
g_debug ("Calculating drag offset: QS_y = %d, QS_height = %d, height = %d",
@@ -262,7 +264,7 @@ create_notification_row (gpointer item, gpointer data)
phosh_notification_frame_set_animate_show (PHOSH_NOTIFICATION_FRAME (frame), FALSE);
gtk_widget_set_visible (frame, TRUE);
- gtk_container_add (GTK_CONTAINER (row), frame);
+ gtk_list_box_row_set_child (GTK_LIST_BOX_ROW (row), frame);
return row;
}
@@ -388,6 +390,8 @@ phosh_settings_dispose (GObject *object)
g_clear_object (&self->torch_manager);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_SETTINGS);
+
G_OBJECT_CLASS (phosh_settings_parent_class)->dispose (object);
}
@@ -468,6 +472,8 @@ phosh_settings_class_init (PhoshSettingsClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_notifications_clear_all_clicked);
gtk_widget_class_bind_template_callback (widget_class, on_torch_scale_value_changed);
gtk_widget_class_bind_template_callback (widget_class, update_drag_handle_offset);
+
+ gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
}
@@ -476,7 +482,8 @@ phosh_settings_init (PhoshSettings *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
- g_signal_connect (self, "size-allocate", G_CALLBACK (on_size_allocate), NULL);
+ g_signal_connect (self, "notify::default-width", G_CALLBACK (on_size_allocate), NULL);
+ g_signal_connect (self, "notify::default-height", G_CALLBACK (on_size_allocate), NULL);
}
diff --git a/phosh/src/settings.h b/phosh/src/settings.h
index 8c6ede28e..09db4f465 100644
--- a/phosh/src/settings.h
+++ b/phosh/src/settings.h
@@ -11,7 +11,7 @@
#define PHOSH_TYPE_SETTINGS (phosh_settings_get_type())
-G_DECLARE_FINAL_TYPE (PhoshSettings, phosh_settings, PHOSH, SETTINGS, GtkBin)
+G_DECLARE_FINAL_TYPE (PhoshSettings, phosh_settings, PHOSH, SETTINGS, GtkWidget)
GtkWidget * phosh_settings_new (void);
gint phosh_settings_get_drag_handle_offset (PhoshSettings *self);
diff --git a/phosh/src/settings/audio-device-row.c b/phosh/src/settings/audio-device-row.c
index c3b7fa887..eaa443d80 100644
--- a/phosh/src/settings/audio-device-row.c
+++ b/phosh/src/settings/audio-device-row.c
@@ -10,7 +10,7 @@
#include "phosh-config.h"
-#include "audio/audio-device.h"
+#include "audio-device.h"
#include "audio-device-row.h"
/**
@@ -123,6 +123,8 @@ phosh_audio_device_row_dispose (GObject *object)
g_clear_object (&self->audio_device);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_AUDIO_DEVICE_ROW);
+
G_OBJECT_CLASS (phosh_audio_device_row_parent_class)->dispose (object);
}
diff --git a/phosh/src/settings/audio-device-row.h b/phosh/src/settings/audio-device-row.h
index e8aa04ad3..63ee96752 100644
--- a/phosh/src/settings/audio-device-row.h
+++ b/phosh/src/settings/audio-device-row.h
@@ -6,7 +6,7 @@
#pragma once
-#include "audio/audio-device.h"
+#include "audio-device.h"
#include
diff --git a/phosh/src/audio/audio-device.c b/phosh/src/settings/audio-device.c
similarity index 100%
rename from phosh/src/audio/audio-device.c
rename to phosh/src/settings/audio-device.c
diff --git a/phosh/src/audio/audio-device.h b/phosh/src/settings/audio-device.h
similarity index 100%
rename from phosh/src/audio/audio-device.h
rename to phosh/src/settings/audio-device.h
diff --git a/phosh/src/audio/audio-devices.c b/phosh/src/settings/audio-devices.c
similarity index 99%
rename from phosh/src/audio/audio-devices.c
rename to phosh/src/settings/audio-devices.c
index 48fec6471..a1c51340e 100644
--- a/phosh/src/audio/audio-devices.c
+++ b/phosh/src/settings/audio-devices.c
@@ -334,7 +334,7 @@ phosh_audio_devices_init (PhoshAudioDevices *self)
* input or output devices as a list model.
*/
PhoshAudioDevices *
-phosh_audio_devices_new (GvcMixerControl *mixer_control, gboolean is_input)
+phosh_audio_devices_new (gpointer mixer_control, gboolean is_input)
{
return g_object_new (PHOSH_TYPE_AUDIO_DEVICES,
"mixer-control", mixer_control,
diff --git a/phosh/src/audio/audio-devices.h b/phosh/src/settings/audio-devices.h
similarity index 78%
rename from phosh/src/audio/audio-devices.h
rename to phosh/src/settings/audio-devices.h
index 8427f72e2..20b2c5d90 100644
--- a/phosh/src/audio/audio-devices.h
+++ b/phosh/src/settings/audio-devices.h
@@ -16,7 +16,7 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (PhoshAudioDevices, phosh_audio_devices, PHOSH, AUDIO_DEVICES, GObject)
-PhoshAudioDevices *phosh_audio_devices_new (GvcMixerControl *mixer_control,
- gboolean is_input);
+PhoshAudioDevices *phosh_audio_devices_new (gpointer mixer_control,
+ gboolean is_input);
G_END_DECLS
diff --git a/phosh/src/settings/audio-settings.c b/phosh/src/settings/audio-settings.c
index 37f7a898e..9d3ce67a4 100644
--- a/phosh/src/settings/audio-settings.c
+++ b/phosh/src/settings/audio-settings.c
@@ -12,14 +12,15 @@
#include
-#include "audio/audio-device.h"
-#include "audio-manager.h"
#include "fading-label.h"
#include "settings/audio-device-row.h"
+#include "settings/audio-device.h"
+#include "settings/audio-devices.h"
#include "settings/audio-settings.h"
-#include "settings/channel-bar.h"
+#include "settings/gvc-channel-bar.h"
#include "util.h"
+#include "gvc-mixer-control.h"
#include "gvc-mixer-stream.h"
#include
@@ -42,14 +43,16 @@ enum {
static GParamSpec *props[PROP_LAST_PROP];
struct _PhoshAudioSettings {
- GtkBin parent;
+ GtkWidget parent;
+
+ GvcMixerControl *mixer_control;
/* Volume slider */
GvcMixerStream *output_stream;
gboolean allow_volume_above_100_percent;
gboolean setting_volume;
gboolean is_headphone;
- PhoshChannelBar *output_vol_bar;
+ GtkWidget *output_vol_bar;
/* Device select */
GtkWidget *stack_audio_details;
@@ -58,10 +61,10 @@ struct _PhoshAudioSettings {
GtkWidget *box_audio_output_devices;
GtkWidget *listbox_audio_input_devices;
GtkWidget *listbox_audio_output_devices;
-
- PhoshAudioManager *audio_manager;
+ PhoshAudioDevices *audio_input_devices;
+ PhoshAudioDevices *audio_output_devices;
};
-G_DEFINE_TYPE (PhoshAudioSettings, phosh_audio_settings, GTK_TYPE_BIN)
+G_DEFINE_TYPE (PhoshAudioSettings, phosh_audio_settings, GTK_TYPE_WIDGET)
static void
@@ -70,12 +73,12 @@ update_output_vol_bar (PhoshAudioSettings *self)
GtkAdjustment *adj;
self->setting_volume = TRUE;
- phosh_channel_bar_set_base_volume (self->output_vol_bar,
- gvc_mixer_stream_get_base_volume (self->output_stream));
- phosh_channel_bar_set_is_amplified (self->output_vol_bar,
- self->allow_volume_above_100_percent &&
- gvc_mixer_stream_get_can_decibel (self->output_stream));
- adj = phosh_channel_bar_get_adjustment (self->output_vol_bar);
+ gvc_channel_bar_set_base_volume (GVC_CHANNEL_BAR (self->output_vol_bar),
+ gvc_mixer_stream_get_base_volume (self->output_stream));
+ gvc_channel_bar_set_is_amplified (GVC_CHANNEL_BAR (self->output_vol_bar),
+ self->allow_volume_above_100_percent &&
+ gvc_mixer_stream_get_can_decibel (self->output_stream));
+ adj = GTK_ADJUSTMENT (gvc_channel_bar_get_adjustment (GVC_CHANNEL_BAR (self->output_vol_bar)));
g_debug ("Adjusting volume to %d", gvc_mixer_stream_get_volume (self->output_stream));
gtk_adjustment_set_value (adj, gvc_mixer_stream_get_volume (self->output_stream));
self->setting_volume = FALSE;
@@ -90,7 +93,7 @@ output_stream_notify_is_muted_cb (GvcMixerStream *stream, GParamSpec *pspec, gpo
muted = gvc_mixer_stream_get_is_muted (stream);
if (!self->setting_volume) {
- phosh_channel_bar_set_is_muted (self->output_vol_bar, muted);
+ gvc_channel_bar_set_is_muted (GVC_CHANNEL_BAR (self->output_vol_bar), muted);
if (!muted)
update_output_vol_bar (self);
}
@@ -139,9 +142,7 @@ on_output_stream_port_changed (GvcMixerStream *stream, GParamSpec *pspec, gpoint
const char *icon = NULL;
gboolean is_headphone = FALSE;
const GvcMixerStreamPort *port;
- GvcMixerControl *mixer_control;
- mixer_control = phosh_audio_manager_get_mixer_control (self->audio_manager);
port = gvc_mixer_stream_get_port (stream);
if (port)
g_debug ("Port changed: %s (%s)", port->human_port ?: port->port, port->port);
@@ -152,7 +153,7 @@ on_output_stream_port_changed (GvcMixerStream *stream, GParamSpec *pspec, gpoint
} else {
GvcMixerUIDevice *output;
- output = gvc_mixer_control_lookup_device_from_stream (mixer_control, stream);
+ output = gvc_mixer_control_lookup_device_from_stream (self->mixer_control, stream);
if (output)
icon = gvc_mixer_ui_device_get_icon_name (output);
}
@@ -160,7 +161,7 @@ on_output_stream_port_changed (GvcMixerStream *stream, GParamSpec *pspec, gpoint
if (gm_str_is_null_or_empty (icon) || g_str_has_prefix (icon, "audio-card"))
icon = "audio-speakers";
- phosh_channel_bar_set_icon_name (self->output_vol_bar, icon);
+ gvc_channel_bar_set_icon_name (GVC_CHANNEL_BAR (self->output_vol_bar), icon);
if (is_headphone == self->is_headphone)
return;
@@ -182,7 +183,7 @@ mixer_control_output_update_cb (GvcMixerControl *mixer, guint id, gpointer data)
if (self->output_stream)
g_signal_handlers_disconnect_by_data (self->output_stream, self);
- g_set_object (&self->output_stream, phosh_audio_manager_get_default_sink (self->audio_manager));
+ g_set_object (&self->output_stream, gvc_mixer_control_get_default_sink (self->mixer_control));
g_return_if_fail (self->output_stream);
g_signal_connect_object (self->output_stream,
@@ -206,15 +207,15 @@ mixer_control_output_update_cb (GvcMixerControl *mixer, guint id, gpointer data)
static void
-vol_bar_value_changed_cb (PhoshChannelBar *bar, PhoshAudioSettings *self)
+vol_bar_value_changed_cb (GvcChannelBar *bar, PhoshAudioSettings *self)
{
double volume, rounded;
g_autofree char *name = NULL;
if (!self->output_stream)
- self->output_stream = g_object_ref (phosh_audio_manager_get_default_sink (self->audio_manager));
+ self->output_stream = g_object_ref (gvc_mixer_control_get_default_sink (self->mixer_control));
- volume = phosh_channel_bar_get_volume (bar);
+ volume = gvc_channel_bar_get_volume (bar);
rounded = round (volume);
g_object_get (self->output_vol_bar, "name", &name, NULL);
@@ -234,12 +235,13 @@ on_audio_input_device_row_activated (PhoshAudioSettings *self,
GtkListBox *list)
{
PhoshAudioDevice *audio_device = phosh_audio_device_row_get_audio_device (row);
+ GvcMixerUIDevice *device;
guint id;
g_return_if_fail (PHOSH_IS_AUDIO_DEVICE (audio_device));
id = phosh_audio_device_get_id (audio_device);
-
- phosh_audio_manager_change_input (self->audio_manager, id);
+ device = gvc_mixer_control_lookup_input_id (self->mixer_control, id);
+ gvc_mixer_control_change_input (self->mixer_control, device);
}
@@ -249,12 +251,13 @@ on_audio_output_device_row_activated (PhoshAudioSettings *self,
GtkListBox *list)
{
PhoshAudioDevice *audio_device = phosh_audio_device_row_get_audio_device (row);
+ GvcMixerUIDevice *device;
guint id;
g_return_if_fail (PHOSH_IS_AUDIO_DEVICE (audio_device));
id = phosh_audio_device_get_id (audio_device);
-
- phosh_audio_manager_change_output (self->audio_manager, id);
+ device = gvc_mixer_control_lookup_output_id (self->mixer_control, id);
+ gvc_mixer_control_change_output (self->mixer_control, device);
}
@@ -292,11 +295,26 @@ phosh_audio_settings_dispose (GObject *object)
PhoshAudioSettings *self = PHOSH_AUDIO_SETTINGS (object);
g_clear_object (&self->output_stream);
+ g_clear_object (&self->audio_output_devices);
+ g_clear_object (&self->audio_input_devices);
+
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_AUDIO_SETTINGS);
G_OBJECT_CLASS (phosh_audio_settings_parent_class)->dispose (object);
}
+static void
+phosh_audio_settings_finalize (GObject *object)
+{
+ PhoshAudioSettings *self = PHOSH_AUDIO_SETTINGS (object);
+
+ g_clear_object (&self->mixer_control);
+
+ G_OBJECT_CLASS (phosh_audio_settings_parent_class)->finalize (object);
+}
+
+
static void
phosh_audio_settings_class_init (PhoshAudioSettingsClass *klass)
{
@@ -305,6 +323,7 @@ phosh_audio_settings_class_init (PhoshAudioSettingsClass *klass)
object_class->get_property = phosh_audio_settings_get_property;
object_class->dispose = phosh_audio_settings_dispose;
+ object_class->finalize = phosh_audio_settings_finalize;
/**
* PhoshAudioSettings:is-headphone:
@@ -318,7 +337,7 @@ phosh_audio_settings_class_init (PhoshAudioSettingsClass *klass)
g_object_class_install_properties (object_class, PROP_LAST_PROP, props);
- g_type_ensure (PHOSH_TYPE_CHANNEL_BAR);
+ g_type_ensure (GVC_TYPE_CHANNEL_BAR);
g_type_ensure (PHOSH_TYPE_FADING_LABEL);
gtk_widget_class_set_template_from_resource (widget_class, "/mobi/phosh/ui/audio-settings.ui");
@@ -334,6 +353,8 @@ phosh_audio_settings_class_init (PhoshAudioSettingsClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_audio_output_device_row_activated);
gtk_widget_class_set_css_name (widget_class, "phosh-audio-settings");
+
+ gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
}
@@ -354,23 +375,17 @@ transform_toggle_stack_child_name (GBinding *binding,
static void
phosh_audio_settings_init (PhoshAudioSettings *self)
{
- PhoshAudioDevices *input_devices, *output_devices;
- GvcMixerControl *mixer_control;
-
- self->audio_manager = g_object_ref (phosh_audio_manager_get_default ());
-
gtk_widget_init_template (GTK_WIDGET (self));
- mixer_control = phosh_audio_manager_get_mixer_control (self->audio_manager);
- if (mixer_control)
- g_return_if_fail (mixer_control);
+ self->mixer_control = gvc_mixer_control_new (_("Phone Shell Volume Control"));
+ g_return_if_fail (self->mixer_control);
/* Volume slider */
- g_signal_connect_object (mixer_control,
- "active-output-update",
- G_CALLBACK (mixer_control_output_update_cb),
- self,
- G_CONNECT_DEFAULT);
+ gvc_mixer_control_open (self->mixer_control);
+ g_signal_connect (self->mixer_control,
+ "active-output-update",
+ G_CALLBACK (mixer_control_output_update_cb),
+ self);
g_signal_connect (self->output_vol_bar,
"value-changed",
G_CALLBACK (vol_bar_value_changed_cb),
@@ -384,23 +399,23 @@ phosh_audio_settings_init (PhoshAudioSettings *self)
NULL, NULL, NULL);
/* Audio device selection */
- output_devices = phosh_audio_manager_get_output_devices (self->audio_manager);
+ self->audio_output_devices = phosh_audio_devices_new (self->mixer_control, FALSE);
gtk_list_box_bind_model (GTK_LIST_BOX (self->listbox_audio_output_devices),
- G_LIST_MODEL (output_devices),
+ G_LIST_MODEL (self->audio_output_devices),
create_audio_device_row,
self,
NULL);
- g_object_bind_property (output_devices, "has-devices",
+ g_object_bind_property (self->audio_output_devices, "has-devices",
self->box_audio_output_devices, "visible",
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
- input_devices = phosh_audio_manager_get_input_devices (self->audio_manager);
+ self->audio_input_devices = phosh_audio_devices_new (self->mixer_control, TRUE);
gtk_list_box_bind_model (GTK_LIST_BOX (self->listbox_audio_input_devices),
- G_LIST_MODEL (input_devices),
+ G_LIST_MODEL (self->audio_input_devices),
create_audio_device_row,
self,
NULL);
- g_object_bind_property (input_devices, "has-devices",
+ g_object_bind_property (self->audio_input_devices, "has-devices",
self->box_audio_input_devices, "visible",
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
}
diff --git a/phosh/src/settings/audio-settings.h b/phosh/src/settings/audio-settings.h
index 431db99a7..03d719c9b 100644
--- a/phosh/src/settings/audio-settings.h
+++ b/phosh/src/settings/audio-settings.h
@@ -6,13 +6,13 @@
#pragma once
-#include
+#include
G_BEGIN_DECLS
#define PHOSH_TYPE_AUDIO_SETTINGS (phosh_audio_settings_get_type ())
-G_DECLARE_FINAL_TYPE (PhoshAudioSettings, phosh_audio_settings, PHOSH, AUDIO_SETTINGS, GtkBin)
+G_DECLARE_FINAL_TYPE (PhoshAudioSettings, phosh_audio_settings, PHOSH, AUDIO_SETTINGS, GtkWidget)
PhoshAudioSettings *phosh_audio_settings_new (void);
gboolean phosh_audio_settings_get_output_is_headphone (PhoshAudioSettings *self);
diff --git a/phosh/src/settings/channel-bar.h b/phosh/src/settings/channel-bar.h
deleted file mode 100644
index c323e7e0f..000000000
--- a/phosh/src/settings/channel-bar.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2018 Purism SPC
- * 2025 Phosh.mobi e.V.
- *
- * SPDX-License-Identifier: GPL-3.0-or-later
- *
- * based on Phosh-channel-bar.h from g-c-c which is
- * Copyright (C) 2008 Red Hat, Inc.
- */
-
-#pragma once
-
-#include
-
-G_BEGIN_DECLS
-
-#define PHOSH_TYPE_CHANNEL_BAR (phosh_channel_bar_get_type ())
-G_DECLARE_FINAL_TYPE (PhoshChannelBar, phosh_channel_bar, PHOSH, CHANNEL_BAR, GtkBox)
-
-GtkWidget * phosh_channel_bar_new (void);
-
-void phosh_channel_bar_set_name (PhoshChannelBar *bar, const char *name);
-void phosh_channel_bar_set_icon_name (PhoshChannelBar *bar, const char *icon_name);
-void phosh_channel_bar_set_low_icon_name (PhoshChannelBar *bar, const char *icon_name);
-void phosh_channel_bar_set_high_icon_name (PhoshChannelBar *bar, const char *icon_name);
-
-void phosh_channel_bar_set_orientation (PhoshChannelBar *bar,
- GtkOrientation orientation);
-GtkOrientation phosh_channel_bar_get_orientation (PhoshChannelBar *bar);
-
-GtkAdjustment *phosh_channel_bar_get_adjustment (PhoshChannelBar *bar);
-
-gboolean phosh_channel_bar_get_is_muted (PhoshChannelBar *bar);
-void phosh_channel_bar_set_is_muted (PhoshChannelBar *bar, gboolean is_muted);
-gboolean phosh_channel_bar_get_show_mute (PhoshChannelBar *bar);
-void phosh_channel_bar_set_show_mute (PhoshChannelBar *bar, gboolean show_mute);
-void phosh_channel_bar_set_size_group (PhoshChannelBar *bar, GtkSizeGroup *group);
-void phosh_channel_bar_set_is_amplified (PhoshChannelBar *bar, gboolean amplified);
-void phosh_channel_bar_set_base_volume (PhoshChannelBar *bar, guint32 base_volume);
-gboolean phosh_channel_bar_get_ellipsize (PhoshChannelBar *bar);
-void phosh_channel_bar_set_ellipsize (PhoshChannelBar *bar, gboolean ellipsized);
-
-double phosh_channel_bar_get_volume (PhoshChannelBar *self);
-
-G_END_DECLS
diff --git a/phosh/src/settings/channel-bar.c b/phosh/src/settings/gvc-channel-bar.c
similarity index 62%
rename from phosh/src/settings/channel-bar.c
rename to phosh/src/settings/gvc-channel-bar.c
index bf875036e..4fa783bbc 100644
--- a/phosh/src/settings/channel-bar.c
+++ b/phosh/src/settings/gvc-channel-bar.c
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2018 Purism SPC
- * 2025 Phosh.mobi e.V.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
@@ -10,19 +9,22 @@
* Copyright (C) 2008 Red Hat, Inc.
*/
-#define G_LOG_DOMAIN "phosh-channel-bar"
+#define G_LOG_DOMAIN "phosh-settings-volctrl"
#include "phosh-config.h"
-#include "channel-bar.h"
+#include "gvc-channel-bar.h"
#include
#include
#include
+#define SCALE_SIZE 128
#define ADJUSTMENT_MAX_NORMAL PA_VOLUME_NORM
#define ADJUSTMENT_MAX_AMPLIFIED PA_VOLUME_UI_MAX
#define ADJUSTMENT_MAX (self->is_amplified ? ADJUSTMENT_MAX_AMPLIFIED : ADJUSTMENT_MAX_NORMAL)
+#define SCROLLSTEP (ADJUSTMENT_MAX / 100.0 * 5.0)
+
enum
{
@@ -42,7 +44,8 @@ enum {
static guint signals[N_SIGNALS] = { 0 };
-struct _PhoshChannelBar {
+struct _GvcChannelBar
+{
GtkBox parent_instance;
GtkWidget *scale_box;
@@ -57,17 +60,17 @@ struct _PhoshChannelBar {
guint32 base_volume;
};
-G_DEFINE_TYPE (PhoshChannelBar, phosh_channel_bar, GTK_TYPE_BOX)
+G_DEFINE_TYPE (GvcChannelBar, gvc_channel_bar, GTK_TYPE_BOX)
static void
-update_image (PhoshChannelBar *self)
+update_image (GvcChannelBar *self)
{
g_autoptr (GIcon) gicon = NULL;
if (self->icon_name) {
- gicon = g_themed_icon_new_with_default_fallbacks (self->icon_name);
- gtk_image_set_from_gicon (GTK_IMAGE (self->image), gicon, -1);
+ gicon = g_themed_icon_new_with_default_fallbacks (self->icon_name);
+ gtk_image_set_from_gicon (GTK_IMAGE (self->image), gicon);
}
gtk_widget_set_visible (self->image, self->icon_name != NULL);
@@ -75,9 +78,10 @@ update_image (PhoshChannelBar *self)
void
-phosh_channel_bar_set_size_group (PhoshChannelBar *self, GtkSizeGroup *group)
+gvc_channel_bar_set_size_group (GvcChannelBar *self,
+ GtkSizeGroup *group)
{
- g_return_if_fail (PHOSH_IS_CHANNEL_BAR (self));
+ g_return_if_fail (GVC_IS_CHANNEL_BAR (self));
self->size_group = group;
@@ -89,9 +93,10 @@ phosh_channel_bar_set_size_group (PhoshChannelBar *self, GtkSizeGroup *group)
void
-phosh_channel_bar_set_icon_name (PhoshChannelBar *self, const char *name)
+gvc_channel_bar_set_icon_name (GvcChannelBar *self,
+ const char *name)
{
- g_return_if_fail (PHOSH_IS_CHANNEL_BAR (self));
+ g_return_if_fail (GVC_IS_CHANNEL_BAR (self));
if (g_strcmp0 (self->icon_name, name) == 0)
return;
@@ -104,18 +109,20 @@ phosh_channel_bar_set_icon_name (PhoshChannelBar *self, const char *name)
GtkAdjustment *
-phosh_channel_bar_get_adjustment (PhoshChannelBar *self)
+gvc_channel_bar_get_adjustment (GvcChannelBar *self)
{
- g_return_val_if_fail (PHOSH_IS_CHANNEL_BAR (self), NULL);
+ g_return_val_if_fail (GVC_IS_CHANNEL_BAR (self), NULL);
return self->adjustment;
}
static gboolean
-on_scale_button_press_event (GtkWidget *widget,
- GdkEventButton *event,
- PhoshChannelBar *self)
+on_scale_button_press_event (GtkWidget *widget,
+ int n_press,
+ double x,
+ double y,
+ GvcChannelBar *self)
{
self->click_lock = TRUE;
@@ -124,9 +131,11 @@ on_scale_button_press_event (GtkWidget *widget,
static gboolean
-on_scale_button_release_event (GtkWidget *widget,
- GdkEventButton *event,
- PhoshChannelBar *self)
+on_scale_button_release_event (GtkWidget *widget,
+ int n_press,
+ double x,
+ double y,
+ GvcChannelBar *self)
{
double value;
@@ -135,14 +144,14 @@ on_scale_button_release_event (GtkWidget *widget,
/* this means the adjustment moved away from zero and
* therefore we should unmute and set the volume. */
- phosh_channel_bar_set_is_muted (self, ((int)value == (int)0.0));
+ gvc_channel_bar_set_is_muted (self, ((int)value == (int)0.0));
return FALSE;
}
static void
-on_adjustment_value_changed (GtkAdjustment *adjustment, PhoshChannelBar *self)
+on_adjustment_value_changed (GtkAdjustment *adjustment, GvcChannelBar *self)
{
if (!self->is_muted || self->click_lock)
g_signal_emit (self, signals[VALUE_CHANGED], 0);
@@ -150,9 +159,10 @@ on_adjustment_value_changed (GtkAdjustment *adjustment, PhoshChannelBar *self)
void
-phosh_channel_bar_set_is_muted (PhoshChannelBar *self, gboolean is_muted)
+gvc_channel_bar_set_is_muted (GvcChannelBar *self,
+ gboolean is_muted)
{
- g_return_if_fail (PHOSH_IS_CHANNEL_BAR (self));
+ g_return_if_fail (GVC_IS_CHANNEL_BAR (self));
if (is_muted == self->is_muted)
return;
@@ -168,17 +178,17 @@ phosh_channel_bar_set_is_muted (PhoshChannelBar *self, gboolean is_muted)
gboolean
-phosh_channel_bar_get_is_muted (PhoshChannelBar *self)
+gvc_channel_bar_get_is_muted (GvcChannelBar *self)
{
- g_return_val_if_fail (PHOSH_IS_CHANNEL_BAR (self), FALSE);
+ g_return_val_if_fail (GVC_IS_CHANNEL_BAR (self), FALSE);
return self->is_muted;
}
void
-phosh_channel_bar_set_is_amplified (PhoshChannelBar *self, gboolean amplified)
+gvc_channel_bar_set_is_amplified (GvcChannelBar *self, gboolean amplified)
{
- g_return_if_fail (PHOSH_IS_CHANNEL_BAR (self));
+ g_return_if_fail (GVC_IS_CHANNEL_BAR (self));
if (self->is_amplified == amplified)
return;
@@ -216,9 +226,10 @@ phosh_channel_bar_set_is_amplified (PhoshChannelBar *self, gboolean amplified)
void
-phosh_channel_bar_set_base_volume (PhoshChannelBar *self, pa_volume_t base_volume)
+gvc_channel_bar_set_base_volume (GvcChannelBar *self,
+ pa_volume_t base_volume)
{
- g_return_if_fail (PHOSH_IS_CHANNEL_BAR (self));
+ g_return_if_fail (GVC_IS_CHANNEL_BAR (self));
if (base_volume == 0) {
self->base_volume = ADJUSTMENT_MAX_NORMAL;
@@ -231,22 +242,22 @@ phosh_channel_bar_set_base_volume (PhoshChannelBar *self, pa_volume_t base_volum
static void
-phosh_channel_bar_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+gvc_channel_bar_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- PhoshChannelBar *self = PHOSH_CHANNEL_BAR (object);
+ GvcChannelBar *self = GVC_CHANNEL_BAR (object);
switch (prop_id) {
case PROP_IS_MUTED:
- phosh_channel_bar_set_is_muted (self, g_value_get_boolean (value));
+ gvc_channel_bar_set_is_muted (self, g_value_get_boolean (value));
break;
case PROP_ICON_NAME:
- phosh_channel_bar_set_icon_name (self, g_value_get_string (value));
+ gvc_channel_bar_set_icon_name (self, g_value_get_string (value));
break;
case PROP_IS_AMPLIFIED:
- phosh_channel_bar_set_is_amplified (self, g_value_get_boolean (value));
+ gvc_channel_bar_set_is_amplified (self, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -256,12 +267,12 @@ phosh_channel_bar_set_property (GObject *object,
static void
-phosh_channel_bar_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+gvc_channel_bar_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
- PhoshChannelBar *self = PHOSH_CHANNEL_BAR (object);
+ GvcChannelBar *self = GVC_CHANNEL_BAR (object);
switch (prop_id) {
case PROP_IS_MUTED:
@@ -281,28 +292,38 @@ phosh_channel_bar_get_property (GObject *object,
static void
-phosh_channel_bar_finalize (GObject *object)
+gvc_channel_bar_dispose (GObject *object)
{
- PhoshChannelBar *self = PHOSH_CHANNEL_BAR (object);
+ gtk_widget_dispose_template (GTK_WIDGET (object), GVC_TYPE_CHANNEL_BAR);
+
+ G_OBJECT_CLASS (gvc_channel_bar_parent_class)->finalize (object);
+}
+
+
+static void
+gvc_channel_bar_finalize (GObject *object)
+{
+ GvcChannelBar *self = GVC_CHANNEL_BAR (object);
g_free (self->icon_name);
- G_OBJECT_CLASS (phosh_channel_bar_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gvc_channel_bar_parent_class)->finalize (object);
}
static void
-phosh_channel_bar_class_init (PhoshChannelBarClass *klass)
+gvc_channel_bar_class_init (GvcChannelBarClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->finalize = phosh_channel_bar_finalize;
- object_class->set_property = phosh_channel_bar_set_property;
- object_class->get_property = phosh_channel_bar_get_property;
+ object_class->dispose = gvc_channel_bar_dispose;
+ object_class->finalize = gvc_channel_bar_finalize;
+ object_class->set_property = gvc_channel_bar_set_property;
+ object_class->get_property = gvc_channel_bar_get_property;
/**
- * PhoshChannelBar:is-muted:
+ * GvcChannelBar:is-muted:
*
* Whether the stream is muted
*/
@@ -312,7 +333,7 @@ phosh_channel_bar_class_init (PhoshChannelBarClass *klass)
G_PARAM_EXPLICIT_NOTIFY |
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT);
/**
- * PhoshChannelBar:icon-name:
+ * GvcChannelBar:icon-name:
*
* The name of icon to display for this stream
*/
@@ -322,7 +343,7 @@ phosh_channel_bar_class_init (PhoshChannelBarClass *klass)
G_PARAM_EXPLICIT_NOTIFY |
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT);
/**
- * PhoshChannelBar:is-amplified:
+ * GvcChannelBar:is-amplified:
*
* Whether the stream is digitally amplified
*/
@@ -341,21 +362,21 @@ phosh_channel_bar_class_init (PhoshChannelBarClass *klass)
G_TYPE_NONE,
0);
- gtk_widget_class_set_template_from_resource (widget_class, "/mobi/phosh/ui/channel-bar.ui");
- gtk_widget_class_bind_template_child (widget_class, PhoshChannelBar, adjustment);
- gtk_widget_class_bind_template_child (widget_class, PhoshChannelBar, scale_box);
- gtk_widget_class_bind_template_child (widget_class, PhoshChannelBar, image);
- gtk_widget_class_bind_template_child (widget_class, PhoshChannelBar, scale);
+ gtk_widget_class_set_template_from_resource (widget_class, "/mobi/phosh/ui/gvc-channel-bar.ui");
+ gtk_widget_class_bind_template_child (widget_class, GvcChannelBar, adjustment);
+ gtk_widget_class_bind_template_child (widget_class, GvcChannelBar, scale_box);
+ gtk_widget_class_bind_template_child (widget_class, GvcChannelBar, image);
+ gtk_widget_class_bind_template_child (widget_class, GvcChannelBar, scale);
gtk_widget_class_bind_template_callback (widget_class, on_adjustment_value_changed);
gtk_widget_class_bind_template_callback (widget_class, on_scale_button_press_event);
gtk_widget_class_bind_template_callback (widget_class, on_scale_button_release_event);
- gtk_widget_class_set_css_name (widget_class, "phosh-channel-bar");
+ gtk_widget_class_set_css_name (widget_class, "phosh-gvc-channel-bar");
}
static void
-phosh_channel_bar_init (PhoshChannelBar *self)
+gvc_channel_bar_init (GvcChannelBar *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
@@ -363,24 +384,22 @@ phosh_channel_bar_init (PhoshChannelBar *self)
gtk_adjustment_set_upper (self->adjustment, ADJUSTMENT_MAX_NORMAL);
gtk_adjustment_set_step_increment (self->adjustment, ADJUSTMENT_MAX_NORMAL / 100.0);
gtk_adjustment_set_page_increment (self->adjustment, ADJUSTMENT_MAX_NORMAL / 10.0);
-
- gtk_widget_add_events (self->scale, GDK_SCROLL_MASK);
}
GtkWidget *
-phosh_channel_bar_new (void)
+gvc_channel_bar_new (void)
{
- return g_object_new (PHOSH_TYPE_CHANNEL_BAR,
+ return g_object_new (GVC_TYPE_CHANNEL_BAR,
"icon-name", "audio-speakers-symbolic",
NULL);
}
double
-phosh_channel_bar_get_volume (PhoshChannelBar *self)
+gvc_channel_bar_get_volume (GvcChannelBar *self)
{
- g_return_val_if_fail (PHOSH_IS_CHANNEL_BAR (self), 0.0);
+ g_return_val_if_fail (GVC_IS_CHANNEL_BAR (self), 0.0);
return gtk_adjustment_get_value (self->adjustment);
}
diff --git a/phosh/src/settings/gvc-channel-bar.h b/phosh/src/settings/gvc-channel-bar.h
new file mode 100644
index 000000000..8750cbf23
--- /dev/null
+++ b/phosh/src/settings/gvc-channel-bar.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2018 Purism SPC
+ *
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ *
+ * based on gvc-channel-bar.h from g-c-c which is
+ * Copyright (C) 2008 Red Hat, Inc.
+ */
+
+#pragma once
+
+#include
+
+G_BEGIN_DECLS
+
+#define GVC_TYPE_CHANNEL_BAR (gvc_channel_bar_get_type ())
+G_DECLARE_FINAL_TYPE (GvcChannelBar, gvc_channel_bar, GVC, CHANNEL_BAR, GtkBox)
+
+GtkWidget * gvc_channel_bar_new (void);
+
+void gvc_channel_bar_set_name (GvcChannelBar *bar,
+ const char *name);
+void gvc_channel_bar_set_icon_name (GvcChannelBar *bar,
+ const char *icon_name);
+void gvc_channel_bar_set_low_icon_name (GvcChannelBar *bar,
+ const char *icon_name);
+void gvc_channel_bar_set_high_icon_name (GvcChannelBar *bar,
+ const char *icon_name);
+
+void gvc_channel_bar_set_orientation (GvcChannelBar *bar,
+ GtkOrientation orientation);
+GtkOrientation gvc_channel_bar_get_orientation (GvcChannelBar *bar);
+
+GtkAdjustment * gvc_channel_bar_get_adjustment (GvcChannelBar *bar);
+
+gboolean gvc_channel_bar_get_is_muted (GvcChannelBar *bar);
+void gvc_channel_bar_set_is_muted (GvcChannelBar *bar,
+ gboolean is_muted);
+gboolean gvc_channel_bar_get_show_mute (GvcChannelBar *bar);
+void gvc_channel_bar_set_show_mute (GvcChannelBar *bar,
+ gboolean show_mute);
+void gvc_channel_bar_set_size_group (GvcChannelBar *bar,
+ GtkSizeGroup *group);
+void gvc_channel_bar_set_is_amplified (GvcChannelBar *bar,
+ gboolean amplified);
+void gvc_channel_bar_set_base_volume (GvcChannelBar *bar,
+ guint32 base_volume);
+gboolean gvc_channel_bar_get_ellipsize (GvcChannelBar *bar);
+void gvc_channel_bar_set_ellipsize (GvcChannelBar *bar,
+ gboolean ellipsized);
+
+double gvc_channel_bar_get_volume (GvcChannelBar *self);
+
+G_END_DECLS
diff --git a/phosh/src/settings/meson.build b/phosh/src/settings/meson.build
index c12d4d3f8..c7e67dcad 100644
--- a/phosh/src/settings/meson.build
+++ b/phosh/src/settings/meson.build
@@ -1,7 +1,14 @@
-phosh_settings_widgets_headers = files('audio-device-row.h', 'audio-settings.h')
+phosh_settings_widgets_headers = files(
+ 'audio-device-row.h',
+ 'audio-device.h',
+ 'audio-devices.h',
+ 'audio-settings.h',
+)
phosh_settings_widgets_sources = files(
'audio-device-row.c',
+ 'audio-device.c',
+ 'audio-devices.c',
'audio-settings.c',
- 'channel-bar.c',
+ 'gvc-channel-bar.c',
)
diff --git a/phosh/src/shell-priv.h b/phosh/src/shell-priv.h
index 83d8d6152..3d7ca676c 100644
--- a/phosh/src/shell-priv.h
+++ b/phosh/src/shell-priv.h
@@ -26,7 +26,6 @@
#include "osk-manager.h"
#include "rotation-manager.h"
#include "screen-saver-manager.h"
-#include "splash-manager.h"
#include "style-manager.h"
#include "toplevel-manager.h"
#include "torch-manager.h"
@@ -93,7 +92,6 @@ PhoshFeedbackManager *phosh_shell_get_feedback_manager (PhoshShell *self);
PhoshGtkMountManager *phosh_shell_get_gtk_mount_manager (PhoshShell *self);
PhoshLayoutManager *phosh_shell_get_layout_manager (PhoshShell *self);
PhoshModeManager *phosh_shell_get_mode_manager (PhoshShell *self);
-PhoshSplashManager * phosh_shell_get_splash_manager (PhoshShell *self);
PhoshStyleManager *phosh_shell_get_style_manager (PhoshShell *self);
PhoshToplevelManager *phosh_shell_get_toplevel_manager (PhoshShell *self);
PhoshScreenSaverManager *phosh_shell_get_screen_saver_manager (PhoshShell *self);
diff --git a/phosh/src/shell.c b/phosh/src/shell.c
index e40be2040..177097e12 100644
--- a/phosh/src/shell.c
+++ b/phosh/src/shell.c
@@ -22,7 +22,6 @@
#include
#include
#include
-#include
#include "phosh-config.h"
#include "ambient.h"
@@ -417,11 +416,7 @@ panels_create (PhoshShell *self)
top_layer = priv->locked ? ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY : ZWLR_LAYER_SHELL_V1_LAYER_TOP;
/* Top panel */
- priv->top_panel = PHOSH_DRAG_SURFACE (phosh_top_panel_new (
- phosh_wayland_get_zwlr_layer_shell_v1 (wl),
- phosh_wayland_get_zphoc_layer_shell_effects_v1 (wl),
- monitor,
- top_layer));
+ priv->top_panel = PHOSH_DRAG_SURFACE (phosh_top_panel_new (monitor, top_layer));
gtk_widget_set_visible (GTK_WIDGET (priv->top_panel), TRUE);
/* Home is created after the top-panel so it honors its exclusive zone */
@@ -700,6 +695,17 @@ on_toplevel_added (PhoshShell *self, PhoshToplevel *unused, PhoshToplevelManager
}
+static void
+on_notification_banner_destroy (PhoshShell *self)
+{
+ PhoshShellPrivate *priv;
+
+ priv = phosh_shell_get_instance_private (self);
+
+ priv->notification_banner = NULL;
+}
+
+
static void
on_new_notification (PhoshShell *self,
PhoshNotification *notification,
@@ -719,11 +725,10 @@ on_new_notification (PhoshShell *self,
phosh_top_panel_get_state (PHOSH_TOP_PANEL (priv->top_panel)) == PHOSH_TOP_PANEL_STATE_FOLDED &&
!priv->locked) {
priv->notification_banner = phosh_notification_banner_new (notification);
- g_signal_connect (priv->notification_banner,
- "destroy",
- G_CALLBACK (gtk_widget_destroyed),
- &priv->notification_banner);
-
+ g_signal_connect_swapped (priv->notification_banner,
+ "destroy",
+ G_CALLBACK (on_notification_banner_destroy),
+ self);
gtk_widget_set_visible (GTK_WIDGET (priv->notification_banner), TRUE);
}
}
@@ -780,7 +785,7 @@ on_osd_timeout (PhoshShell *self)
g_debug ("Closing osd");
priv->osd_timeoutid = 0;
if (priv->osd)
- gtk_widget_destroy (GTK_WIDGET (priv->osd));
+ gtk_window_destroy (GTK_WINDOW (priv->osd));
}
priv->osd_continue = FALSE;
return ret;
@@ -835,8 +840,6 @@ setup_idle_cb (PhoshShell *self)
priv->debug_control = phosh_debug_control_new ();
priv->app_tracker = phosh_app_tracker_new ();
- phosh_toplevel_manager_set_app_tracker (priv->toplevel_manager, priv->app_tracker);
- priv->splash_manager = phosh_splash_manager_new (priv->app_tracker);
priv->session_manager = phosh_session_manager_new ();
priv->mode_manager = phosh_mode_manager_new ();
priv->wifi_manager = phosh_wifi_manager_new ();
@@ -906,6 +909,7 @@ setup_idle_cb (PhoshShell *self)
priv->gnome_shell_manager = phosh_gnome_shell_manager_get_default ();
priv->screenshot_manager = phosh_screenshot_manager_new ();
+ priv->splash_manager = phosh_splash_manager_new (priv->app_tracker);
priv->run_command_manager = phosh_run_command_manager_new ();
priv->network_auth_manager = phosh_network_auth_manager_new ();
priv->portal_access_manager = phosh_portal_access_manager_new ();
@@ -1159,7 +1163,7 @@ phosh_shell_constructed (GObject *object)
priv->idle_manager = phosh_idle_manager_get_default ();
- priv->faders = g_ptr_array_new_with_free_func ((GDestroyNotify) (gtk_widget_destroy));
+ priv->faders = g_ptr_array_new_with_free_func ((GDestroyNotify) (gtk_window_destroy));
phosh_system_prompter_register ();
priv->polkit_auth_agent = phosh_polkit_auth_agent_new ();
@@ -1456,7 +1460,9 @@ phosh_shell_init (PhoshShell *self)
}
cui_init (TRUE);
- gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (), "/mobi/phosh/icons");
+
+ gtk_icon_theme_add_resource_path (gtk_icon_theme_get_for_display (gdk_display_get_default ()),
+ "/mobi/phosh/icons");
priv->overview_visible = TRUE;
@@ -1961,26 +1967,6 @@ phosh_shell_get_session_manager (PhoshShell *self)
return priv->session_manager;
}
-/**
- * phosh_shell_get_splash_manager:
- * @self: The shell singleton
- *
- * Get the splash manager
- *
- * Returns: (transfer none): The splash manager
- */
-PhoshSplashManager *
-phosh_shell_get_splash_manager (PhoshShell *self)
-{
- PhoshShellPrivate *priv;
-
- g_return_val_if_fail (PHOSH_IS_SHELL (self), NULL);
- priv = phosh_shell_get_instance_private (self);
- g_return_val_if_fail (PHOSH_IS_SPLASH_MANAGER (priv->splash_manager), NULL);
-
- return priv->splash_manager;
-}
-
/**
* phosh_shell_get_wifi_manager:
* @self: The shell singleton
diff --git a/phosh/src/splash-manager.c b/phosh/src/splash-manager.c
index d14d008f5..b857215b5 100644
--- a/phosh/src/splash-manager.c
+++ b/phosh/src/splash-manager.c
@@ -272,47 +272,3 @@ phosh_splash_manager_new (PhoshAppTracker *app_tracker)
"app-tracker", app_tracker,
NULL));
}
-
-
-void
-phosh_splash_manager_lower_all (PhoshSplashManager *self)
-{
- GHashTableIter iter;
- gpointer key, value;
-
- g_return_if_fail (PHOSH_IS_SPLASH_MANAGER (self));
-
- g_hash_table_iter_init (&iter, self->splashes);
-
- while (g_hash_table_iter_next (&iter, &key, &value)) {
- PhoshSplash *splash = PHOSH_SPLASH (value);
-
- phosh_splash_lower (splash);
- }
-}
-
-
-void
-phosh_splash_manager_raise (PhoshSplashManager *self, const char *startup_id)
-{
- PhoshSplash *splash;
-
- g_return_if_fail (PHOSH_IS_SPLASH_MANAGER (self));
-
- splash = g_hash_table_lookup (self->splashes, startup_id);
- if (splash == NULL) {
- g_warning ("Invalid startup-id %s", startup_id);
- return;
- }
-
- phosh_splash_raise (splash);
-}
-
-
-gboolean
-phosh_splash_manager_get_prefer_dark (PhoshSplashManager *self)
-{
- g_return_val_if_fail (PHOSH_IS_SPLASH_MANAGER (self), FALSE);
-
- return self->prefer_dark;
-}
diff --git a/phosh/src/splash-manager.h b/phosh/src/splash-manager.h
index 424241af5..a70107dc3 100644
--- a/phosh/src/splash-manager.h
+++ b/phosh/src/splash-manager.h
@@ -17,8 +17,5 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (PhoshSplashManager, phosh_splash_manager, PHOSH, SPLASH_MANAGER, GObject)
PhoshSplashManager *phosh_splash_manager_new (PhoshAppTracker *app_tracker);
-void phosh_splash_manager_lower_all (PhoshSplashManager *self);
-void phosh_splash_manager_raise (PhoshSplashManager *self, const char *startup_id);
-gboolean phosh_splash_manager_get_prefer_dark (PhoshSplashManager *self);
G_END_DECLS
diff --git a/phosh/src/splash.c b/phosh/src/splash.c
index 1df7c6f83..5611dfaee 100644
--- a/phosh/src/splash.c
+++ b/phosh/src/splash.c
@@ -63,17 +63,15 @@ static void
set_style (PhoshSplash *self, gboolean prefer_dark)
{
PhoshSplashPrivate *priv = phosh_splash_get_instance_private (self);
- GtkStyleContext *context;
priv->prefer_dark = prefer_dark;
- context = gtk_widget_get_style_context (GTK_WIDGET (self));
if (prefer_dark) {
- gtk_style_context_add_class (context, "dark");
- gtk_style_context_remove_class (context, "light");
+ gtk_widget_add_css_class (GTK_WIDGET (self), "dark");
+ gtk_widget_remove_css_class (GTK_WIDGET (self), "light");
} else {
- gtk_style_context_add_class (context, "light");
- gtk_style_context_remove_class (context, "dark");
+ gtk_widget_add_css_class (GTK_WIDGET (self), "light");
+ gtk_widget_remove_css_class (GTK_WIDGET (self), "dark");
}
}
@@ -133,6 +131,8 @@ phosh_splash_dispose (GObject *obj)
g_clear_pointer (&priv->fadeout, phosh_animation_unref);
g_clear_object (&priv->info);
+ gtk_widget_dispose_template (GTK_WIDGET (obj), PHOSH_TYPE_SPLASH);
+
G_OBJECT_CLASS (phosh_splash_parent_class)->dispose (obj);
}
@@ -141,7 +141,6 @@ static void
phosh_splash_constructed (GObject *object)
{
PhoshSplash *self = PHOSH_SPLASH (object);
- PhoshWayland *wl = phosh_wayland_get_default ();
PhoshSplashPrivate *priv = phosh_splash_get_instance_private (self);
PhoshMonitor *monitor;
@@ -149,7 +148,6 @@ phosh_splash_constructed (GObject *object)
monitor = phosh_shell_get_primary_monitor (phosh_shell_get_default ());
g_object_set (PHOSH_LAYER_SURFACE (self),
- "layer-shell", phosh_wayland_get_zwlr_layer_shell_v1 (wl),
"wl-output", phosh_monitor_get_wl_output (monitor),
"anchor", (ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
@@ -166,13 +164,17 @@ phosh_splash_constructed (GObject *object)
static gboolean
-phosh_splash_key_press_event (GtkWidget *self, GdkEventKey *event)
+phosh_splash_key_press_event (GtkWidget *self,
+ guint keyval,
+ guint keycode,
+ GdkModifierType state,
+ GtkEventControllerKey *controller)
{
gboolean handled = FALSE;
g_return_val_if_fail (PHOSH_IS_SPLASH (self), FALSE);
- switch (event->keyval) {
+ switch (keyval) {
case GDK_KEY_Escape:
g_signal_emit (self, signals[CLOSED], 0);
handled = TRUE;
@@ -196,10 +198,9 @@ phosh_splash_show (GtkWidget *widget)
icon = g_app_info_get_icon (priv->info);
if (G_UNLIKELY (icon == NULL)) {
gtk_image_set_from_icon_name (GTK_IMAGE (priv->img_app),
- PHOSH_APP_UNKNOWN_ICON,
- -1);
+ PHOSH_APP_UNKNOWN_ICON);
} else {
- gtk_image_set_from_gicon (GTK_IMAGE (priv->img_app), icon, -1);
+ gtk_image_set_from_gicon (GTK_IMAGE (priv->img_app), icon);
}
GTK_WIDGET_CLASS (phosh_splash_parent_class)->show (widget);
@@ -217,7 +218,6 @@ phosh_splash_class_init (PhoshSplashClass *klass)
object_class->constructed = phosh_splash_constructed;
object_class->dispose = phosh_splash_dispose;
widget_class->show = phosh_splash_show;
- widget_class->key_press_event = phosh_splash_key_press_event;
/**
* PhoshSplash:app-info:
@@ -258,6 +258,8 @@ phosh_splash_class_init (PhoshSplashClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, PhoshSplash, img_app);
gtk_widget_class_bind_template_child_private (widget_class, PhoshSplash, box);
+ gtk_widget_class_bind_template_callback (widget_class, phosh_splash_key_press_event);
+
gtk_widget_class_set_css_name (widget_class, "phosh-splash");
}
@@ -296,7 +298,7 @@ fadeout_done_cb (gpointer data)
g_clear_pointer (&priv->fadeout, phosh_animation_unref);
- gtk_widget_destroy (GTK_WIDGET (self));
+ gtk_window_destroy (GTK_WINDOW (self));
}
@@ -318,25 +320,3 @@ phosh_splash_hide (PhoshSplash *self)
self);
phosh_animation_start (priv->fadeout);
}
-
-
-void
-phosh_splash_lower (PhoshSplash *self)
-{
- g_return_if_fail (PHOSH_IS_SPLASH (self));
-
- phosh_layer_surface_set_layer (PHOSH_LAYER_SURFACE (self),
- ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM);
- gtk_widget_queue_draw (GTK_WIDGET (self));
-}
-
-
-void
-phosh_splash_raise (PhoshSplash *self)
-{
- g_return_if_fail (PHOSH_IS_SPLASH (self));
-
- phosh_layer_surface_set_layer (PHOSH_LAYER_SURFACE (self),
- ZWLR_LAYER_SHELL_V1_LAYER_TOP);
- gtk_widget_queue_draw (GTK_WIDGET (self));
-}
diff --git a/phosh/src/splash.h b/phosh/src/splash.h
index 7c2509db5..59dc54a0c 100644
--- a/phosh/src/splash.h
+++ b/phosh/src/splash.h
@@ -25,6 +25,4 @@ struct _PhoshSplashClass {
GtkWidget *phosh_splash_new (GDesktopAppInfo *info, gboolean prefer_dark);
-void phosh_splash_hide (PhoshSplash *self);
-void phosh_splash_lower (PhoshSplash *self);
-void phosh_splash_raise (PhoshSplash *self);
+void phosh_splash_hide (PhoshSplash *self);
diff --git a/phosh/src/status-icon.c b/phosh/src/status-icon.c
index eb6802d8b..e4efc19ae 100644
--- a/phosh/src/status-icon.c
+++ b/phosh/src/status-icon.c
@@ -27,7 +27,6 @@
enum {
PHOSH_STATUS_ICON_PROP_0,
PHOSH_STATUS_ICON_PROP_ICON_NAME,
- PHOSH_STATUS_ICON_PROP_ICON_SIZE,
PHOSH_STATUS_ICON_PROP_PIXEL_SIZE,
PHOSH_STATUS_ICON_PROP_EXTRA_WIDGET,
PHOSH_STATUS_ICON_PROP_INFO,
@@ -39,14 +38,13 @@ typedef struct {
GtkBox *box;
GtkWidget *image;
GtkWidget *extra_widget;
- GtkIconSize icon_size;
guint pixel_size;
char *info;
guint idle_id;
} PhoshStatusIconPrivate;
-G_DEFINE_TYPE_WITH_PRIVATE (PhoshStatusIcon, phosh_status_icon, GTK_TYPE_BIN);
+G_DEFINE_TYPE_WITH_PRIVATE (PhoshStatusIcon, phosh_status_icon, GTK_TYPE_WIDGET);
static void
@@ -61,11 +59,6 @@ phosh_status_icon_set_property (GObject *object,
case PHOSH_STATUS_ICON_PROP_ICON_NAME:
phosh_status_icon_set_icon_name (self, g_value_get_string (value));
break;
- case PHOSH_STATUS_ICON_PROP_ICON_SIZE:
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- phosh_status_icon_set_icon_size (self, g_value_get_enum (value));
- G_GNUC_END_IGNORE_DEPRECATIONS
- break;
case PHOSH_STATUS_ICON_PROP_PIXEL_SIZE:
phosh_status_icon_set_pixel_size (self, g_value_get_uint (value));
break;
@@ -93,11 +86,6 @@ phosh_status_icon_get_property (GObject *object,
case PHOSH_STATUS_ICON_PROP_ICON_NAME:
g_value_take_string (value, phosh_status_icon_get_icon_name (self));
break;
- case PHOSH_STATUS_ICON_PROP_ICON_SIZE:
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- g_value_set_enum (value, phosh_status_icon_get_icon_size (self));
- G_GNUC_END_IGNORE_DEPRECATIONS
- break;
case PHOSH_STATUS_ICON_PROP_PIXEL_SIZE:
g_value_set_uint (value, phosh_status_icon_get_pixel_size (self));
break;
@@ -150,6 +138,9 @@ phosh_status_icon_dispose (GObject *object)
PhoshStatusIconPrivate *priv = phosh_status_icon_get_instance_private (self);
g_clear_handle_id (&priv->idle_id, g_source_remove);
+ phosh_status_icon_set_extra_widget (self, NULL);
+
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_STATUS_ICON);
G_OBJECT_CLASS (phosh_status_icon_parent_class)->dispose (object);
}
@@ -167,16 +158,6 @@ phosh_status_icon_finalize (GObject *gobject)
}
-static void
-phosh_status_icon_destroy (GtkWidget *widget)
-{
- PhoshStatusIcon *self = PHOSH_STATUS_ICON (widget);
-
- phosh_status_icon_set_extra_widget (self, NULL);
-
- GTK_WIDGET_CLASS (phosh_status_icon_parent_class)->destroy (widget);
-}
-
static void
phosh_status_icon_class_init (PhoshStatusIconClass *klass)
{
@@ -189,8 +170,6 @@ phosh_status_icon_class_init (PhoshStatusIconClass *klass)
object_class->dispose = phosh_status_icon_dispose;
object_class->finalize = phosh_status_icon_finalize;
- widget_class->destroy = phosh_status_icon_destroy;
-
gtk_widget_class_set_css_name (widget_class, "phosh-status-icon");
/**
@@ -202,16 +181,6 @@ phosh_status_icon_class_init (PhoshStatusIconClass *klass)
g_param_spec_string ("icon-name", "", "",
NULL,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
- /**
- * PhoshStatusIcon:icon-size:
- *
- * The size of the icon to display in the widget
- */
- props[PHOSH_STATUS_ICON_PROP_ICON_SIZE] =
- g_param_spec_enum ("icon-size", "", "",
- GTK_TYPE_ICON_SIZE,
- GTK_ICON_SIZE_LARGE_TOOLBAR,
- G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/**
* PhoshStatusIcon:pixel-size:
*
@@ -250,6 +219,8 @@ phosh_status_icon_class_init (PhoshStatusIconClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, PhoshStatusIcon, box);
gtk_widget_class_bind_template_child_private (widget_class, PhoshStatusIcon, image);
+
+ gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
}
@@ -260,7 +231,6 @@ phosh_status_icon_init (PhoshStatusIcon *self)
gtk_widget_init_template (GTK_WIDGET (self));
- priv->icon_size = GTK_ICON_SIZE_LARGE_TOOLBAR;
priv->pixel_size = 24;
}
@@ -286,7 +256,7 @@ phosh_status_icon_set_icon_name (PhoshStatusIcon *self, const char *icon_name)
if (!g_strcmp0 (old_icon_name, icon_name))
return;
- gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), icon_name, -1);
+ gtk_image_set_from_icon_name (GTK_IMAGE (priv->image), icon_name);
g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_STATUS_ICON_PROP_ICON_NAME]);
}
@@ -307,83 +277,6 @@ phosh_status_icon_get_icon_name (PhoshStatusIcon *self)
return icon_name;
}
-/**
- * phosh_status_icon_set_icon_size:
- * @self: The status-icon
- * @size: The size of icon
- *
- * Set the size of status-icon.
- *
- * Deprecated: 0.47: Use [method@Phosh.StatusIcon.set_pixel_size].
- */
-void
-phosh_status_icon_set_icon_size (PhoshStatusIcon *self, GtkIconSize size)
-{
- PhoshStatusIconPrivate *priv;
- guint pixel_size;
- g_return_if_fail (PHOSH_IS_STATUS_ICON (self));
-
- priv = phosh_status_icon_get_instance_private (self);
-
- if (priv->icon_size == size)
- return;
-
- priv->icon_size = size;
-
- switch (size) {
- case GTK_ICON_SIZE_INVALID:
- pixel_size = 0;
- break;
- case GTK_ICON_SIZE_MENU:
- pixel_size = 16;
- break;
- case GTK_ICON_SIZE_SMALL_TOOLBAR:
- pixel_size = 16;
- break;
- case GTK_ICON_SIZE_LARGE_TOOLBAR:
- pixel_size = 24;
- break;
- case GTK_ICON_SIZE_BUTTON:
- pixel_size = 16;
- break;
- case GTK_ICON_SIZE_DND:
- pixel_size = 32;
- break;
- case GTK_ICON_SIZE_DIALOG:
- pixel_size = 48;
- break;
- default:
- g_critical ("Unknown size %d", size);
- return;
- }
-
- phosh_status_icon_set_pixel_size (self, pixel_size);
-
- g_object_notify_by_pspec (G_OBJECT (self), props[PHOSH_STATUS_ICON_PROP_ICON_SIZE]);
-}
-
-/**
- * phosh_status_icon_get_icon_size:
- * @self: The status-icon
- *
- * Return the size of status-icon.
- *
- * Returns: The size of status-icon.
- *
- * Deprecated: 0.47: Use [method@Phosh.StatusIcon.get_pixel_size].
- */
-GtkIconSize
-phosh_status_icon_get_icon_size (PhoshStatusIcon *self)
-{
- PhoshStatusIconPrivate *priv;
-
- g_return_val_if_fail (PHOSH_IS_STATUS_ICON (self), 0);
-
- priv = phosh_status_icon_get_instance_private (self);
-
- return priv->icon_size;
-}
-
void
phosh_status_icon_set_pixel_size (PhoshStatusIcon *self, guint size)
@@ -428,10 +321,10 @@ phosh_status_icon_set_extra_widget (PhoshStatusIcon *self, GtkWidget *widget)
return;
if (priv->extra_widget != NULL)
- gtk_container_remove (GTK_CONTAINER (priv->box), priv->extra_widget);
+ gtk_box_remove (priv->box, priv->extra_widget);
if (widget != NULL)
- gtk_container_add (GTK_CONTAINER (priv->box), widget);
+ gtk_box_append (priv->box, widget);
priv->extra_widget = widget;
diff --git a/phosh/src/status-icon.h b/phosh/src/status-icon.h
index 9e7527745..4f5a87a16 100644
--- a/phosh/src/status-icon.h
+++ b/phosh/src/status-icon.h
@@ -12,7 +12,7 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_STATUS_ICON (phosh_status_icon_get_type())
-G_DECLARE_DERIVABLE_TYPE (PhoshStatusIcon, phosh_status_icon, PHOSH, STATUS_ICON, GtkBin)
+G_DECLARE_DERIVABLE_TYPE (PhoshStatusIcon, phosh_status_icon, PHOSH, STATUS_ICON, GtkWidget)
/**
* PhoshStatusIconClass:
@@ -20,7 +20,7 @@ G_DECLARE_DERIVABLE_TYPE (PhoshStatusIcon, phosh_status_icon, PHOSH, STATUS_ICON
* @idle_init: a callback to be invoked once on idle
*/
struct _PhoshStatusIconClass {
- GtkBinClass parent_class;
+ GtkWidgetClass parent_class;
void (*idle_init) (PhoshStatusIcon *self);
@@ -37,8 +37,6 @@ struct _PhoshStatusIconClass {
};
GtkWidget * phosh_status_icon_new (void);
-void phosh_status_icon_set_icon_size (PhoshStatusIcon *self, GtkIconSize size) G_GNUC_DEPRECATED_FOR (phosh_status_icon_set_pixel_size);
-GtkIconSize phosh_status_icon_get_icon_size (PhoshStatusIcon *self) G_GNUC_DEPRECATED_FOR (phosh_status_icon_get_pixel_size);
void phosh_status_icon_set_pixel_size (PhoshStatusIcon *self, guint size);
guint phosh_status_icon_get_pixel_size (PhoshStatusIcon *self);
void phosh_status_icon_set_icon_name (PhoshStatusIcon *self, const char *icon_name);
diff --git a/phosh/src/status-page-placeholder.c b/phosh/src/status-page-placeholder.c
index ee5511681..d2086cd66 100644
--- a/phosh/src/status-page-placeholder.c
+++ b/phosh/src/status-page-placeholder.c
@@ -36,7 +36,7 @@ enum {
static GParamSpec *props[PROP_LAST_PROP];
struct _PhoshStatusPagePlaceholder {
- GtkBin parent;
+ GtkWidget parent;
GtkBox *toplevel_box;
@@ -46,7 +46,7 @@ struct _PhoshStatusPagePlaceholder {
GtkWidget *extra_widget;
};
-G_DEFINE_TYPE (PhoshStatusPagePlaceholder, phosh_status_page_placeholder, GTK_TYPE_BIN)
+G_DEFINE_TYPE (PhoshStatusPagePlaceholder, phosh_status_page_placeholder, GTK_TYPE_WIDGET)
static void
@@ -114,19 +114,11 @@ phosh_status_page_placeholder_dispose (GObject *object)
PhoshStatusPagePlaceholder *self = PHOSH_STATUS_PAGE_PLACEHOLDER (object);
g_clear_pointer (&self->icon_name, g_free);
-
- G_OBJECT_CLASS (phosh_status_page_placeholder_parent_class)->dispose (object);
-}
-
-
-static void
-phosh_status_page_placeholder_destroy (GtkWidget *widget)
-{
- PhoshStatusPagePlaceholder *self = PHOSH_STATUS_PAGE_PLACEHOLDER (widget);
-
phosh_status_page_placeholder_set_extra_widget (self, NULL);
- GTK_WIDGET_CLASS (phosh_status_page_placeholder_parent_class)->destroy (widget);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_STATUS_PAGE_PLACEHOLDER);
+
+ G_OBJECT_CLASS (phosh_status_page_placeholder_parent_class)->dispose (object);
}
@@ -140,8 +132,6 @@ phosh_status_page_placeholder_class_init (PhoshStatusPagePlaceholderClass *klass
object_class->set_property = phosh_status_page_placeholder_set_property;
object_class->dispose = phosh_status_page_placeholder_dispose;
- widget_class->destroy = phosh_status_page_placeholder_destroy;
-
/**
* PhoshStatusPagePlaceholder:title:
*
@@ -181,6 +171,8 @@ phosh_status_page_placeholder_class_init (PhoshStatusPagePlaceholderClass *klass
gtk_widget_class_bind_template_child (widget_class, PhoshStatusPagePlaceholder, toplevel_box);
gtk_widget_class_set_css_name (widget_class, "phosh-status-page-placeholder");
+
+ gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
}
@@ -272,12 +264,12 @@ phosh_status_page_placeholder_set_extra_widget (PhoshStatusPagePlaceholder *self
return;
if (self->extra_widget)
- gtk_container_remove (GTK_CONTAINER (self->toplevel_box), self->extra_widget);
+ gtk_box_remove (self->toplevel_box, self->extra_widget);
self->extra_widget = extra_widget;
if (self->extra_widget)
- gtk_container_add (GTK_CONTAINER (self->toplevel_box), self->extra_widget);
+ gtk_box_append (self->toplevel_box, self->extra_widget);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_EXTRA_WIDGET]);
}
diff --git a/phosh/src/status-page-placeholder.h b/phosh/src/status-page-placeholder.h
index 58a3f95f1..c0beac31b 100644
--- a/phosh/src/status-page-placeholder.h
+++ b/phosh/src/status-page-placeholder.h
@@ -12,7 +12,7 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_STATUS_PAGE_PLACEHOLDER (phosh_status_page_placeholder_get_type ())
-G_DECLARE_FINAL_TYPE (PhoshStatusPagePlaceholder, phosh_status_page_placeholder, PHOSH, STATUS_PAGE_PLACEHOLDER, GtkBin)
+G_DECLARE_FINAL_TYPE (PhoshStatusPagePlaceholder, phosh_status_page_placeholder, PHOSH, STATUS_PAGE_PLACEHOLDER, GtkWidget)
PhoshStatusPagePlaceholder *phosh_status_page_placeholder_new (void);
void phosh_status_page_placeholder_set_title (PhoshStatusPagePlaceholder *self,
diff --git a/phosh/src/status-page.c b/phosh/src/status-page.c
index 52b1c8f67..1328af849 100644
--- a/phosh/src/status-page.c
+++ b/phosh/src/status-page.c
@@ -55,7 +55,7 @@ typedef struct {
GtkWidget *footer_widget;
} PhoshStatusPagePrivate;
-G_DEFINE_TYPE_WITH_PRIVATE (PhoshStatusPage, phosh_status_page, GTK_TYPE_BIN);
+G_DEFINE_TYPE_WITH_PRIVATE (PhoshStatusPage, phosh_status_page, GTK_TYPE_WIDGET);
static void
@@ -113,15 +113,17 @@ phosh_status_page_get_property (GObject *object,
static void
-phosh_status_page_destroy (GtkWidget *widget)
+phosh_status_page_dispose (GObject *object)
{
- PhoshStatusPage *self = PHOSH_STATUS_PAGE (widget);
+ PhoshStatusPage *self = PHOSH_STATUS_PAGE (object);
phosh_status_page_set_header (self, NULL);
phosh_status_page_set_content (self, NULL);
phosh_status_page_set_footer (self, NULL);
- GTK_WIDGET_CLASS (phosh_status_page_parent_class)->destroy (widget);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_STATUS_PAGE);
+
+ G_OBJECT_CLASS (phosh_status_page_parent_class)->dispose (object);
}
@@ -133,8 +135,7 @@ phosh_status_page_class_init (PhoshStatusPageClass *klass)
object_class->set_property = phosh_status_page_set_property;
object_class->get_property = phosh_status_page_get_property;
-
- widget_class->destroy = phosh_status_page_destroy;
+ object_class->dispose = phosh_status_page_dispose;
/**
* PhoshStatusPage:title:
@@ -198,6 +199,8 @@ phosh_status_page_class_init (PhoshStatusPageClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, PhoshStatusPage, toplevel_box);
gtk_widget_class_set_css_name (widget_class, "phosh-status-page");
+
+ gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
}
@@ -266,12 +269,12 @@ phosh_status_page_set_header (PhoshStatusPage *self, GtkWidget *header_widget)
return;
if (priv->header_widget)
- gtk_container_remove (GTK_CONTAINER (priv->header_bin), priv->header_widget);
+ gtk_box_remove (priv->header_bin, priv->header_widget);
priv->header_widget = header_widget;
if (priv->header_widget)
- gtk_container_add (GTK_CONTAINER (priv->header_bin), priv->header_widget);
+ gtk_box_append (priv->header_bin, priv->header_widget);
gtk_widget_set_visible (GTK_WIDGET (priv->header_bin), !!header_widget);
@@ -319,12 +322,12 @@ phosh_status_page_set_content (PhoshStatusPage *self, GtkWidget *content_widget)
return;
if (priv->content_widget)
- gtk_container_remove (GTK_CONTAINER (priv->content_bin), priv->content_widget);
+ gtk_box_remove (priv->content_bin, priv->content_widget);
priv->content_widget = content_widget;
if (priv->content_widget)
- gtk_container_add (GTK_CONTAINER (priv->content_bin), priv->content_widget);
+ gtk_box_append (priv->content_bin, priv->content_widget);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_CONTENT]);
}
@@ -369,12 +372,12 @@ phosh_status_page_set_footer (PhoshStatusPage *self, GtkWidget *footer_widget)
return;
if (priv->footer_widget)
- gtk_container_remove (GTK_CONTAINER (priv->footer_bin), priv->footer_widget);
+ gtk_box_remove (priv->footer_bin, priv->footer_widget);
priv->footer_widget = footer_widget;
if (priv->footer_widget)
- gtk_container_add (GTK_CONTAINER (priv->footer_bin), priv->footer_widget);
+ gtk_box_append (priv->footer_bin, priv->footer_widget);
gtk_widget_set_visible (GTK_WIDGET (priv->footer_separator), !!footer_widget);
gtk_widget_set_visible (GTK_WIDGET (priv->footer_bin), !!footer_widget);
diff --git a/phosh/src/status-page.h b/phosh/src/status-page.h
index 08a6629eb..3b28e6912 100644
--- a/phosh/src/status-page.h
+++ b/phosh/src/status-page.h
@@ -11,10 +11,10 @@
G_BEGIN_DECLS
#define PHOSH_TYPE_STATUS_PAGE phosh_status_page_get_type ()
-G_DECLARE_DERIVABLE_TYPE (PhoshStatusPage, phosh_status_page, PHOSH, STATUS_PAGE, GtkBin)
+G_DECLARE_DERIVABLE_TYPE (PhoshStatusPage, phosh_status_page, PHOSH, STATUS_PAGE, GtkWidget)
struct _PhoshStatusPageClass {
- GtkBinClass parent_class;
+ GtkWidgetClass parent_class;
/* Padding for future expansion */
void (*_phosh_reserved0) (void);
diff --git a/phosh/src/style-manager.c b/phosh/src/style-manager.c
index 152700ac0..178f10c4a 100644
--- a/phosh/src/style-manager.c
+++ b/phosh/src/style-manager.c
@@ -13,7 +13,7 @@
#include "style-manager.h"
#include "util.h"
-#include
+#include
#include
#define IF_KEY_ACCENT_COLOR "accent-color"
@@ -66,8 +66,8 @@ on_accent_color_changed (PhoshStyleManager *self)
g_autoptr (GtkCssProvider) provider = gtk_css_provider_new ();
if (self->accent_css_provider) {
- gtk_style_context_remove_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (self->accent_css_provider));
+ gtk_style_context_remove_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (self->accent_css_provider));
}
/* Only enable accent colors on Adwaita */
@@ -110,11 +110,11 @@ on_accent_color_changed (PhoshStyleManager *self)
css = g_strdup_printf ("@define-color theme_selected_bg_color %s;\n"
"@define-color theme_selected_fg_color %s;",
color, ACCENT_COLOR_FOREGROUND);
- gtk_css_provider_load_from_data (provider, css, -1, NULL);
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
- g_set_object (&self->accent_css_provider, provider);
+ gtk_css_provider_load_from_string (provider, css);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
+ g_set_object (&self->css_provider, provider);
}
@@ -134,16 +134,16 @@ on_gtk_theme_name_changed (PhoshStyleManager *self, GParamSpec *pspec, GtkSettin
g_debug ("GTK theme: %s", self->theme_name);
if (self->css_provider) {
- gtk_style_context_remove_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (self->css_provider));
+ gtk_style_context_remove_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (self->css_provider));
}
style = phosh_style_manager_get_stylesheet (self->theme_name);
gtk_css_provider_load_from_resource (provider, style);
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_set_object (&self->css_provider, provider);
/* Refresh accent color */
@@ -208,8 +208,9 @@ static void
phosh_style_manager_init (PhoshStyleManager *self)
{
GtkSettings *gtk_settings = gtk_settings_get_default ();
+ AdwStyleManager *adw_manager = adw_style_manager_get_default ();
- g_object_set (G_OBJECT (gtk_settings), "gtk-application-prefer-dark-theme", TRUE, NULL);
+ adw_style_manager_set_color_scheme (adw_manager, ADW_COLOR_SCHEME_FORCE_DARK);
self->interface_settings = g_settings_new (IF_SCHEMA_NAME);
diff --git a/phosh/src/stylesheet/common.css b/phosh/src/stylesheet/common.css
index 426d63d3b..6f4ddd914 100644
--- a/phosh/src/stylesheet/common.css
+++ b/phosh/src/stylesheet/common.css
@@ -163,11 +163,11 @@ phosh-brightness-settings scale {
/*
* Volume slider in settings
*/
-phosh-channel-bar image {
+phosh-gvc-channel-bar image {
-gtk-icon-style: symbolic;
}
-phosh-channel-bar scale {
+phosh-gvc-channel-bar scale {
padding-right: 4px;
}
@@ -317,22 +317,12 @@ phosh-activity box button {
/* box-shadow: 0 2px 2px rgba(0,0,0,0.4), 0 3px 16px rgba(0,0,0,0.3); */
}
-phosh-activity.phosh-empty.light {
- color: @phosh_splash_fg_color;
-}
-
-phosh-activity.phosh-empty.light .phosh-drawingarea {
- color: @phosh_splash_fg_color;
- background-color: @phosh_splash_bg_color;
-}
-
-phosh-activity.phosh-empty .phosh-drawingarea {
- border-radius: 8px;
- background-color: @theme_bg_color;
+phosh-activity.phosh-empty {
+ background: url('resource:///mobi/phosh/fake-app.svg');
+ background-size: cover;
}
phosh-activity.phosh-maximized .phosh-drawingarea {
- border-radius: 8px;
background-color: @phosh_activity_bg_color;
}
diff --git a/phosh/src/swipe-away-bin.c b/phosh/src/swipe-away-bin.c
index bf9d3c464..e74069200 100644
--- a/phosh/src/swipe-away-bin.c
+++ b/phosh/src/swipe-away-bin.c
@@ -10,7 +10,7 @@
#include "animation.h"
#include "swipe-away-bin.h"
-#include
+#include
enum {
REMOVED,
@@ -21,7 +21,6 @@ static guint signals[N_SIGNALS] = { 0 };
enum {
PROP_0,
- PROP_ENABLED,
PROP_ALLOW_NEGATIVE,
PROP_RESERVE_SIZE,
PROP_ORIENTATION,
@@ -32,7 +31,7 @@ static GParamSpec *props[LAST_PROP];
struct _PhoshSwipeAwayBin {
- GtkEventBox parent_instance;
+ GtkWidget parent_instance;
GtkOrientation orientation;
gboolean allow_negative;
@@ -40,17 +39,15 @@ struct _PhoshSwipeAwayBin {
double progress;
int distance;
- HdySwipeTracker *tracker;
+ AdwSwipeTracker *tracker;
PhoshAnimation *animation;
-
- gboolean enabled;
};
-static void phosh_swipe_away_bin_swipeable_init (HdySwipeableInterface *iface);
+static void phosh_swipe_away_bin_swipeable_init (AdwSwipeableInterface *iface);
-G_DEFINE_TYPE_WITH_CODE (PhoshSwipeAwayBin, phosh_swipe_away_bin, GTK_TYPE_EVENT_BOX,
+G_DEFINE_TYPE_WITH_CODE (PhoshSwipeAwayBin, phosh_swipe_away_bin, GTK_TYPE_WIDGET,
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL)
- G_IMPLEMENT_INTERFACE (HDY_TYPE_SWIPEABLE, phosh_swipe_away_bin_swipeable_init))
+ G_IMPLEMENT_INTERFACE (ADW_TYPE_SWIPEABLE, phosh_swipe_away_bin_swipeable_init))
static void
@@ -59,7 +56,7 @@ set_progress (PhoshSwipeAwayBin *self,
{
self->progress = progress;
- gtk_widget_set_opacity (GTK_WIDGET (self), hdy_ease_out_cubic (1 - ABS (self->progress)));
+ gtk_widget_set_opacity (GTK_WIDGET (self), adw_easing_ease (ADW_EASE_OUT_CUBIC, 1 - ABS (self->progress)));
gtk_widget_queue_allocate (GTK_WIDGET (self));
}
@@ -119,9 +116,6 @@ animate (PhoshSwipeAwayBin *self,
static void
begin_swipe_cb (PhoshSwipeAwayBin *self)
{
- if (!self->enabled)
- return;
-
if (self->animation)
phosh_animation_stop (self->animation);
}
@@ -131,21 +125,16 @@ static void
update_swipe_cb (PhoshSwipeAwayBin *self,
double progress)
{
- if (!self->enabled)
- return;
-
set_progress (self, progress);
}
static void
end_swipe_cb (PhoshSwipeAwayBin *self,
- gint64 duration,
+ double velocity,
double to)
{
- if (!self->enabled)
- return;
-
+ gint64 duration = self->distance / velocity;
animate (self, duration, to, PHOSH_ANIMATION_TYPE_EASE_OUT_CUBIC);
}
@@ -157,12 +146,26 @@ update_orientation (PhoshSwipeAwayBin *self)
self->orientation == GTK_ORIENTATION_HORIZONTAL &&
gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL;
- hdy_swipe_tracker_set_reversed (self->tracker, reversed);
+ adw_swipe_tracker_set_reversed (self->tracker, reversed);
gtk_widget_queue_allocate (GTK_WIDGET (self));
}
+static void
+phosh_swipe_away_bin_dispose (GObject *object)
+{
+ PhoshSwipeAwayBin *self = PHOSH_SWIPE_AWAY_BIN (object);
+ GtkWidget *child;
+
+ child = gtk_widget_get_first_child (GTK_WIDGET (self));
+ if (child)
+ gtk_widget_unparent (child);
+
+ G_OBJECT_CLASS (phosh_swipe_away_bin_parent_class)->dispose (object);
+}
+
+
static void
phosh_swipe_away_bin_finalize (GObject *object)
{
@@ -184,10 +187,6 @@ phosh_swipe_away_bin_get_property (GObject *object,
PhoshSwipeAwayBin *self = PHOSH_SWIPE_AWAY_BIN (object);
switch (prop_id) {
- case PROP_ENABLED:
- g_value_set_boolean (value, phosh_swipe_away_bin_get_enabled (self));
- break;
-
case PROP_ALLOW_NEGATIVE:
g_value_set_boolean (value, phosh_swipe_away_bin_get_allow_negative (self));
break;
@@ -215,10 +214,6 @@ phosh_swipe_away_bin_set_property (GObject *object,
PhoshSwipeAwayBin *self = PHOSH_SWIPE_AWAY_BIN (object);
switch (prop_id) {
- case PROP_ENABLED:
- phosh_swipe_away_bin_set_enabled (self, g_value_get_boolean (value));
- break;
-
case PROP_ALLOW_NEGATIVE:
phosh_swipe_away_bin_set_allow_negative (self, g_value_get_boolean (value));
break;
@@ -246,30 +241,28 @@ phosh_swipe_away_bin_set_property (GObject *object,
static void
phosh_swipe_away_bin_size_allocate (GtkWidget *widget,
- GtkAllocation *alloc)
+ int width, int height, int baseline)
{
PhoshSwipeAwayBin *self = PHOSH_SWIPE_AWAY_BIN (widget);
- GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
+ GtkWidget *child = gtk_widget_get_first_child (widget);
GtkAllocation child_alloc;
- GTK_WIDGET_CLASS (phosh_swipe_away_bin_parent_class)->size_allocate (widget, alloc);
-
if (!child || !gtk_widget_get_visible (child))
return;
- child_alloc.y = alloc->y;
- child_alloc.x = alloc->x;
- child_alloc.width = alloc->width;
- child_alloc.height = alloc->height;
+ child_alloc.y = 0;
+ child_alloc.x = 0;
+ child_alloc.width = width;
+ child_alloc.height = height;
if (self->orientation == GTK_ORIENTATION_HORIZONTAL) {
if (self->reserve_size) {
- self->distance = alloc->width / 3;
+ self->distance = width / 3;
child_alloc.width = self->distance;
child_alloc.x += self->distance;
} else {
- self->distance = alloc->width;
+ self->distance = width;
}
if (gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL)
@@ -279,19 +272,19 @@ phosh_swipe_away_bin_size_allocate (GtkWidget *widget,
} else {
if (self->reserve_size) {
- self->distance = alloc->height / 3;
+ self->distance = height / 3;
child_alloc.height = self->distance;
child_alloc.y += self->distance;
} else {
- self->distance = alloc->height;
+ self->distance = height;
}
child_alloc.y -= (int) (self->progress * self->distance);
}
- gtk_widget_size_allocate (child, &child_alloc);
+ gtk_widget_size_allocate (child, &child_alloc, 0);
}
@@ -301,8 +294,9 @@ phosh_swipe_away_bin_get_preferred_width (GtkWidget *widget,
gint *natural)
{
PhoshSwipeAwayBin *self = PHOSH_SWIPE_AWAY_BIN (widget);
+ GtkWidget *child = gtk_widget_get_first_child (widget);
- GTK_WIDGET_CLASS (phosh_swipe_away_bin_parent_class)->get_preferred_width (widget, minimum, natural);
+ gtk_widget_measure (child, GTK_ORIENTATION_HORIZONTAL, -1, minimum, natural, NULL, NULL);
if (self->reserve_size &&
self->orientation == GTK_ORIENTATION_HORIZONTAL) {
@@ -321,8 +315,9 @@ phosh_swipe_away_bin_get_preferred_height (GtkWidget *widget,
gint *natural)
{
PhoshSwipeAwayBin *self = PHOSH_SWIPE_AWAY_BIN (widget);
+ GtkWidget *child = gtk_widget_get_first_child (widget);
- GTK_WIDGET_CLASS (phosh_swipe_away_bin_parent_class)->get_preferred_height (widget, minimum, natural);
+ gtk_widget_measure (child, GTK_ORIENTATION_VERTICAL, -1, minimum, natural, NULL, NULL);
if (self->reserve_size &&
self->orientation == GTK_ORIENTATION_VERTICAL) {
@@ -335,6 +330,36 @@ phosh_swipe_away_bin_get_preferred_height (GtkWidget *widget,
}
+static void
+phosh_swipe_away_bin_measure (GtkWidget *widget,
+ GtkOrientation orientation,
+ int for_size,
+ int *minimum,
+ int *natural,
+ int *minimum_baseline,
+ int *natural_baseline)
+{
+ GtkWidget *child = gtk_widget_get_first_child (widget);
+
+ if (!child)
+ return;
+
+ if (orientation == GTK_ORIENTATION_HORIZONTAL && for_size == -1) {
+ phosh_swipe_away_bin_get_preferred_width (widget, minimum, natural);
+ } else if (orientation == GTK_ORIENTATION_VERTICAL && for_size == -1) {
+ phosh_swipe_away_bin_get_preferred_height (widget, minimum, natural);
+ } else {
+ gtk_widget_measure (child,
+ orientation,
+ for_size,
+ minimum,
+ natural,
+ minimum_baseline,
+ natural_baseline);
+ }
+}
+
+
static void
phosh_swipe_away_bin_direction_changed (GtkWidget *widget,
GtkTextDirection previous_direction)
@@ -351,24 +376,14 @@ phosh_swipe_away_bin_class_init (PhoshSwipeAwayBinClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
+ object_class->dispose = phosh_swipe_away_bin_dispose;
object_class->finalize = phosh_swipe_away_bin_finalize;
object_class->get_property = phosh_swipe_away_bin_get_property;
object_class->set_property = phosh_swipe_away_bin_set_property;
widget_class->size_allocate = phosh_swipe_away_bin_size_allocate;
- widget_class->get_preferred_width = phosh_swipe_away_bin_get_preferred_width;
- widget_class->get_preferred_height = phosh_swipe_away_bin_get_preferred_height;
+ widget_class->measure = phosh_swipe_away_bin_measure;
widget_class->direction_changed = phosh_swipe_away_bin_direction_changed;
- /**
- * PhoshSwipeAwayBin:enabled:
- *
- * Whether the widget reacts to swipes
- */
- props[PROP_ENABLED] =
- g_param_spec_boolean ("enabled", "", "",
- TRUE,
- G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
-
props[PROP_ALLOW_NEGATIVE] =
g_param_spec_boolean ("allow-negative",
"Allow Negative",
@@ -405,13 +420,13 @@ phosh_swipe_away_bin_class_init (PhoshSwipeAwayBinClass *klass)
static void
phosh_swipe_away_bin_init (PhoshSwipeAwayBin *self)
{
- self->enabled = TRUE;
- self->tracker = hdy_swipe_tracker_new (HDY_SWIPEABLE (self));
+ gtk_widget_set_hexpand (GTK_WIDGET (self), TRUE);
+ self->tracker = adw_swipe_tracker_new (ADW_SWIPEABLE (self));
g_object_bind_property (self, "orientation",
self->tracker, "orientation",
G_BINDING_SYNC_CREATE);
- hdy_swipe_tracker_set_allow_mouse_drag (self->tracker, TRUE);
+ adw_swipe_tracker_set_allow_mouse_drag (self->tracker, TRUE);
update_orientation (self);
g_signal_connect_object (self->tracker, "begin-swipe",
@@ -426,17 +441,8 @@ phosh_swipe_away_bin_init (PhoshSwipeAwayBin *self)
}
-static HdySwipeTracker *
-phosh_swipe_away_bin_get_swipe_tracker (HdySwipeable *swipeable)
-{
- PhoshSwipeAwayBin *self = PHOSH_SWIPE_AWAY_BIN (swipeable);
-
- return self->tracker;
-}
-
-
static double
-phosh_swipe_away_bin_get_distance (HdySwipeable *swipeable)
+phosh_swipe_away_bin_get_distance (AdwSwipeable *swipeable)
{
PhoshSwipeAwayBin *self = PHOSH_SWIPE_AWAY_BIN (swipeable);
@@ -445,14 +451,14 @@ phosh_swipe_away_bin_get_distance (HdySwipeable *swipeable)
static double
-phosh_swipe_away_bin_get_cancel_progress (HdySwipeable *swipeable)
+phosh_swipe_away_bin_get_cancel_progress (AdwSwipeable *swipeable)
{
return 0;
}
static double
-phosh_swipe_away_bin_get_progress (HdySwipeable *swipeable)
+phosh_swipe_away_bin_get_progress (AdwSwipeable *swipeable)
{
PhoshSwipeAwayBin *self = PHOSH_SWIPE_AWAY_BIN (swipeable);
@@ -461,7 +467,7 @@ phosh_swipe_away_bin_get_progress (HdySwipeable *swipeable)
static double *
-phosh_swipe_away_bin_get_snap_points (HdySwipeable *swipeable,
+phosh_swipe_away_bin_get_snap_points (AdwSwipeable *swipeable,
int *n_snap_points)
{
PhoshSwipeAwayBin *self = PHOSH_SWIPE_AWAY_BIN (swipeable);
@@ -485,46 +491,12 @@ phosh_swipe_away_bin_get_snap_points (HdySwipeable *swipeable,
static void
-phosh_swipe_away_bin_switch_child (HdySwipeable *swipeable,
- guint index,
- gint64 duration)
+phosh_swipe_away_bin_swipeable_init (AdwSwipeableInterface *iface)
{
-}
-
-
-static void
-phosh_swipe_away_bin_swipeable_init (HdySwipeableInterface *iface)
-{
- iface->get_swipe_tracker = phosh_swipe_away_bin_get_swipe_tracker;
iface->get_distance = phosh_swipe_away_bin_get_distance;
iface->get_cancel_progress = phosh_swipe_away_bin_get_cancel_progress;
iface->get_progress = phosh_swipe_away_bin_get_progress;
iface->get_snap_points = phosh_swipe_away_bin_get_snap_points;
- iface->switch_child = phosh_swipe_away_bin_switch_child;
-}
-
-
-gboolean
-phosh_swipe_away_bin_get_enabled (PhoshSwipeAwayBin *self)
-{
- g_return_val_if_fail (PHOSH_IS_SWIPE_AWAY_BIN (self), FALSE);
-
- return self->enabled;
-}
-
-
-void
-phosh_swipe_away_bin_set_enabled (PhoshSwipeAwayBin *self,
- gboolean enabled)
-{
- g_return_if_fail (PHOSH_IS_SWIPE_AWAY_BIN (self));
-
- enabled = !!enabled;
- if (enabled == self->enabled)
- return;
-
- self->enabled = enabled;
- g_object_notify_by_pspec (G_OBJECT (self), props[PROP_ENABLED]);
}
diff --git a/phosh/src/swipe-away-bin.h b/phosh/src/swipe-away-bin.h
index 39217d8ab..35e5d8079 100644
--- a/phosh/src/swipe-away-bin.h
+++ b/phosh/src/swipe-away-bin.h
@@ -11,10 +11,7 @@
#define PHOSH_TYPE_SWIPE_AWAY_BIN (phosh_swipe_away_bin_get_type())
-G_DECLARE_FINAL_TYPE (PhoshSwipeAwayBin, phosh_swipe_away_bin, PHOSH, SWIPE_AWAY_BIN, GtkEventBox)
-
-gboolean phosh_swipe_away_bin_get_enabled (PhoshSwipeAwayBin *self);
-void phosh_swipe_away_bin_set_enabled (PhoshSwipeAwayBin *self, gboolean enabled);
+G_DECLARE_FINAL_TYPE (PhoshSwipeAwayBin, phosh_swipe_away_bin, PHOSH, SWIPE_AWAY_BIN, GtkWidget)
gboolean phosh_swipe_away_bin_get_allow_negative (PhoshSwipeAwayBin *self);
void phosh_swipe_away_bin_set_allow_negative (PhoshSwipeAwayBin *self,
diff --git a/phosh/src/system-modal-dialog.c b/phosh/src/system-modal-dialog.c
index a795b5a3b..2c42c023a 100644
--- a/phosh/src/system-modal-dialog.c
+++ b/phosh/src/system-modal-dialog.c
@@ -86,6 +86,7 @@ static guint signals[N_SIGNALS] = { 0 };
typedef struct {
char *title;
+ GtkWidget *swipe_bin;
GtkWidget *lbl_title;
GtkWidget *box_dialog;
GtkWidget *box_buttons;
@@ -99,6 +100,7 @@ static void phosh_system_modal_dialog_buildable_init (GtkBuildableIface *iface);
G_DEFINE_TYPE_WITH_CODE (PhoshSystemModalDialog, phosh_system_modal_dialog,
PHOSH_TYPE_SYSTEM_MODAL,
G_ADD_PRIVATE (PhoshSystemModalDialog)
+ G_IMPLEMENT_INTERFACE (GTK_TYPE_SHORTCUT_MANAGER, NULL)
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
phosh_system_modal_dialog_buildable_init))
@@ -159,6 +161,20 @@ on_removed_by_swipe (PhoshSystemModalDialog *self)
}
+static void
+phosh_system_modal_dialog_dispose (GObject *object)
+{
+ PhoshSystemModalDialog *self = PHOSH_SYSTEM_MODAL_DIALOG (object);
+ PhoshSystemModalDialogPrivate *priv = phosh_system_modal_dialog_get_instance_private (self);
+
+ g_clear_pointer (&priv->swipe_bin, gtk_widget_unparent);
+
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_SYSTEM_MODAL_DIALOG);
+
+ G_OBJECT_CLASS (phosh_system_modal_dialog_parent_class)->dispose (object);
+}
+
+
static void
phosh_system_modal_dialog_finalize (GObject *object)
{
@@ -177,10 +193,10 @@ phosh_system_modal_dialog_class_init (PhoshSystemModalDialogClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- GtkBindingSet *binding_set;
object_class->get_property = phosh_system_modal_dialog_get_property;
object_class->set_property = phosh_system_modal_dialog_set_property;
+ object_class->dispose = phosh_system_modal_dialog_dispose;
object_class->finalize = phosh_system_modal_dialog_finalize;
widget_class->map = phosh_system_modal_dialog_map;
@@ -213,13 +229,13 @@ phosh_system_modal_dialog_class_init (PhoshSystemModalDialogClass *klass)
g_type_ensure (PHOSH_TYPE_SWIPE_AWAY_BIN);
gtk_widget_class_set_template_from_resource (widget_class,
"/mobi/phosh/ui/system-modal-dialog.ui");
+ gtk_widget_class_bind_template_child_private (widget_class, PhoshSystemModalDialog, swipe_bin);
gtk_widget_class_bind_template_child_private (widget_class, PhoshSystemModalDialog, lbl_title);
gtk_widget_class_bind_template_child_private (widget_class, PhoshSystemModalDialog, box_dialog);
gtk_widget_class_bind_template_child_private (widget_class, PhoshSystemModalDialog, box_buttons);
gtk_widget_class_bind_template_callback (widget_class, on_removed_by_swipe);
- binding_set = gtk_binding_set_by_class (klass);
- gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "dialog-canceled", 0);
+ gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_Escape, 0, "dialog-canceled", NULL);
}
@@ -277,7 +293,7 @@ animation_done_cb (PhoshSystemModalDialog *self)
g_clear_pointer (&priv->animation, phosh_animation_unref);
if (priv->fade_out)
- gtk_widget_destroy (GTK_WIDGET (self));
+ phosh_layer_surface_destroy (PHOSH_LAYER_SURFACE (self));
}
@@ -330,10 +346,9 @@ phosh_system_modal_dialog_set_content (PhoshSystemModalDialog *self, GtkWidget *
priv = phosh_system_modal_dialog_get_instance_private (PHOSH_SYSTEM_MODAL_DIALOG (self));
- gtk_box_pack_start (GTK_BOX (priv->box_dialog), GTK_WIDGET (content), FALSE, FALSE, 0);
- gtk_box_reorder_child (GTK_BOX (priv->box_dialog), GTK_WIDGET (content), 1);
- gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (content)),
- "phosh-system-modal-dialog-content");
+ gtk_box_insert_child_after (GTK_BOX (priv->box_dialog), content, priv->lbl_title);
+ gtk_widget_add_css_class (content,
+ "phosh-system-modal-dialog-content");
}
@@ -350,15 +365,28 @@ void
phosh_system_modal_dialog_add_button (PhoshSystemModalDialog *self, GtkWidget *button, gint position)
{
PhoshSystemModalDialogPrivate *priv;
+ GtkWidget *child;
+ guint i;
g_return_if_fail (PHOSH_IS_SYSTEM_MODAL_DIALOG (self));
g_return_if_fail (GTK_IS_BUTTON (button));
priv = phosh_system_modal_dialog_get_instance_private (PHOSH_SYSTEM_MODAL_DIALOG (self));
- gtk_box_pack_start (GTK_BOX (priv->box_buttons), GTK_WIDGET (button), TRUE, TRUE, 0);
- if (position >= 0)
- gtk_box_reorder_child (GTK_BOX (priv->box_buttons), GTK_WIDGET (button), position);
+ if (position <= 0) {
+ gtk_box_prepend (GTK_BOX (priv->box_buttons), button);
+ return;
+ }
+
+ i = 0;
+ child = gtk_widget_get_first_child (priv->box_buttons);
+ while (child != NULL) {
+ if (i == position - 1)
+ break;
+ child = gtk_widget_get_next_sibling (child);
+ i += 1;
+ }
+ gtk_box_insert_child_after (GTK_BOX (priv->box_buttons), button, child);
}
@@ -371,7 +399,7 @@ phosh_system_modal_dialog_remove_button (PhoshSystemModalDialog *self, GtkWidget
g_return_if_fail (GTK_IS_BUTTON (button));
priv = phosh_system_modal_dialog_get_instance_private (PHOSH_SYSTEM_MODAL_DIALOG (self));
- gtk_container_remove (GTK_CONTAINER (priv->box_buttons), button);
+ gtk_box_remove (GTK_BOX (priv->box_buttons), button);
}
/**
@@ -386,11 +414,18 @@ GList *
phosh_system_modal_dialog_get_buttons (PhoshSystemModalDialog *self)
{
PhoshSystemModalDialogPrivate *priv;
+ GList *children = NULL;
+ GtkWidget *child;
g_return_val_if_fail (PHOSH_IS_SYSTEM_MODAL_DIALOG (self), NULL);
priv = phosh_system_modal_dialog_get_instance_private (PHOSH_SYSTEM_MODAL_DIALOG (self));
- return gtk_container_get_children (GTK_CONTAINER (priv->box_buttons));
+ child = gtk_widget_get_last_child (priv->box_buttons);
+ while (child != NULL) {
+ children = g_list_prepend (children, child);
+ child = gtk_widget_get_prev_sibling (child);
+ }
+ return children;
}
/**
diff --git a/phosh/src/system-modal.c b/phosh/src/system-modal.c
index f34606107..ac3d35233 100644
--- a/phosh/src/system-modal.c
+++ b/phosh/src/system-modal.c
@@ -129,13 +129,11 @@ phosh_system_modal_constructed (GObject *object)
{
PhoshSystemModal *self = PHOSH_SYSTEM_MODAL (object);
PhoshSystemModalPrivate *priv = phosh_system_modal_get_instance_private (self);
- PhoshWayland *wl = phosh_wayland_get_default ();
if (priv->monitor == NULL)
priv->monitor = g_object_ref (phosh_shell_get_primary_monitor (phosh_shell_get_default ()));
g_object_set (PHOSH_LAYER_SURFACE (self),
- "layer-shell", phosh_wayland_get_zwlr_layer_shell_v1 (wl),
"wl-output", phosh_monitor_get_wl_output (priv->monitor),
"anchor", ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
@@ -147,8 +145,8 @@ phosh_system_modal_constructed (GObject *object)
"namespace", "phosh system-modal",
NULL);
- gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (self)),
- "phosh-system-modal");
+ gtk_widget_add_css_class (GTK_WIDGET (self),
+ "phosh-system-modal");
G_OBJECT_CLASS (phosh_system_modal_parent_class)->constructed (object);
}
diff --git a/phosh/src/system-prompt.c b/phosh/src/system-prompt.c
index 6659a0004..c1e14214d 100644
--- a/phosh/src/system-prompt.c
+++ b/phosh/src/system-prompt.c
@@ -101,7 +101,7 @@ struct _PhoshSystemPrompt
};
-static void phosh_system_prompt_iface_init (GcrPromptIface *iface);
+static void phosh_system_prompt_iface_init (GcrPromptInterface *iface);
G_DEFINE_TYPE_WITH_CODE(PhoshSystemPrompt, phosh_system_prompt, PHOSH_TYPE_SYSTEM_MODAL_DIALOG,
G_IMPLEMENT_INTERFACE (GCR_TYPE_PROMPT,
phosh_system_prompt_iface_init)
@@ -460,7 +460,7 @@ on_password_changed (PhoshSystemPrompt *self,
return;
gtk_widget_set_sensitive (priv->btn_continue, TRUE);
- password = gtk_entry_get_text (GTK_ENTRY (editable));
+ password = gtk_editable_get_text (editable);
/*
* This code is based on the Master Password dialog in Firefox
@@ -520,7 +520,7 @@ on_dialog_canceled (PhoshSystemPrompt *self)
}
static void
-phosh_system_prompt_iface_init (GcrPromptIface *iface)
+phosh_system_prompt_iface_init (GcrPromptInterface *iface)
{
iface->prompt_confirm_async = phosh_system_prompt_confirm_async;
iface->prompt_confirm_finish = phosh_system_prompt_confirm_finish;
@@ -543,6 +543,9 @@ phosh_system_prompt_dispose (GObject *obj)
prompt_cancel (self);
g_assert (priv->task == NULL);
+
+ gtk_widget_dispose_template (GTK_WIDGET (obj), PHOSH_TYPE_SYSTEM_PROMPT);
+
G_OBJECT_CLASS (phosh_system_prompt_parent_class)->dispose (obj);
}
@@ -576,14 +579,14 @@ phosh_system_prompt_constructed (GObject *object)
g_object_bind_property (self, "description", priv->lbl_description, "label", G_BINDING_DEFAULT);
g_object_bind_property (self, "password-visible", priv->lbl_password, "visible", G_BINDING_DEFAULT);
- priv->password_buffer = gcr_secure_entry_buffer_new ();
+ priv->password_buffer = gtk_password_entry_buffer_new ();
gtk_entry_set_buffer (GTK_ENTRY (priv->entry_password), GTK_ENTRY_BUFFER (priv->password_buffer));
g_object_bind_property (self, "password-visible", priv->entry_password,
"visible", G_BINDING_DEFAULT);
g_object_bind_property (self, "confirm-visible", priv->lbl_confirm, "visible", G_BINDING_DEFAULT);
- priv->confirm_buffer = gcr_secure_entry_buffer_new ();
+ priv->confirm_buffer = gtk_password_entry_buffer_new ();
gtk_entry_set_buffer (GTK_ENTRY (priv->entry_confirm), GTK_ENTRY_BUFFER (priv->confirm_buffer));
g_object_bind_property (self, "confirm-visible", priv->entry_confirm, "visible", G_BINDING_DEFAULT);
@@ -605,8 +608,6 @@ phosh_system_prompt_constructed (GObject *object)
g_object_bind_property (self, "cancel-label", priv->btn_cancel, "label", G_BINDING_DEFAULT);
g_object_bind_property (self, "continue-label", priv->btn_continue, "label", G_BINDING_DEFAULT);
-
- gtk_widget_grab_default (priv->btn_continue);
}
@@ -706,7 +707,8 @@ phosh_system_prompt_init (PhoshSystemPrompt *self)
* e0a506eeb29bc6be01a96e805e0244a03428ebf5.
* Otherwise it gets clean up too early.
*/
- gtk_window_set_has_user_ref_count (GTK_WINDOW (self), FALSE);
+ // FIXME Find out if we need this in GTK 4
+ // gtk_window_set_has_user_ref_count (GTK_WINDOW (self), FALSE);
gtk_widget_init_template (GTK_WIDGET (self));
}
diff --git a/phosh/src/system-prompter.h b/phosh/src/system-prompter.h
index 35a2db44d..d39e18aea 100644
--- a/phosh/src/system-prompter.h
+++ b/phosh/src/system-prompter.h
@@ -7,7 +7,7 @@
#pragma once
#define GCR_API_SUBJECT_TO_CHANGE
-#include
+#include
GcrSystemPrompter *phosh_system_prompter_register(void);
void phosh_system_prompter_unregister(void);
diff --git a/phosh/src/thumbnail.c b/phosh/src/thumbnail.c
index 6daa6739d..e91eaf6a5 100644
--- a/phosh/src/thumbnail.c
+++ b/phosh/src/thumbnail.c
@@ -127,5 +127,4 @@ phosh_thumbnail_set_ready (PhoshThumbnail *self, gboolean ready)
priv->ready = ready;
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_READY]);
-
}
diff --git a/phosh/src/top-panel-bg.c b/phosh/src/top-panel-bg.c
index f2fe64ba9..625eb51ea 100644
--- a/phosh/src/top-panel-bg.c
+++ b/phosh/src/top-panel-bg.c
@@ -81,13 +81,9 @@ phosh_top_panel_bg_init (PhoshTopPanelBg *self)
PhoshTopPanelBg *
-phosh_top_panel_bg_new (struct zwlr_layer_shell_v1 *layer_shell,
- PhoshMonitor *monitor,
- guint32 layer)
-
+phosh_top_panel_bg_new (PhoshMonitor *monitor, guint32 layer)
{
return g_object_new (PHOSH_TYPE_TOP_PANEL_BG,
- "layer-shell", layer_shell,
"wl-output", monitor->wl_output,
"anchor", (ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
diff --git a/phosh/src/top-panel-bg.h b/phosh/src/top-panel-bg.h
index 6ee56aea9..915c0daac 100644
--- a/phosh/src/top-panel-bg.h
+++ b/phosh/src/top-panel-bg.h
@@ -15,9 +15,8 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (PhoshTopPanelBg, phosh_top_panel_bg, PHOSH, TOP_PANEL_BG, PhoshLayerSurface)
-PhoshTopPanelBg *phosh_top_panel_bg_new (struct zwlr_layer_shell_v1 *layer_shell,
- PhoshMonitor *monitor,
- guint32 layer);
+PhoshTopPanelBg *phosh_top_panel_bg_new (PhoshMonitor *monitor,
+ guint32 layer);
void phosh_top_panel_bg_set_transparency (PhoshTopPanelBg *self,
double transparency);
diff --git a/phosh/src/top-panel.c b/phosh/src/top-panel.c
index e8da3a583..fd0df84c3 100644
--- a/phosh/src/top-panel.c
+++ b/phosh/src/top-panel.c
@@ -27,7 +27,7 @@
#include "util.h"
#include "wall-clock.h"
-#include
+#include
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include
@@ -278,13 +278,12 @@ on_open_panel_ready (GObject *source_object, GAsyncResult *res, gpointer user_da
static void
-open_settings_panel (PhoshTopPanel *self, gboolean mobile, const char *panel, GVariant *params)
+open_settings_panel (PhoshTopPanel *self, gboolean mobile, const char *panel)
{
if (self->on_lockscreen)
return;
phosh_util_open_settings_panel (panel,
- params,
mobile,
self->cancel,
on_open_panel_ready,
@@ -292,31 +291,15 @@ open_settings_panel (PhoshTopPanel *self, gboolean mobile, const char *panel, GV
}
-static void
-parse_panel_options (GSimpleAction *action, GVariant *data, const char **panel, GVariant **params)
-{
- g_assert (panel);
-
- if (!params) {
- g_critical ("Failed to parse panel options: 'params' NULL");
-
- return;
- }
-
- g_variant_get (data, "(&s@av)", panel, params);
-}
-
-
static void
on_launch_panel_activated (GSimpleAction *action, GVariant *param, gpointer data)
{
PhoshTopPanel *self = PHOSH_TOP_PANEL (data);
const char *panel;
- g_autoptr (GVariant) params = NULL;
- parse_panel_options (action, param, &panel, ¶ms);
+ panel = g_variant_get_string (param, NULL);
- open_settings_panel (self, FALSE, panel, params);
+ open_settings_panel (self, FALSE, panel);
phosh_settings_hide_details (PHOSH_SETTINGS (self->settings));
}
@@ -326,11 +309,10 @@ on_launch_mobile_panel_activated (GSimpleAction *action, GVariant *param, gpoint
{
PhoshTopPanel *self = PHOSH_TOP_PANEL (data);
const char *panel;
- g_autoptr (GVariant) params = NULL;
- parse_panel_options (action, param, &panel, ¶ms);
+ panel = g_variant_get_string (param, NULL);
- open_settings_panel (self, TRUE, panel, params);
+ open_settings_panel (self, TRUE, panel);
phosh_settings_hide_details (PHOSH_SETTINGS (self->settings));
}
@@ -357,7 +339,7 @@ wall_clock_notify_cb (PhoshTopPanel *self,
static gboolean
needs_keyboard_label (PhoshTopPanel *self)
{
- GList *slaves;
+ GList *devices;
g_autoptr(GVariant) sources = NULL;
g_return_val_if_fail (GDK_IS_SEAT (self->seat), FALSE);
@@ -371,11 +353,11 @@ needs_keyboard_label (PhoshTopPanel *self)
if (g_variant_n_children (sources) < 2)
return FALSE;
- slaves = gdk_seat_get_slaves (self->seat, GDK_SEAT_CAPABILITY_KEYBOARD);
- if (!slaves)
+ devices = gdk_seat_get_devices (self->seat, GDK_SEAT_CAPABILITY_KEYBOARD);
+ if (!devices)
return FALSE;
- g_list_free (slaves);
+ g_list_free (devices);
return TRUE;
}
@@ -447,7 +429,7 @@ on_input_setting_changed (PhoshTopPanel *self,
static void
-released_cb (PhoshTopPanel *self, int n_press, double x, double y, GtkGestureMultiPress *gesture)
+released_cb (PhoshTopPanel *self, int n_press, double x, double y, GtkGestureClick *gesture)
{
/*
* The popover has to be popdown manually as it doesn't happen
@@ -520,10 +502,10 @@ static void
phosh_top_panel_dragged (PhoshDragSurface *drag_surface, int margin)
{
PhoshTopPanel *self = PHOSH_TOP_PANEL (drag_surface);
- int width, height;
+ int height;
double progress, transparency;
- gtk_window_get_size (GTK_WINDOW (self), &width, &height);
+ height = phosh_layer_surface_get_configured_height (PHOSH_LAYER_SURFACE (self));
progress = -margin / (double)(height - PHOSH_TOP_BAR_HEIGHT);
phosh_arrow_set_progress (PHOSH_ARROW (self->arrow), progress);
@@ -587,41 +569,41 @@ on_drag_state_changed (PhoshTopPanel *self)
}
-static void
-phosh_top_panel_map (GtkWidget *widget)
-{
- PhoshTopPanel *self = PHOSH_TOP_PANEL (widget);
-
- GTK_WIDGET_CLASS (phosh_top_panel_parent_class)->map (widget);
-
- phosh_layer_surface_set_stacked_below (PHOSH_LAYER_SURFACE (self->background),
- PHOSH_LAYER_SURFACE (self));
-}
-
-
static void
phosh_top_panel_add_background (PhoshTopPanel *self)
{
- PhoshWayland *wl = phosh_wayland_get_default ();
PhoshShell *shell = phosh_shell_get_default ();
PhoshMonitor *monitor;
guint32 layer;
+ GdkSurface *surface;
cairo_rectangle_int_t rect = { 0, 0, 0, 0 };
cairo_region_t *region;
monitor = phosh_shell_get_primary_monitor (shell);
layer = phosh_layer_surface_get_layer (PHOSH_LAYER_SURFACE (self));
- self->background = phosh_top_panel_bg_new (phosh_wayland_get_zwlr_layer_shell_v1 (wl),
- monitor,
- layer);
+ self->background = phosh_top_panel_bg_new (monitor, layer);
g_object_bind_property (self, "visible", self->background, "visible", G_BINDING_SYNC_CREATE);
region = cairo_region_create_rectangle (&rect);
- gtk_widget_input_shape_combine_region (GTK_WIDGET (self->background), region);
+ surface = gtk_native_get_surface (GTK_NATIVE (self->background));
+ gdk_surface_set_input_region (surface, region);
cairo_region_destroy (region);
}
+static void
+phosh_top_panel_map (GtkWidget *widget)
+{
+ PhoshTopPanel *self = PHOSH_TOP_PANEL (widget);
+
+ GTK_WIDGET_CLASS (phosh_top_panel_parent_class)->map (widget);
+
+ phosh_top_panel_add_background (self);
+ phosh_layer_surface_set_stacked_below (PHOSH_LAYER_SURFACE (self->background),
+ PHOSH_LAYER_SURFACE (self));
+}
+
+
static void
on_theme_name_changed (PhoshTopPanel *self, GParamSpec *pspec, PhoshStyleManager *style_manager)
{
@@ -641,10 +623,10 @@ static GActionEntry entries[] = {
{ .name = "suspend", .activate = on_suspend_action },
{ .name = "lockscreen", .activate = on_lockscreen_action },
{ .name = "logout", .activate = on_logout_action },
- { .name = "launch-panel", .activate = on_launch_panel_activated, .parameter_type = "(sav)" },
+ { .name = "launch-panel", .activate = on_launch_panel_activated, .parameter_type = "s" },
{ .name = "launch-mobile-panel",
.activate = on_launch_mobile_panel_activated,
- .parameter_type = "(sav)" },
+ .parameter_type = "s" },
};
@@ -680,8 +662,6 @@ phosh_top_panel_constructed (GObject *object)
wall_clock_notify_cb (self, NULL, wall_clock);
- gtk_window_set_title (GTK_WINDOW (self), "phosh panel");
-
/* language indicator */
if (display) {
self->input_settings = g_settings_new ("org.gnome.desktop.input-sources");
@@ -752,7 +732,6 @@ phosh_top_panel_constructed (GObject *object)
g_signal_connect (self, "notify::drag-state", G_CALLBACK (on_drag_state_changed), NULL);
- phosh_top_panel_add_background (self);
g_signal_connect_object (phosh_shell_get_style_manager (shell),
"notify::theme-name",
G_CALLBACK (on_theme_name_changed),
@@ -784,6 +763,8 @@ phosh_top_panel_dispose (GObject *object)
g_clear_pointer (&self->background, phosh_cp_widget_destroy);
g_clear_object (&self->cutout_css_provider);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_TOP_PANEL);
+
G_OBJECT_CLASS (phosh_top_panel_parent_class)->dispose (object);
}
@@ -795,25 +776,22 @@ get_margin (gint height)
}
-static gboolean
-on_configure_event (PhoshTopPanel *self, GdkEventConfigure *event)
+static void
+on_configure_event (PhoshTopPanel *self)
{
guint margin;
+ int width, height;
- margin = get_margin (event->height);
-
- /* ignore popovers like the power menu */
- if (gtk_widget_get_window (GTK_WIDGET (self)) != event->window)
- return FALSE;
+ width = phosh_layer_surface_get_configured_width (PHOSH_LAYER_SURFACE (self));
+ height = phosh_layer_surface_get_configured_height (PHOSH_LAYER_SURFACE (self));
+ margin = get_margin (height);
- g_debug ("%s: %dx%d margin: %d", __func__, event->height, event->width, margin);
+ g_debug ("%s: %dx%d margin: %d", __func__, height, width, margin);
/* If the size changes we need to update the folded margin */
phosh_drag_surface_set_margin (PHOSH_DRAG_SURFACE (self), margin, 0);
/* Update drag handle since top-panel size might have changed */
update_drag_handle (self, TRUE);
-
- return FALSE;
}
@@ -838,7 +816,6 @@ phosh_top_panel_class_init (PhoshTopPanelClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
PhoshLayerSurfaceClass *layer_surface_class = PHOSH_LAYER_SURFACE_CLASS (klass);
PhoshDragSurfaceClass *drag_surface_class = PHOSH_DRAG_SURFACE_CLASS (klass);
- GtkBindingSet *binding_set;
object_class->constructed = phosh_top_panel_constructed;
object_class->dispose = phosh_top_panel_dispose;
@@ -912,8 +889,11 @@ phosh_top_panel_class_init (PhoshTopPanelClass *klass)
gtk_widget_class_bind_template_callback (widget_class, phosh_top_panel_fold);
gtk_widget_class_bind_template_callback (widget_class, released_cb);
- binding_set = gtk_binding_set_by_class (klass);
- gtk_binding_entry_add_signal (binding_set, GDK_KEY_Escape, 0, "activated", 0);
+ gtk_widget_class_add_binding_signal (widget_class,
+ GDK_KEY_Escape,
+ GDK_NO_MODIFIER_MASK,
+ "activated",
+ NULL);
gtk_widget_class_set_css_name (widget_class, "phosh-top-panel");
}
@@ -924,29 +904,38 @@ set_clock_position (PhoshTopPanel *self, PhoshLayoutManager *layout_manager)
{
PhoshLayoutClockPosition pos;
guint top_margin = 0;
+ GtkWidget *parent = gtk_widget_get_parent (self->lbl_clock);
+ GtkWidget *start = gtk_center_box_get_start_widget (GTK_CENTER_BOX (self->box_top_bar));
+ GtkWidget *end = gtk_center_box_get_end_widget (GTK_CENTER_BOX (self->box_top_bar));
pos = phosh_layout_manager_get_clock_pos (layout_manager);
/* Top-bar clock */
- gtk_container_remove (GTK_CONTAINER (self->box_top_bar), self->lbl_clock);
+ if (parent == start)
+ gtk_box_remove (GTK_BOX (start), self->lbl_clock);
+ else if (parent == self->box_top_bar)
+ gtk_center_box_set_center_widget (GTK_CENTER_BOX (self->box_top_bar), NULL);
+ else if (parent == end)
+ gtk_box_remove (GTK_BOX (end), self->lbl_clock);
+ else
+ g_assert_not_reached ();
+
phosh_util_toggle_style_class (self->lbl_clock, "left", FALSE);
phosh_util_toggle_style_class (self->lbl_clock, "right", FALSE);
switch (pos) {
case PHOSH_LAYOUT_CLOCK_POS_LEFT:
- gtk_box_pack_start (GTK_BOX (self->box_top_bar), self->lbl_clock, FALSE, FALSE, 0);
- gtk_box_reorder_child (GTK_BOX (self->box_top_bar), self->lbl_clock, 0);
+ gtk_box_prepend (GTK_BOX (start), self->lbl_clock);
phosh_util_toggle_style_class (self->lbl_clock, "left", TRUE);
top_margin = phosh_layout_manager_get_clock_shift (layout_manager);
break;
case PHOSH_LAYOUT_CLOCK_POS_RIGHT:
- gtk_box_pack_end (GTK_BOX (self->box_top_bar), self->lbl_clock, FALSE, FALSE, 0);
- gtk_box_reorder_child (GTK_BOX (self->box_top_bar), self->lbl_clock, 1);
+ gtk_box_append (GTK_BOX (end), self->lbl_clock);
phosh_util_toggle_style_class (self->lbl_clock, "right", TRUE);
top_margin = phosh_layout_manager_get_clock_shift (layout_manager);
break;
case PHOSH_LAYOUT_CLOCK_POS_CENTER:
- gtk_box_set_center_widget (GTK_BOX (self->box_top_bar), self->lbl_clock);
+ gtk_center_box_set_center_widget (GTK_CENTER_BOX (self->box_top_bar), self->lbl_clock);
break;
default:
g_assert_not_reached ();
@@ -983,10 +972,10 @@ set_margin (PhoshTopPanel *self, PhoshLayoutManager *layout_manager)
" padding-right: %dpx;"
"}",
network_box_shift, indicators_box_shift, launch_settings_revealer_shift);
- gtk_css_provider_load_from_data (provider, css, -1, NULL);
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
+ gtk_css_provider_load_from_string (provider, css);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
g_set_object (&self->cutout_css_provider, provider);
}
@@ -1012,7 +1001,9 @@ phosh_top_panel_init (PhoshTopPanel *self)
self->cancel = g_cancellable_new ();
self->state = PHOSH_TOP_PANEL_STATE_UNFOLDED;
self->kb_settings = g_settings_new (KEYBINDINGS_SCHEMA_ID);
- g_signal_connect (self, "configure-event", G_CALLBACK (on_configure_event), NULL);
+ /* Adjust margins and folded state on size changes */
+ g_signal_connect (self, "configured", G_CALLBACK (on_configure_event), NULL);
+ on_configure_event (self);
layout_manager = phosh_shell_get_layout_manager (phosh_shell_get_default ());
g_signal_connect_object (layout_manager,
@@ -1025,24 +1016,16 @@ phosh_top_panel_init (PhoshTopPanel *self)
GtkWidget *
-phosh_top_panel_new (struct zwlr_layer_shell_v1 *layer_shell,
- struct zphoc_layer_shell_effects_v1 *layer_shell_effects,
- PhoshMonitor *monitor,
+phosh_top_panel_new (PhoshMonitor *monitor,
guint32 layer)
{
return g_object_new (PHOSH_TYPE_TOP_PANEL,
/* layer-surface */
- "layer-shell", layer_shell,
"wl-output", monitor->wl_output,
"height", PHOSH_TOP_BAR_HEIGHT,
- "anchor", ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP |
- ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
- ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT,
"layer", layer,
"kbd-interactivity", FALSE,
- "namespace", "phosh top-panel",
/* drag-surface */
- "layer-shell-effects", layer_shell_effects,
"exclusive", PHOSH_TOP_BAR_HEIGHT,
"threshold", PHOSH_TOP_PANEL_DRAG_THRESHOLD,
NULL);
diff --git a/phosh/src/top-panel.h b/phosh/src/top-panel.h
index 1e4748ad5..36b62d0c6 100644
--- a/phosh/src/top-panel.h
+++ b/phosh/src/top-panel.h
@@ -30,9 +30,7 @@ typedef enum {
PHOSH_TOP_PANEL_STATE_UNFOLDED,
} PhoshTopPanelState;
-GtkWidget *phosh_top_panel_new (struct zwlr_layer_shell_v1 *layer_shell,
- struct zphoc_layer_shell_effects_v1 *layer_shell_effects,
- PhoshMonitor *monitor,
+GtkWidget *phosh_top_panel_new (PhoshMonitor *monitor,
guint32 layer);
void phosh_top_panel_toggle_fold (PhoshTopPanel *self);
void phosh_top_panel_fold (PhoshTopPanel *self);
diff --git a/phosh/src/toplevel-manager.c b/phosh/src/toplevel-manager.c
index b15286bed..f18dc0b9f 100644
--- a/phosh/src/toplevel-manager.c
+++ b/phosh/src/toplevel-manager.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2019 Purism SPC
- * 2023-2026 Phosh.mobi e.V.
+ * 2024 The Phosh Developers
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
@@ -16,8 +16,6 @@
#include "util.h"
#include "wlr-foreign-toplevel-management-unstable-v1-client-protocol.h"
-#include
-
/**
* PhoshToplevelManager:
*
@@ -33,134 +31,21 @@ enum {
};
static GParamSpec *props[PROP_LAST_PROP];
-
enum {
- TOPLEVEL_ADDED,
- TOPLEVEL_CHANGED,
- TOPLEVEL_MISSING,
+ SIGNAL_TOPLEVEL_ADDED,
+ SIGNAL_TOPLEVEL_CHANGED,
N_SIGNALS
};
-static guint signals[N_SIGNALS];
-
-#define MAX_INITIAL_TOPLEVEL_TIMEOUT 30 /* s */
-
-typedef struct {
- GAppInfo *app_info;
- guint timeout_id;
- PhoshToplevelManager *manager; /* unowned */
-} LaunchingAppInfo;
+static guint signals[N_SIGNALS] = { 0 };
struct _PhoshToplevelManager {
- GObject parent;
-
- GPtrArray *toplevels; /* (element-type: PhoshToplevel) */
- GPtrArray *toplevels_pending; /* (element-type: PhoshToplevel) */
-
- PhoshAppTracker *app_tracker;
- GPtrArray *launching_apps; /* (element-type: LaunchingToplevelInfo */
+ GObject parent;
+ GPtrArray *toplevels; /* (element-type: PhoshToplevel) */
+ GPtrArray *toplevels_pending; /* (element-type: PhoshToplevel) */
};
G_DEFINE_TYPE (PhoshToplevelManager, phosh_toplevel_manager, G_TYPE_OBJECT);
-
-static void
-on_initial_toplevel_timeout (gpointer data)
-{
- LaunchingAppInfo *info = data;
-
- g_signal_emit (info->manager, signals[TOPLEVEL_MISSING], 0, info->app_info);
- info->timeout_id = 0;
-
- if (!g_ptr_array_remove_fast (info->manager->launching_apps, info))
- g_critical ("Failed to find launching info for %s", g_app_info_get_id (info->app_info));
-}
-
-
-static void
-launching_app_info_free (LaunchingAppInfo *info)
-{
- g_clear_handle_id (&info->timeout_id, g_source_remove);
- g_clear_object (&info->app_info);
- g_free (info);
-}
-
-
-static LaunchingAppInfo *
-launching_app_info_new (PhoshToplevelManager *toplevel_manager, GAppInfo *app_info)
-{
- LaunchingAppInfo *info = g_new0 (LaunchingAppInfo, 1);
-
- info->app_info = g_object_ref (app_info);
- info->manager = toplevel_manager;
-
- info->timeout_id = g_timeout_add_seconds_once (MAX_INITIAL_TOPLEVEL_TIMEOUT,
- on_initial_toplevel_timeout,
- info);
- return info;
-}
-
-
-static gboolean
-app_info_has_toplevel (PhoshToplevelManager *self, GAppInfo *app_info)
-{
- const char *app_id = g_app_info_get_id (app_info);
-
- for (int i = 0; i < self->toplevels->len; i++) {
- PhoshToplevel *toplevel = g_ptr_array_index (self->toplevels, i);
-
- if (g_strcmp0 (phosh_toplevel_get_app_id (toplevel), app_id) == 0)
- return TRUE;
- }
-
- return FALSE;
-}
-
-
-static void
-remove_from_launching (PhoshToplevelManager *self, PhoshToplevel *toplevel)
-{
- g_autoptr (GAppInfo) needle = NULL;
- const char *app_id;
-
- app_id = phosh_toplevel_get_app_id (toplevel);
- if (app_id)
- return;
-
- needle = G_APP_INFO (phosh_get_desktop_app_info_for_app_id (app_id));
- if (!needle)
- return;
-
- for (int i = 0; i < self->launching_apps->len; i++) {
- LaunchingAppInfo *info = g_ptr_array_index (self->launching_apps, i);
-
- if (g_app_info_equal (G_APP_INFO (needle), info->app_info)) {
- g_ptr_array_remove_index_fast (self->launching_apps, i);
- g_debug ("Found toplevel for launching app %s", g_app_info_get_id (needle));
- return;
- }
- }
-
- g_debug ("Couldn't find app info toplevel %s", app_id);
-}
-
-
-static void
-on_app_launched (PhoshToplevelManager *self, GAppInfo *app_info, const char *startup_id)
-{
- LaunchingAppInfo *info;
- const char *app_id = g_app_info_get_id (app_info);
-
- if (app_info_has_toplevel (self, app_info)) {
- g_debug ("App info %s already has a toplevel", app_id);
- return;
- }
-
- g_warning ("Tracking %s as there's no toplevel yet", app_id);
- info = launching_app_info_new (self, app_info);
- g_ptr_array_add (self->launching_apps, info);
-}
-
-
static void
phosh_toplevel_get_property (GObject *object,
guint property_id,
@@ -184,6 +69,8 @@ on_toplevel_closed (PhoshToplevelManager *self, PhoshToplevel *toplevel)
{
g_return_if_fail (PHOSH_IS_TOPLEVEL_MANAGER (self));
g_return_if_fail (PHOSH_IS_TOPLEVEL (toplevel));
+ g_return_if_fail (self->toplevels);
+ g_return_if_fail (self->toplevels_pending);
/* Check if toplevel exists in toplevels_pending, in that case it is
* not yet configured and we just remove it from toplevels_pending
@@ -206,6 +93,8 @@ on_toplevel_configured (PhoshToplevelManager *self, GParamSpec *pspec, PhoshTopl
gboolean configured;
g_return_if_fail (PHOSH_IS_TOPLEVEL_MANAGER (self));
g_return_if_fail (PHOSH_IS_TOPLEVEL (toplevel));
+ g_return_if_fail (self->toplevels);
+ g_return_if_fail (self->toplevels_pending);
configured = phosh_toplevel_is_configured (toplevel);
@@ -213,14 +102,12 @@ on_toplevel_configured (PhoshToplevelManager *self, GParamSpec *pspec, PhoshTopl
return;
if (g_ptr_array_find (self->toplevels, toplevel, NULL)) {
- g_signal_emit (self, signals[TOPLEVEL_CHANGED], 0, toplevel);
+ g_signal_emit (self, signals[SIGNAL_TOPLEVEL_CHANGED], 0, toplevel);
} else {
g_assert_true (g_ptr_array_remove (self->toplevels_pending, toplevel));
g_ptr_array_add (self->toplevels, toplevel);
- g_signal_emit (self, signals[TOPLEVEL_ADDED], 0, toplevel);
+ g_signal_emit (self, signals[SIGNAL_TOPLEVEL_ADDED], 0, toplevel);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_NUM_TOPLEVELS]);
-
- remove_from_launching (self, toplevel);
}
}
@@ -274,10 +161,6 @@ phosh_toplevel_manager_dispose (GObject *object)
g_ptr_array_free (self->toplevels_pending, TRUE);
self->toplevels_pending = NULL;
}
-
- g_clear_pointer (&self->launching_apps, g_ptr_array_unref);
- g_clear_object (&self->app_tracker);
-
G_OBJECT_CLASS (phosh_toplevel_manager_parent_class)->dispose (object);
}
@@ -290,16 +173,16 @@ phosh_toplevel_manager_class_init (PhoshToplevelManagerClass *klass)
object_class->dispose = phosh_toplevel_manager_dispose;
object_class->get_property = phosh_toplevel_get_property;
- /**
- * PhoshToplevelManager:num-toplevels:
- *
- * The current number of toplevels
- */
props[PROP_NUM_TOPLEVELS] =
- g_param_spec_int ("num-toplevels", "", "",
- 0, G_MAXINT, 0,
- G_PARAM_READABLE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY);
-
+ g_param_spec_int ("num-toplevels",
+ "Number of toplevels",
+ "The current number of toplevels",
+ 0,
+ G_MAXINT,
+ 0,
+ G_PARAM_READABLE |
+ G_PARAM_STATIC_STRINGS |
+ G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (object_class, PROP_LAST_PROP, props);
/**
@@ -309,13 +192,10 @@ phosh_toplevel_manager_class_init (PhoshToplevelManagerClass *klass)
*
* Emitted whenever a toplevel has been added to the list.
*/
- signals[TOPLEVEL_ADDED] = g_signal_new ("toplevel-added",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE,
- 1,
- PHOSH_TYPE_TOPLEVEL);
+ signals[SIGNAL_TOPLEVEL_ADDED] = g_signal_new (
+ "toplevel-added",
+ G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+ NULL, G_TYPE_NONE, 1, PHOSH_TYPE_TOPLEVEL);
/**
* PhoshToplevelManager::toplevel-changed:
* @manager: The #PhoshToplevelManager emitting the signal.
@@ -323,28 +203,10 @@ phosh_toplevel_manager_class_init (PhoshToplevelManagerClass *klass)
*
* Emitted whenever a toplevel has changed properties.
*/
- signals[TOPLEVEL_CHANGED] = g_signal_new ("toplevel-changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE,
- 1,
- PHOSH_TYPE_TOPLEVEL);
- /**
- * PhoshToplevelManager::toplevel-missing:
- * @manager: The #PhoshToplevelManager emitting the signal.
- * @appinfo: The app info that didn't see a toplevel
- *
- * Emitted whenever an app from launching app list didn't see a
- * toplevel in time.
- */
- signals[TOPLEVEL_MISSING] = g_signal_new ("toplevel-missing",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE,
- 1,
- G_TYPE_APP_INFO);
+ signals[SIGNAL_TOPLEVEL_CHANGED] = g_signal_new (
+ "toplevel-changed",
+ G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+ NULL, G_TYPE_NONE, 1, PHOSH_TYPE_TOPLEVEL);
}
@@ -352,12 +214,11 @@ static void
phosh_toplevel_manager_init (PhoshToplevelManager *self)
{
struct zwlr_foreign_toplevel_manager_v1 *toplevel_manager;
- PhoshWayland *wayland = phosh_wayland_get_default ();
- toplevel_manager = phosh_wayland_get_zwlr_foreign_toplevel_manager_v1 (wayland);
+ toplevel_manager =
+ phosh_wayland_get_zwlr_foreign_toplevel_manager_v1 (phosh_wayland_get_default ());
- self->launching_apps = g_ptr_array_new_with_free_func ((GDestroyNotify)launching_app_info_free);
- self->toplevels = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
+ self->toplevels = g_ptr_array_new_with_free_func ((GDestroyNotify) (g_object_unref));
self->toplevels_pending = g_ptr_array_new ();
if (!toplevel_manager) {
@@ -366,8 +227,7 @@ phosh_toplevel_manager_init (PhoshToplevelManager *self)
}
zwlr_foreign_toplevel_manager_v1_add_listener (toplevel_manager,
- &zwlr_foreign_toplevel_manager_listener,
- self);
+ &zwlr_foreign_toplevel_manager_listener, self);
}
@@ -436,26 +296,3 @@ phosh_toplevel_manager_get_parent (PhoshToplevelManager *self, PhoshToplevel *to
}
return NULL;
}
-
-
-void
-phosh_toplevel_manager_set_app_tracker (PhoshToplevelManager *self,
- PhoshAppTracker *app_tracker)
-{
- g_return_if_fail (PHOSH_IS_TOPLEVEL_MANAGER (self));
- g_return_if_fail (PHOSH_IS_APP_TRACKER (app_tracker));
-
- if (self->app_tracker) {
- g_signal_handlers_disconnect_by_data (self->app_tracker, self);
- g_clear_object (&self->app_tracker);
- }
-
-
- if (app_tracker) {
- self->app_tracker = g_object_ref (app_tracker);
- g_signal_connect_swapped (self->app_tracker,
- "app-launched",
- G_CALLBACK (on_app_launched),
- self);
- }
-}
diff --git a/phosh/src/toplevel-manager.h b/phosh/src/toplevel-manager.h
index 5b1650d50..5ff7aed9d 100644
--- a/phosh/src/toplevel-manager.h
+++ b/phosh/src/toplevel-manager.h
@@ -8,10 +8,9 @@
#include
-#include "app-tracker.h"
#include "toplevel.h"
-#define PHOSH_TYPE_TOPLEVEL_MANAGER (phosh_toplevel_manager_get_type ())
+#define PHOSH_TYPE_TOPLEVEL_MANAGER (phosh_toplevel_manager_get_type())
G_DECLARE_FINAL_TYPE (PhoshToplevelManager,
phosh_toplevel_manager,
@@ -25,5 +24,3 @@ PhoshToplevel *phosh_toplevel_manager_get_toplevel (PhoshToplevelM
guint phosh_toplevel_manager_get_num_toplevels (PhoshToplevelManager *self);
PhoshToplevel *phosh_toplevel_manager_get_parent (PhoshToplevelManager *self,
PhoshToplevel *toplevel);
-void phosh_toplevel_manager_set_app_tracker (PhoshToplevelManager *self,
- PhoshAppTracker *app_tracker);
diff --git a/phosh/src/toplevel.c b/phosh/src/toplevel.c
index baf929e17..4fe57cb6d 100644
--- a/phosh/src/toplevel.c
+++ b/phosh/src/toplevel.c
@@ -13,8 +13,6 @@
#include "shell-priv.h"
#include "util.h"
-#include
-
/**
* PhoshToplevel:
*
diff --git a/phosh/src/ui/activity.ui b/phosh/src/ui/activity.ui
index 656fe3681..058b26e3a 100644
--- a/phosh/src/ui/activity.ui
+++ b/phosh/src/ui/activity.ui
@@ -1,45 +1,40 @@
-
-
- 1
- 1
+
+
+ 1
1
-
vertical
1
- 1
+ 1
1
1
1
-
-
+
+
1
4
4
4
18
-
-
+ contain
-
- -1
-
-
+
1
+ 0
end
@@ -54,17 +49,15 @@
-
- 1
-
+ 0
crossfade
start
start
-
+
1
@@ -80,20 +73,17 @@
-
+
-
- 1
- 1
-
+ 0
crossfade
end
start
-
+
1
@@ -109,24 +99,8 @@
-
-
-
- 1
- 1
-
-
-
-
-
-
- center
- center
+
-
- 1
- 1
-
@@ -134,5 +108,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/phosh/src/ui/app-auth-prompt.ui b/phosh/src/ui/app-auth-prompt.ui
index ad2c91351..57533356c 100644
--- a/phosh/src/ui/app-auth-prompt.ui
+++ b/phosh/src/ui/app-auth-prompt.ui
@@ -1,7 +1,8 @@
-
+
+ btn_grant
@@ -42,10 +43,9 @@
Remember decision
1
- 1
+ 1
center
1
- 1
@@ -54,7 +54,7 @@
Cancel
1
- 1
+ 1
center
@@ -63,9 +63,7 @@
Ok
1
- 1
- 1
- 1
+ 1
center
+
+
+
+
+
+
-
+
1
1
- 6
-
+
1
center
@@ -177,8 +183,8 @@
-
-
+
+
1
1
@@ -196,7 +202,7 @@
-
+
1
48
@@ -206,8 +212,8 @@
-
-
+
+
1
center
@@ -223,21 +229,21 @@
-
- end
-
-
+
1
+
+ folder_grid
+
1
1
1
-
+
1
12
@@ -252,13 +258,15 @@
6
6
-
+
+
+
-
- folder_grid
-
+
+ empty_folder
+
1
vertical
@@ -281,18 +289,21 @@
-
- empty_folder
-
+
+
+
+
-
- folder_page
-
+
+
+
+
+
diff --git a/phosh/src/ui/audio-device-row.ui b/phosh/src/ui/audio-device-row.ui
index 23680db41..5bf9b6b44 100644
--- a/phosh/src/ui/audio-device-row.ui
+++ b/phosh/src/ui/audio-device-row.ui
@@ -1,8 +1,8 @@
-
+
-
+
1
12
@@ -26,16 +26,16 @@
1
crossfade
-
+
1
16
object-select
-
+
-
+
diff --git a/phosh/src/ui/audio-settings.ui b/phosh/src/ui/audio-settings.ui
index efb5243d8..c5d0dc9fa 100644
--- a/phosh/src/ui/audio-settings.ui
+++ b/phosh/src/ui/audio-settings.ui
@@ -1,7 +1,7 @@
-
-
+
+
1
@@ -10,7 +10,7 @@
1
-
+
1
audio-speakers
@@ -28,22 +28,26 @@
1
crossfade
+
+ no-audio-details
+
1
go-next-symbolic
-
- no-audio-details
-
+
+
+
+ audio-details
+
1
go-down-symbolic
-
- audio-details
-
+
+
@@ -59,7 +63,7 @@
1
-
+
1
120
@@ -129,7 +133,7 @@
1
panel.launch-panel
- ("sound", [<"">])
+ "sound"
1
@@ -139,7 +143,7 @@
-
+
diff --git a/phosh/src/ui/brightness-settings.ui b/phosh/src/ui/brightness-settings.ui
index df310916f..7fc4cfe93 100644
--- a/phosh/src/ui/brightness-settings.ui
+++ b/phosh/src/ui/brightness-settings.ui
@@ -1,7 +1,7 @@
-
-
+
+
1
@@ -36,22 +36,26 @@
1
crossfade
+
+ hide-details
+
1
go-next-symbolic
-
- hide-details
-
+
+
+
+ show-details
+
1
go-down-symbolic
-
- show-details
-
+
+
@@ -67,7 +71,7 @@
1
-
+
1
vertical
@@ -82,7 +86,7 @@
1
none
-
+
1
Automatic Brightness
1
@@ -112,7 +116,7 @@
1
panel.launch-panel
- ("power", [<"">])
+ "power"
1
@@ -123,7 +127,7 @@
-
+
diff --git a/phosh/src/ui/bt-device-row.ui b/phosh/src/ui/bt-device-row.ui
index c44df8de7..22cb1248d 100644
--- a/phosh/src/ui/bt-device-row.ui
+++ b/phosh/src/ui/bt-device-row.ui
@@ -1,8 +1,7 @@
-
-
-
+
+
1
1
@@ -21,13 +20,13 @@
1
crossfade
-
+
1
16
object-select
-
+
diff --git a/phosh/src/ui/bt-status-page.ui b/phosh/src/ui/bt-status-page.ui
index 8eb94ea67..8a9ca4dd4 100644
--- a/phosh/src/ui/bt-status-page.ui
+++ b/phosh/src/ui/bt-status-page.ui
@@ -1,6 +1,6 @@
-
+
1
Bluetooth
@@ -12,6 +12,9 @@
crossfade
0
+
+ devices
+
1
none
@@ -19,19 +22,20 @@
-
- devices
-
+
+
+
+ empty-state
+
1
bluetooth-disabled
enable_button
-
- empty-state
-
+
+
@@ -45,7 +49,7 @@
1
1
panel.launch-panel
- ("bluetooth", [<"">])
+ "bluetooth"
0
diff --git a/phosh/src/ui/call-notification.ui b/phosh/src/ui/call-notification.ui
index 8b6dbd66f..213db5c68 100644
--- a/phosh/src/ui/call-notification.ui
+++ b/phosh/src/ui/call-notification.ui
@@ -1,8 +1,8 @@
-
+
-
+
1
vertical
@@ -65,7 +65,7 @@
1
12
-
+
1
start
center
@@ -115,6 +115,6 @@
-
+
diff --git a/phosh/src/ui/cell-broadcast-prompt.ui b/phosh/src/ui/cell-broadcast-prompt.ui
index 5579aaf86..bfc53f5b3 100644
--- a/phosh/src/ui/cell-broadcast-prompt.ui
+++ b/phosh/src/ui/cell-broadcast-prompt.ui
@@ -1,8 +1,9 @@
-
+
+ ok_button
1
@@ -14,11 +15,9 @@
-
+
Ok
1
- 1
- 1
1
-
+
1
asterisk-symbolic
No emergency contacts available.
@@ -148,7 +146,7 @@
-
+
diff --git a/phosh/src/ui/end-session-dialog.ui b/phosh/src/ui/end-session-dialog.ui
index 87989e7e0..b187b0b84 100644
--- a/phosh/src/ui/end-session-dialog.ui
+++ b/phosh/src/ui/end-session-dialog.ui
@@ -1,7 +1,8 @@
-
+
+ btn_confirm
@@ -32,9 +33,10 @@
+ 0
never
1
-
+
none
1
@@ -43,7 +45,7 @@
-
+
@@ -52,7 +54,7 @@
Cancel
1
- 1
+ 1
center
@@ -61,9 +63,7 @@
Ok
1
- 1
- 1
- 1
+ 1
1
center
diff --git a/phosh/src/ui/feedback-status-page.ui b/phosh/src/ui/feedback-status-page.ui
index 41f920735..88c2d7c6d 100644
--- a/phosh/src/ui/feedback-status-page.ui
+++ b/phosh/src/ui/feedback-status-page.ui
@@ -1,6 +1,6 @@
-
+
1
Feedback
@@ -14,10 +14,11 @@
1
none
-
+
1
Do not disturb
1
+ 1
@@ -43,8 +44,7 @@
1
1
panel.launch-mobile-panel
-
- ("feedback", [<"">])
+ "feedback"
0
diff --git a/phosh/src/ui/gtk-mount-prompt.ui b/phosh/src/ui/gtk-mount-prompt.ui
index e8d590800..d02a7b9e4 100644
--- a/phosh/src/ui/gtk-mount-prompt.ui
+++ b/phosh/src/ui/gtk-mount-prompt.ui
@@ -1,7 +1,8 @@
-
+
+ btn_connect
@@ -16,11 +17,11 @@
end
Password:
right
+
+ 0
+ 5
+
-
- 0
- 5
-
@@ -30,11 +31,11 @@
center
1
1
+
+ 1
+ 5
+
-
- 1
- 5
-
@@ -42,16 +43,20 @@
center
dialog-password-symbolic
48
+
+ 0
+ 0
+
-
- 0
- 0
-
1
vertical
+
+ 1
+ 0
+
1
@@ -62,10 +67,6 @@
-
- 1
- 0
-
@@ -73,21 +74,21 @@
end
User:
right
+
+ 0
+ 3
+
-
- 0
- 3
-
1
- 1
+ 1
+
+ 1
+ 3
+
-
- 1
- 3
-
@@ -95,21 +96,21 @@
end
Domain:
right
+
+ 0
+ 4
+
-
- 0
- 4
-
1
- 1
+ 1
+
+ 1
+ 4
+
-
- 1
- 4
-
@@ -117,8 +118,7 @@
gtk-cancel
1
- 1
- 1
+ 1
center
@@ -127,9 +127,7 @@
Co_nnect
1
- 1
- 1
- 1
+ 1
center
1
@@ -139,5 +137,5 @@
-
+
diff --git a/phosh/src/ui/channel-bar.ui b/phosh/src/ui/gvc-channel-bar.ui
similarity index 71%
rename from phosh/src/ui/channel-bar.ui
rename to phosh/src/ui/gvc-channel-bar.ui
index 68a1e5864..028bffeb4 100644
--- a/phosh/src/ui/channel-bar.ui
+++ b/phosh/src/ui/gvc-channel-bar.ui
@@ -1,7 +1,7 @@
-
-
+
+
1
@@ -20,8 +20,12 @@
1
0
adjustment
-
-
+
+
+
+
+
+
diff --git a/phosh/src/ui/home.ui b/phosh/src/ui/home.ui
index 583061dbd..8115b0004 100644
--- a/phosh/src/ui/home.ui
+++ b/phosh/src/ui/home.ui
@@ -1,14 +1,16 @@
-
+
-
-
+ bottom|left|right
+ top
+ phosh home
+
1
vertical
-
+
@@ -31,7 +33,7 @@
400
crossfade
-
+
1
1
@@ -40,6 +42,14 @@
powerbar
center
center
+
+
+
+
+
+
+
+
@@ -47,6 +57,11 @@
+
+
+
+
+
@@ -61,17 +76,11 @@
+
+
+
+
+
-
- evbox_home_bar
-
-
-
- powerbar
-
-
-
-
-
diff --git a/phosh/src/ui/keypad.ui b/phosh/src/ui/keypad.ui
index 68c92da06..870b3e390 100644
--- a/phosh/src/ui/keypad.ui
+++ b/phosh/src/ui/keypad.ui
@@ -1,6 +1,6 @@
-
+
1
6
@@ -23,11 +23,11 @@
+
+ 0
+ 0
+
-
- 0
- 0
-
@@ -43,11 +43,11 @@
+
+ 1
+ 0
+
-
- 1
- 0
-
@@ -63,11 +63,11 @@
+
+ 2
+ 0
+
-
- 2
- 0
-
@@ -83,11 +83,11 @@
+
+ 0
+ 1
+
-
- 0
- 1
-
@@ -103,11 +103,11 @@
+
+ 1
+ 1
+
-
- 1
- 1
-
@@ -123,11 +123,11 @@
+
+ 2
+ 1
+
-
- 2
- 1
-
@@ -143,11 +143,11 @@
+
+ 0
+ 2
+
-
- 0
- 2
-
@@ -163,11 +163,11 @@
+
+ 1
+ 2
+
-
- 1
- 2
-
@@ -183,11 +183,11 @@
+
+ 2
+ 2
+
-
- 2
- 2
-
@@ -203,11 +203,11 @@
+
+ 1
+ 3
+
-
- 1
- 3
-
diff --git a/phosh/src/ui/lockscreen.ui b/phosh/src/ui/lockscreen.ui
index 0eb6242a1..fab700b70 100644
--- a/phosh/src/ui/lockscreen.ui
+++ b/phosh/src/ui/lockscreen.ui
@@ -1,33 +1,32 @@
-
-
+
-
-
-
+ phosh lockscreen
+ 15
+ 3
+
+
1
vertical
- 400
-
+
1
1
- 1
- 400
- box_info
-
-
+
-
+
+ box_widget_box
+ box_widget_box
+
+
1
vertical
32
- 12
-
+
1
start
@@ -38,11 +37,6 @@
-
-
- Back
-
-
1
@@ -51,9 +45,9 @@
-
-
-
+
+
+
1
720
@@ -62,17 +56,23 @@
-
+
+
+
-
+
+ box_info
+ box_info
+
+
1
vertical
1
1
-
+
1
vertical
@@ -99,11 +99,8 @@
-
- end
-
-
-
+
+
1
center
@@ -122,7 +119,6 @@
1
00:00
1
- 0
@@ -137,7 +133,7 @@
1
never
1
-
+
1
vertical
@@ -145,14 +141,14 @@
1
-
-
+
+
1
360
6
1
center
-
+
1
none
@@ -161,9 +157,9 @@
-
+
-
+
@@ -171,36 +167,36 @@
1
-
-
+
+
1
360
6
1
center
-
+
1
center
-
+
-
+
1
-
-
+
+
1
360
6
1
center
-
+
1
none
@@ -208,28 +204,33 @@
-
+
-
+
-
+
-
+
+
+
-
+
+ box_call_display
+ box_call_display
+
+
1
vertical
32
- 12
-
+
1
start
@@ -240,11 +241,6 @@
-
-
- Back
-
-
1
@@ -253,17 +249,19 @@
-
-
+
+
1
-
+
+
+
-
+
@@ -288,13 +286,13 @@
1
- 1
+ 1
0
12
12
0
0.5
- GTK_INPUT_PURPOSE_PASSWORD
+ password
pin_buffer
+
+ 0
+ 0
+
-
- 0
- 0
-
diff --git a/phosh/src/ui/network-auth-prompt.ui b/phosh/src/ui/network-auth-prompt.ui
index 3727546d0..394a733fa 100644
--- a/phosh/src/ui/network-auth-prompt.ui
+++ b/phosh/src/ui/network-auth-prompt.ui
@@ -1,8 +1,9 @@
-
+
+ connect_button
Authentication required
@@ -43,8 +44,6 @@
1
0
- 1
- 1
center
1
C_onnect
@@ -67,11 +66,11 @@
1
end
Password:
+
+ 0
+ 0
+
-
- 0
- 0
-
@@ -82,11 +81,11 @@
1
password_buffer
+
+ 1
+ 0
+
-
- 1
- 0
-
@@ -94,6 +93,6 @@
1
12
-
-
+
+
diff --git a/phosh/src/ui/notification-content.ui b/phosh/src/ui/notification-content.ui
index 3b08a2d4b..229343eca 100644
--- a/phosh/src/ui/notification-content.ui
+++ b/phosh/src/ui/notification-content.ui
@@ -1,9 +1,9 @@
-
+
1
-
+
1
start
@@ -79,6 +79,6 @@
-
+
diff --git a/phosh/src/ui/notification-frame.ui b/phosh/src/ui/notification-frame.ui
index 472f71c5b..68a8e7ee4 100644
--- a/phosh/src/ui/notification-frame.ui
+++ b/phosh/src/ui/notification-frame.ui
@@ -1,7 +1,7 @@
-
-
+
+
1
@@ -13,19 +13,18 @@
1
100
-
+
1
vertical
start
-
-
@@ -79,23 +84,24 @@
0
none
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
- list_notifs
-
-
-
diff --git a/phosh/src/ui/osd-window.ui b/phosh/src/ui/osd-window.ui
index adab838a8..48c5392d0 100644
--- a/phosh/src/ui/osd-window.ui
+++ b/phosh/src/ui/osd-window.ui
@@ -1,6 +1,6 @@
-
+
@@ -21,7 +21,6 @@
1
- gtk-missing-image
16
12
12
@@ -31,6 +30,7 @@
+ 0
center
center
vertical
@@ -58,9 +58,10 @@
+
+
+
+
+
-
- PhoshOsdWindow
-
-
diff --git a/phosh/src/ui/overview.ui b/phosh/src/ui/overview.ui
index fc2cfb4fc..a97d1b7db 100644
--- a/phosh/src/ui/overview.ui
+++ b/phosh/src/ui/overview.ui
@@ -1,14 +1,14 @@
-
-
+
1
vertical
-
+
+ 0
18
6
1
@@ -18,7 +18,7 @@
-
+
1
diff --git a/phosh/src/ui/password-entry.ui b/phosh/src/ui/password-entry.ui
index f3208128a..ecb26c249 100644
--- a/phosh/src/ui/password-entry.ui
+++ b/phosh/src/ui/password-entry.ui
@@ -1,6 +1,6 @@
-
+
password
0
diff --git a/phosh/src/ui/polkit-auth-prompt.ui b/phosh/src/ui/polkit-auth-prompt.ui
index 540a1b08a..ac29bbc39 100644
--- a/phosh/src/ui/polkit-auth-prompt.ui
+++ b/phosh/src/ui/polkit-auth-prompt.ui
@@ -1,7 +1,8 @@
-
+
+ btn_authenticate
Authentication required
@@ -17,10 +18,11 @@
-
+
1
center
- 48
+ dialog-password-symbolic
+ 48
@@ -70,35 +72,34 @@
gtk-cancel
1
- 1
+ 1
1
center
1
- 1
1
- 1
- 1
- 1
+ 1
-
+
1
center
5
-
+
1
Authenticate
-
-
-
-
+
+
+
+ 0
+
+
+
+
-
- poweroff
-
+
+ suspend
+
1
1
@@ -118,15 +123,14 @@
-
- suspend
-
+
+
+
+ 0
+ 0
+
-
- 0
- 0
-
@@ -163,11 +167,11 @@
+
+ 1
+ 0
+
-
- 1
- 0
-
@@ -204,11 +208,11 @@
+
+ 0
+ 1
+
-
- 0
- 1
-
@@ -246,11 +250,11 @@
+
+ 1
+ 1
+
-
- 1
- 1
-
diff --git a/phosh/src/ui/quick-setting.ui b/phosh/src/ui/quick-setting.ui
index 88b7c99a6..65b60e9b8 100644
--- a/phosh/src/ui/quick-setting.ui
+++ b/phosh/src/ui/quick-setting.ui
@@ -1,6 +1,6 @@
-
+
1
@@ -23,6 +23,17 @@
+
+
+
+
+
+
+
+ 3
+
+
+
@@ -32,6 +43,7 @@
+ 0
0
@@ -44,13 +56,4 @@
-
- primary
-
-
-
- 3
- primary
-
-
diff --git a/phosh/src/ui/quick-settings-box.ui b/phosh/src/ui/quick-settings-box.ui
index ade47dddd..65b12dc25 100644
--- a/phosh/src/ui/quick-settings-box.ui
+++ b/phosh/src/ui/quick-settings-box.ui
@@ -1,7 +1,7 @@
-
-
+
+
1
diff --git a/phosh/src/ui/quick-settings.ui b/phosh/src/ui/quick-settings.ui
index 147aa82db..5eb9b0ad4 100644
--- a/phosh/src/ui/quick-settings.ui
+++ b/phosh/src/ui/quick-settings.ui
@@ -1,7 +1,7 @@
-
-
+
+
1
@@ -13,7 +13,7 @@
wwaninfo
panel.launch-panel
- ("wwan", [<"">])
+ "wwan"
@@ -24,7 +24,7 @@
wifiinfo
wifi_status_page
panel.launch-panel
- ("wifi", [<"">])
+ "wifi"
@@ -35,7 +35,7 @@
btinfo
bt_status_page
panel.launch-panel
- ("bluetooth", [<"">])
+ "bluetooth"
@@ -45,7 +45,7 @@
batteryinfo
panel.launch-panel
- ("power", [<"">])
+ "power"
@@ -64,7 +64,7 @@
feedbackinfo
feedback_status_page
panel.launch-panel
- ("notifications", [<"">])
+ "notifications"
@@ -73,7 +73,7 @@
torchinfo
panel.launch-panel
- ("power", [<"">])
+ "power"
@@ -82,7 +82,7 @@
dockedinfo
panel.launch-panel
- ("display", [<"">])
+ "display"
@@ -91,7 +91,7 @@
vpninfo
panel.launch-panel
- ("network", [<"">])
+ "network"
diff --git a/phosh/src/ui/revealer.ui b/phosh/src/ui/revealer.ui
index d739ceb4e..1302309d4 100644
--- a/phosh/src/ui/revealer.ui
+++ b/phosh/src/ui/revealer.ui
@@ -1,7 +1,7 @@
-
+
-
-
+
+
1
diff --git a/phosh/src/ui/run-command-dialog.ui b/phosh/src/ui/run-command-dialog.ui
index 60a8db1a2..0c60606c7 100644
--- a/phosh/src/ui/run-command-dialog.ui
+++ b/phosh/src/ui/run-command-dialog.ui
@@ -1,6 +1,6 @@
-
+
Run Command
@@ -12,7 +12,7 @@
1
- 1
+ 1
240
diff --git a/phosh/src/ui/settings.ui b/phosh/src/ui/settings.ui
index 942be59d8..48176dd04 100644
--- a/phosh/src/ui/settings.ui
+++ b/phosh/src/ui/settings.ui
@@ -1,8 +1,7 @@
-
-
-
+
+
250
@@ -12,7 +11,7 @@
1
150
-
+
1
720
1
@@ -21,7 +20,7 @@
1
vertical
-
+
1
360
@@ -51,7 +50,7 @@
1
-
+
1
5
@@ -73,11 +72,11 @@
-
+
-
+
1
360
@@ -97,6 +96,9 @@
1
crossfade
+
+ no-notifications
+
1
vertical
@@ -130,11 +132,13 @@
-
- no-notifications
-
+
+
+
+ notifications
+
1
vertical
@@ -183,9 +187,8 @@
-
- notifications
-
+
+
diff --git a/phosh/src/ui/splash.ui b/phosh/src/ui/splash.ui
index 86ad73d44..8f45c067f 100644
--- a/phosh/src/ui/splash.ui
+++ b/phosh/src/ui/splash.ui
@@ -1,6 +1,6 @@
-
+
@@ -10,7 +10,6 @@
1
- gtk-missing-image
192
end
1
@@ -22,7 +21,7 @@
1
- 1
+ 1
80
32
32
@@ -33,5 +32,10 @@
+
+
+
+
+
diff --git a/phosh/src/ui/status-icon.ui b/phosh/src/ui/status-icon.ui
index 2abe5f796..80524cf04 100644
--- a/phosh/src/ui/status-icon.ui
+++ b/phosh/src/ui/status-icon.ui
@@ -1,7 +1,8 @@
-
-
+
+
+ 0
1
diff --git a/phosh/src/ui/status-page-placeholder.ui b/phosh/src/ui/status-page-placeholder.ui
index e7988f257..0524c0112 100644
--- a/phosh/src/ui/status-page-placeholder.ui
+++ b/phosh/src/ui/status-page-placeholder.ui
@@ -1,7 +1,7 @@
-
-
+
+
1
@@ -23,6 +23,7 @@
+ 0
1
word-char
center
diff --git a/phosh/src/ui/status-page.ui b/phosh/src/ui/status-page.ui
index 9ba0f213b..03f87ff42 100644
--- a/phosh/src/ui/status-page.ui
+++ b/phosh/src/ui/status-page.ui
@@ -1,7 +1,7 @@
-
-
+
+
start
@@ -13,11 +13,10 @@
-
@@ -42,10 +40,14 @@
-
+
-
+
diff --git a/phosh/src/ui/system-modal-dialog.ui b/phosh/src/ui/system-modal-dialog.ui
index 69bcaefc2..c6310d351 100644
--- a/phosh/src/ui/system-modal-dialog.ui
+++ b/phosh/src/ui/system-modal-dialog.ui
@@ -1,7 +1,6 @@
-
-
+
@@ -9,7 +8,7 @@
vertical
-
+
1
400
@@ -22,6 +21,7 @@
24
+ 0
center
12
6
diff --git a/phosh/src/ui/system-prompt.ui b/phosh/src/ui/system-prompt.ui
index bc7fadc55..b229422c0 100644
--- a/phosh/src/ui/system-prompt.ui
+++ b/phosh/src/ui/system-prompt.ui
@@ -1,7 +1,8 @@
-
+
+ btn_continue
@@ -14,23 +15,23 @@
center
center
1
+
+ 0
+ 0
+ 2
+
-
- 0
- 0
- 2
-
1
end
Password:
+
+ 0
+ 1
+
-
- 0
- 1
-
@@ -39,22 +40,22 @@
center
1
1
+
+ 1
+ 1
+
-
- 1
- 1
-
1
end
Confirm:
+
+ 0
+ 2
+
-
- 0
- 2
-
@@ -62,21 +63,21 @@
center
1
1
+
+ 1
+ 2
+
-
- 1
- 2
-
1
1
+
+ 1
+ 3
+
-
- 1
- 3
-
@@ -89,22 +90,26 @@
+
+ 0
+ 4
+ 2
+
-
- 0
- 4
- 2
-
1
6
+
+ 0
+ 5
+ 2
+
1
- 1
- 1
+ 1
@@ -116,29 +121,21 @@
-
- 0
- 5
- 2
-
1
- 1
+ 1
center
- 1
1
- 1
- 1
- 1
+ 1
center
1
diff --git a/phosh/src/ui/timestamp-label.ui b/phosh/src/ui/timestamp-label.ui
index daa688731..3cef495bc 100644
--- a/phosh/src/ui/timestamp-label.ui
+++ b/phosh/src/ui/timestamp-label.ui
@@ -1,8 +1,7 @@
-
-
- 1
+
+
1
diff --git a/phosh/src/ui/top-panel.ui b/phosh/src/ui/top-panel.ui
index 6ebef3c8a..c77433fcc 100644
--- a/phosh/src/ui/top-panel.ui
+++ b/phosh/src/ui/top-panel.ui
@@ -1,8 +1,8 @@
-
+
-
+
-
+ top|left|right
+ phosh top-panel
+ top
+
1
vertical
-
+
1
-
+
panel.lockscreen
@@ -149,8 +152,8 @@
-
-
+
+
1
vertical
@@ -172,8 +175,8 @@
-
-
+
+
-
- end
-
-
+
@@ -205,11 +205,14 @@
1
crossfade
+
+ top-bar
+
1
top-bar-bin
-
+
1
1
1
@@ -217,7 +220,9 @@
top-bar
32
-
+
+
+
1
@@ -265,7 +270,9 @@
-
+
+
+
1
2
@@ -274,8 +281,10 @@
-
-
+
+
+
+
1
end
@@ -326,34 +335,34 @@
-
- end
-
+
+
-
- top-bar
-
-
+
+
+
-
+
+ arrow
+
+
1
-
+
1
1
end
6
- 1
1
-
-
+
+
1
crossfade
@@ -361,8 +370,7 @@
1
panel.launch-mobile-panel
-
- ("topbar", [<"">])
+ "topbar"
end
end
settings-gear
@@ -376,19 +384,21 @@
-
- end
-
-
+
+
+
-
- arrow
-
+
+
+
+ target
+
+
@@ -437,9 +447,4 @@
16
8
-
- PhoshTopPanel
- target
-
-
diff --git a/phosh/src/ui/widget-box.ui b/phosh/src/ui/widget-box.ui
index 63eb489c7..3a2aa3b72 100644
--- a/phosh/src/ui/widget-box.ui
+++ b/phosh/src/ui/widget-box.ui
@@ -1,16 +1,15 @@
-
+
vertical
-
+
1
- 400
-
+
1
carousel
diff --git a/phosh/src/ui/wifi-network-row.ui b/phosh/src/ui/wifi-network-row.ui
index 3a048c09a..d1469f0ab 100644
--- a/phosh/src/ui/wifi-network-row.ui
+++ b/phosh/src/ui/wifi-network-row.ui
@@ -1,9 +1,7 @@
-
-
-
- 1
+
+
1
diff --git a/phosh/src/ui/wifi-status-page.ui b/phosh/src/ui/wifi-status-page.ui
index 49cba6474..b6a21a805 100644
--- a/phosh/src/ui/wifi-status-page.ui
+++ b/phosh/src/ui/wifi-status-page.ui
@@ -1,6 +1,6 @@
-
+
1
Wi-Fi
@@ -10,6 +10,9 @@
+
+ button
+
1
center
@@ -25,11 +28,13 @@
-
- button
-
+
+
+
+ spinner
+
1
4
@@ -37,9 +42,8 @@
4
4
-
- spinner
-
+
+
@@ -47,15 +51,20 @@
crossfade
0
+
+ empty-state
+
1
empty_state_btn
-
- empty-state
-
+
+
+
+ list_box
+
1
none
@@ -65,9 +74,8 @@
-
- list_box
-
+
+
@@ -81,7 +89,7 @@
1
0
panel.launch-panel
- ("wifi", [<"">])
+ "wifi"
1
diff --git a/phosh/src/util.c b/phosh/src/util.c
index e39c5847e..9f902115d 100644
--- a/phosh/src/util.c
+++ b/phosh/src/util.c
@@ -46,7 +46,8 @@ static gboolean have_gnome_software = -1;
void
phosh_cp_widget_destroy (void *widget)
{
- gtk_widget_destroy (GTK_WIDGET (widget));
+ g_return_if_fail (GTK_IS_WINDOW (widget));
+ gtk_window_destroy (GTK_WINDOW (widget));
}
@@ -83,12 +84,8 @@ phosh_get_desktop_app_info_for_app_id (const char *app_id)
if (app_info)
return g_object_ref (app_info);
- app_info = phosh_app_list_model_lookup_by_exec (model, app_id);
- if (app_info)
- return g_object_ref (app_info);
-
/* try to handle the case where app-id is rev-DNS, but desktop file is not */
- last_component = strrchr (app_id, '.');
+ last_component = strrchr(app_id, '.');
if (last_component) {
/* Skip past '.' */
last_component++;
@@ -108,10 +105,6 @@ phosh_get_desktop_app_info_for_app_id (const char *app_id)
if (app_info)
return g_object_ref (app_info);
- app_info = phosh_app_list_model_lookup_by_exec (model, lowercase);
- if (app_info)
- return g_object_ref (app_info);
-
g_message ("Could not find application for app-id '%s'", app_id);
return NULL;
}
@@ -459,8 +452,6 @@ phosh_util_gesture_is_touch (GtkGestureSingle *gesture)
GdkDevice *device;
#define PHOSH_BUTTON_MASK (GDK_BUTTON_PRESS | \
- GDK_2BUTTON_PRESS | \
- GDK_3BUTTON_PRESS | \
GDK_BUTTON_RELEASE)
g_return_val_if_fail (GTK_IS_GESTURE_SINGLE (gesture), FALSE);
@@ -471,11 +462,10 @@ phosh_util_gesture_is_touch (GtkGestureSingle *gesture)
if (event == NULL)
return FALSE;
- if ((event->type & PHOSH_BUTTON_MASK) == 0)
+ if ((gdk_event_get_event_type ((GdkEvent *) event) & PHOSH_BUTTON_MASK) == 0)
return FALSE;
- device = gdk_event_get_source_device (event);
-
+ device = gtk_gesture_get_device (GTK_GESTURE (gesture));
if (device == NULL)
return FALSE;
@@ -517,12 +507,10 @@ phosh_util_have_gnome_software (gboolean scan)
void
phosh_util_toggle_style_class (GtkWidget *widget, const char *style_class, gboolean toggle)
{
- GtkStyleContext *context = gtk_widget_get_style_context (widget);
-
if (toggle)
- gtk_style_context_add_class (context, style_class);
+ gtk_widget_add_css_class (widget, style_class);
else
- gtk_style_context_remove_class (context, style_class);
+ gtk_widget_remove_css_class (widget, style_class);
}
@@ -801,7 +789,6 @@ on_activate_action_dbus_proxy_ready (GObject *source_object, GAsyncResult *res,
g_autoptr (GError) err = NULL;
GCancellable *cancel;
GVariant *params;
- gboolean has_actions = FALSE;
proxy = g_dbus_proxy_new_for_bus_finish (res, &err);
if (proxy == NULL) {
@@ -810,12 +797,9 @@ on_activate_action_dbus_proxy_ready (GObject *source_object, GAsyncResult *res,
}
params = g_task_get_task_data (task);
- if (g_variant_is_of_type (params, G_VARIANT_TYPE ("(sava{sv})")))
- has_actions = TRUE;
-
cancel = g_task_get_cancellable (task);
g_dbus_proxy_call (proxy,
- has_actions ? "ActivateAction" : "Activate",
+ "ActivateAction",
params,
G_DBUS_CALL_FLAGS_NONE,
-1,
@@ -824,52 +808,33 @@ on_activate_action_dbus_proxy_ready (GObject *source_object, GAsyncResult *res,
g_steal_pointer (&task));
}
-
-
-static char *
-app_path_for_id (const char *app_id)
-{
- char *path;
- int i;
-
- path = g_strconcat ("/", app_id, NULL);
- for (i = 0; path[i]; i++) {
- if (path[i] == '.')
- path[i] = '/';
- if (path[i] == '-')
- path[i] = '_';
- }
-
- return path;
-}
-
/**
* phosh_util_activate_action:
* @info: The app info
- * @action:(nullable): The action name
+ * @action: The action name
* @params:(nullable): The action parameters
* @cancel:(nullable): A cancellable
* @callback:(scope async): The callback to invoked
* @user_data:(nullable): user data
*
- * Asynchronously activate the given app corresponding to `info` and
- * invoke the given action on it. If `action` is `NULL` the app is merely
- * activated.
+ * Asynchronously invoke the given action on the app corresponding to
+ * `info`.
*/
-void
+static void
phosh_util_activate_action (GAppInfo *info,
const char *action,
GVariant *params,
+ const char *object_path,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_autoptr (GTask) task = NULL;
g_autoptr (GVariant) args = NULL;
- g_autofree char *app_id = NULL, *object_path = NULL;
+ g_autofree char *app_id = NULL;
g_return_if_fail (G_IS_APP_INFO (info) || info == NULL);
- g_return_if_fail (!action || !gm_str_is_null_or_empty (action));
+ g_return_if_fail (!gm_str_is_null_or_empty (action));
g_return_if_fail (params == NULL || g_variant_is_of_type (params, G_VARIANT_TYPE ("av")));
app_id = phosh_strip_suffix_from_app_id (g_app_info_get_id (info));
@@ -878,21 +843,16 @@ phosh_util_activate_action (GAppInfo *info,
task = g_task_new (NULL, cancellable, callback, user_data);
g_task_set_source_tag (task, phosh_util_activate_action);
- if (action) {
- if (!params)
- params = g_variant_new ("av", NULL);
+ if (!params)
+ params = g_variant_new("av", NULL);
- /* Sink ref so we can use `g_variant_unref` for the task's `destroy_notify` */
- args = g_variant_ref_sink (g_variant_new ("(s@av@a{sv})",
- action,
- params,
- phosh_util_get_platform_data (info)));
- } else {
- args = g_variant_ref_sink (g_variant_new ("(@a{sv})", phosh_util_get_platform_data (info)));
- }
+ /* Sink ref so we can use `g_variant_unref` for the task's `destroy_notify` */
+ args = g_variant_ref_sink (g_variant_new ("(s@av@a{sv})",
+ action,
+ params,
+ phosh_util_get_platform_data (info)));
g_task_set_task_data (task, g_steal_pointer (&args), (GDestroyNotify) g_variant_unref);
- object_path = app_path_for_id (app_id);
g_dbus_proxy_new_for_bus (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
@@ -915,7 +875,7 @@ phosh_util_activate_action (GAppInfo *info,
*
* Completes the async operation started with `phosh_util_activate_action`.
*/
-gboolean
+static gboolean
phosh_util_activate_action_finish (GAsyncResult *res, GError **err)
{
g_return_val_if_fail (G_IS_ASYNC_RESULT (res), FALSE);
@@ -927,7 +887,6 @@ phosh_util_activate_action_finish (GAsyncResult *res, GError **err)
/**
* phosh_util_open_settings_panel:
* @panel: A settings panel name
- * @params: Panel specific parameters, can be empty but not null
* @mobile: panel is in mobile settings app
* @cancellable:(nullable): A cancellable
* @callback:(scope async): The callback to invoke when the async operation finished
@@ -936,32 +895,31 @@ phosh_util_activate_action_finish (GAsyncResult *res, GError **err)
*/
void
phosh_util_open_settings_panel (const char *panel,
- GVariant *params,
gboolean mobile,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_autoptr (GDesktopAppInfo) info = NULL;
- const char *action;
+ const char *object_path, *action;
GVariantBuilder builder;
- g_return_if_fail (params != NULL);
-
if (mobile) {
info = g_desktop_app_info_new ("mobi.phosh.MobileSettings.desktop");
+ object_path = "/mobi/phosh/MobileSettings";
action = "set-panel";
} else {
info = g_desktop_app_info_new ("org.gnome.Settings.desktop");
+ object_path = "/org/gnome/Settings";
action = "launch-panel";
}
g_variant_builder_init_static (&builder, G_VARIANT_TYPE ("av"));
- g_variant_builder_add (&builder, "v", g_variant_new ("(s@av)", panel, params));
-
+ g_variant_builder_add (&builder, "v", g_variant_new ("(sav)", panel, NULL));
phosh_util_activate_action (G_APP_INFO (info),
action,
g_variant_builder_end (&builder),
+ object_path,
cancellable,
callback,
user_data);
diff --git a/phosh/src/util.h b/phosh/src/util.h
index c5138dfac..99d40a378 100644
--- a/phosh/src/util.h
+++ b/phosh/src/util.h
@@ -78,7 +78,6 @@ gboolean phosh_util_matches_app_info (GAppInfo *info, const char *search
GStrv phosh_util_append_to_strv (GStrv array, const char *element);
GStrv phosh_util_remove_from_strv (GStrv array, const char *element);
void phosh_util_open_settings_panel (const char *panel,
- GVariant *params,
gboolean mobile,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -88,13 +87,6 @@ float * phosh_util_calculate_supported_mode_scales (guint32 width,
guint32 height,
int *n_supported_scales,
gboolean fractional);
-void phosh_util_activate_action (GAppInfo *info,
- const char *action,
- GVariant *params,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-gboolean phosh_util_activate_action_finish (GAsyncResult *res, GError **err);
GVariant * phosh_util_get_platform_data (GAppInfo *info);
diff --git a/phosh/src/widget-box.c b/phosh/src/widget-box.c
index e87c41529..424195e19 100644
--- a/phosh/src/widget-box.c
+++ b/phosh/src/widget-box.c
@@ -13,7 +13,7 @@
#include "plugin-loader.h"
#include "widget-box.h"
-#include
+#include
#include
/**
@@ -48,14 +48,14 @@ G_DEFINE_TYPE (PhoshWidgetBox, phosh_widget_box, GTK_TYPE_BOX)
static GtkWidget *
missing_plugin_widget_new (const char *plugin)
{
- GtkWidget *widget = hdy_status_page_new ();
+ GtkWidget *widget = adw_status_page_new ();
g_autofree char *msg = NULL;
- hdy_status_page_set_title (HDY_STATUS_PAGE (widget), _("Plugin not found"));
+ adw_status_page_set_title (ADW_STATUS_PAGE (widget), _("Plugin not found"));
- hdy_status_page_set_icon_name (HDY_STATUS_PAGE (widget), "dialog-error-symbolic");
+ adw_status_page_set_icon_name (ADW_STATUS_PAGE (widget), "dialog-error-symbolic");
msg = g_strdup_printf (_("The plugin '%s' could not be loaded."), plugin);
- hdy_status_page_set_description (HDY_STATUS_PAGE (widget), msg);
+ adw_status_page_set_description (ADW_STATUS_PAGE (widget), msg);
return widget;
}
@@ -64,14 +64,17 @@ missing_plugin_widget_new (const char *plugin)
static void
phosh_widget_box_load_widgets (PhoshWidgetBox *self)
{
- g_autoptr (GList) children = NULL;
+ int n;
if (self->plugin_loader == NULL)
return;
- children = gtk_container_get_children (GTK_CONTAINER (self->carousel));
- for (GList *elem = children; elem; elem = elem->next)
- gtk_container_remove (GTK_CONTAINER (self->carousel), GTK_WIDGET (elem->data));
+ n = adw_carousel_get_n_pages (ADW_CAROUSEL (self->carousel)) - 1;
+ while (n >= 0) {
+ GtkWidget *child = adw_carousel_get_nth_page (ADW_CAROUSEL (self->carousel), n);
+ adw_carousel_remove (ADW_CAROUSEL (self->carousel), child);
+ n -= 1;
+ }
for (int i = 0; i < g_strv_length (self->plugins); i++) {
GtkWidget *widget = phosh_plugin_loader_load_plugin (self->plugin_loader, self->plugins[i]);
@@ -83,7 +86,7 @@ phosh_widget_box_load_widgets (PhoshWidgetBox *self)
gtk_widget_set_visible (widget, TRUE);
gtk_widget_set_hexpand (widget, TRUE);
- hdy_carousel_insert (HDY_CAROUSEL (self->carousel), widget, -1);
+ adw_carousel_insert (ADW_CAROUSEL (self->carousel), widget, -1);
}
}
@@ -150,6 +153,15 @@ phosh_widget_box_constructed (GObject *object)
}
+static void
+phosh_widget_box_dispose (GObject *object)
+{
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_WIDGET_BOX);
+
+ G_OBJECT_CLASS (phosh_widget_box_parent_class)->dispose (object);
+}
+
+
static void
phosh_widget_box_finalize (GObject *object)
{
@@ -172,6 +184,7 @@ phosh_widget_box_class_init (PhoshWidgetBoxClass *klass)
object_class->get_property = phosh_widget_box_get_property;
object_class->set_property = phosh_widget_box_set_property;
object_class->constructed = phosh_widget_box_constructed;
+ object_class->dispose = phosh_widget_box_dispose;
object_class->finalize = phosh_widget_box_finalize;
props[PROP_PLUGIN_DIRS] =
diff --git a/phosh/src/wifi-network-row.c b/phosh/src/wifi-network-row.c
index 5a705a637..96b711e7c 100644
--- a/phosh/src/wifi-network-row.c
+++ b/phosh/src/wifi-network-row.c
@@ -24,7 +24,7 @@ enum {
static GParamSpec *props[PROP_LAST_PROP];
struct _PhoshWifiNetworkRow {
- HdyActionRow parent;
+ AdwActionRow parent;
GtkWidget *wifi_icon;
GtkWidget *encrypted_icon;
@@ -33,7 +33,7 @@ struct _PhoshWifiNetworkRow {
PhoshWifiNetwork *network;
};
-G_DEFINE_TYPE (PhoshWifiNetworkRow, phosh_wifi_network_row, HDY_TYPE_ACTION_ROW);
+G_DEFINE_TYPE (PhoshWifiNetworkRow, phosh_wifi_network_row, ADW_TYPE_ACTION_ROW);
static gboolean
update_icon (GBinding *binding,
@@ -122,6 +122,8 @@ phosh_wifi_network_row_dispose (GObject *object)
g_clear_object (&self->network);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_WIFI_NETWORK_ROW);
+
G_OBJECT_CLASS (phosh_wifi_network_row_parent_class)->dispose (object);
}
diff --git a/phosh/src/wifi-network-row.h b/phosh/src/wifi-network-row.h
index 96537383b..7e6b34734 100644
--- a/phosh/src/wifi-network-row.h
+++ b/phosh/src/wifi-network-row.h
@@ -6,8 +6,7 @@
#pragma once
-#include
-#include
+#include
#include "util.h"
#include "wifi-network.h"
@@ -15,7 +14,7 @@ G_BEGIN_DECLS
#define PHOSH_TYPE_WIFI_NETWORK_ROW phosh_wifi_network_row_get_type ()
G_DECLARE_FINAL_TYPE (PhoshWifiNetworkRow, phosh_wifi_network_row, PHOSH, WIFI_NETWORK_ROW,
- HdyActionRow)
+ AdwActionRow)
GtkWidget *phosh_wifi_network_row_new (PhoshWifiNetwork *network);
diff --git a/phosh/src/wifi-status-page.c b/phosh/src/wifi-status-page.c
index eb55eaa90..637bb0531 100644
--- a/phosh/src/wifi-status-page.c
+++ b/phosh/src/wifi-status-page.c
@@ -182,6 +182,8 @@ phosh_wifi_status_page_dispose (GObject *object)
g_clear_pointer (&self->connecting_network, g_free);
+ gtk_widget_dispose_template (GTK_WIDGET (object), PHOSH_TYPE_WIFI_STATUS_PAGE);
+
G_OBJECT_CLASS (phosh_wifi_status_page_parent_class)->dispose (object);
}
diff --git a/phosh/subprojects/gvc.wrap b/phosh/subprojects/gvc.wrap
index 83abf8d93..ae3d1b706 100644
--- a/phosh/subprojects/gvc.wrap
+++ b/phosh/subprojects/gvc.wrap
@@ -1,5 +1,5 @@
[wrap-git]
directory=gvc
-url=https://gitlab.gnome.org/GNOME/libgnome-volume-control.git
-revision=d2442f455844e5292cb4a74ffc66ecc8d7595a9f
+url=https://gitlab.gnome.org/guidog/libgnome-volume-control.git
+revision=1cdc1cb2d622d64e9ad2781093bcc63719c5ea5b
depth=1
diff --git a/phosh/subprojects/libcall-ui.wrap b/phosh/subprojects/libcall-ui.wrap
index 08755f107..29759e4b5 100644
--- a/phosh/subprojects/libcall-ui.wrap
+++ b/phosh/subprojects/libcall-ui.wrap
@@ -1,5 +1,5 @@
[wrap-git]
directory=libcall-ui
-url=https://gitlab.gnome.org/World/Phosh/libcall-ui/
-revision=v0.1.5
+url=https://gitlab.gnome.org/World/Phosh/libcall-ui.git
+revision=f66056ace818ff19b507335634dd67138a92c77f
depth=1
diff --git a/phosh/subprojects/packagefiles/gtk4-layer-shell/0001-tree-Add-configure-callback-and-remove-default-size.patch b/phosh/subprojects/packagefiles/gtk4-layer-shell/0001-tree-Add-configure-callback-and-remove-default-size.patch
new file mode 100644
index 000000000..e2766a38e
--- /dev/null
+++ b/phosh/subprojects/packagefiles/gtk4-layer-shell/0001-tree-Add-configure-callback-and-remove-default-size.patch
@@ -0,0 +1,96 @@
+From d7c9d071cdaf148d7ca2b512fab9a9cbdb0d1d37 Mon Sep 17 00:00:00 2001
+From: Arun Mani J
+Date: Fri, 9 May 2025 15:10:56 +0530
+Subject: [PATCH] tree: Add configure callback and remove default size
+
+---
+ include/gtk4-layer-shell.h | 2 +-
+ src/gtk4-layer-shell.c | 4 +++-
+ src/layer-surface.c | 7 +++++--
+ src/layer-surface.h | 3 +++
+ 4 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/include/gtk4-layer-shell.h b/include/gtk4-layer-shell.h
+index d954285..18bc244 100644
+--- a/include/gtk4-layer-shell.h
++++ b/include/gtk4-layer-shell.h
+@@ -137,7 +137,7 @@ guint gtk_layer_get_protocol_version();
+ * Set the @window up to be a layer surface once it is mapped. this must be called before
+ * the @window is realized.
+ */
+-void gtk_layer_init_for_window(GtkWindow* window);
++void gtk_layer_init_for_window(GtkWindow* window, void (*configure)(uint32_t w, uint32_t h, void *data), void *data);
+
+ /**
+ * gtk_layer_is_layer_window:
+diff --git a/src/gtk4-layer-shell.c b/src/gtk4-layer-shell.c
+index 686b60d..c736d07 100644
+--- a/src/gtk4-layer-shell.c
++++ b/src/gtk4-layer-shell.c
+@@ -151,7 +151,7 @@ static void gtk_layer_surface_remap(struct layer_surface_t* super) {
+ }
+
+ GTK4_LAYER_SHELL_EXPORT
+-void gtk_layer_init_for_window(GtkWindow* window) {
++void gtk_layer_init_for_window(GtkWindow* window, void (*configure)(uint32_t w, uint32_t h, void *data), void *data) {
+ if (!GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default())) {
+ g_warning("Failed to initialize layer surface, not on Wayland");
+ return;
+@@ -186,6 +186,8 @@ void gtk_layer_init_for_window(GtkWindow* window) {
+ layer_surface->super = layer_surface_make();
+ layer_surface->super.remap = gtk_layer_surface_remap;
+ layer_surface->super.get_preferred_size = gtk_layer_surface_get_preferred_size;
++ layer_surface->super.data = data;
++ layer_surface->super.configure = configure;
+ g_object_set_data_full(G_OBJECT(window), layer_surface_key, layer_surface, (GDestroyNotify)gtk_layer_surface_destroy);
+
+ all_layer_surfaces = g_list_append(all_layer_surfaces, layer_surface);
+diff --git a/src/layer-surface.c b/src/layer-surface.c
+index 90e9c45..adfb64a 100644
+--- a/src/layer-surface.c
++++ b/src/layer-surface.c
+@@ -15,8 +15,8 @@ static void layer_surface_send_set_size(struct layer_surface_t* self) {
+ struct geom_size_t size = self->last_xdg_window_geom_size;
+
+ // Default values because setting 0 is only allowed when anchored
+- if (size.width <= 0) size.width = 200;
+- if (size.height <= 0) size.height = 200;
++ if (size.width <= 0) size.width = 0;
++ if (size.height <= 0) size.height = 0;
+
+ if (self->anchored.left && self->anchored.right) {
+ size.width = 0;
+@@ -54,6 +54,8 @@ static void layer_surface_configure_xdg_surface(
+ if (self->anchored.top && self->anchored.bottom && self->last_layer_configured_size.height > 0) {
+ size.height = self->last_layer_configured_size.height;
+ }
++ size.width = self->last_layer_configured_size.width;
++ size.height = self->last_layer_configured_size.height;
+
+ // Ideally this wouldn't be needed, see the layer_surface_t.get_preferred_size documentation
+ if (self->get_preferred_size && (size.width == 0 || size.height == 0)) {
+@@ -96,6 +98,7 @@ static void layer_surface_handle_configure(
+ self->last_layer_configured_size = (struct geom_size_t){w, h};
+ self->has_initial_layer_shell_configure = true;
+ layer_surface_configure_xdg_surface(self, serial, true);
++ self->configure(w, h, self->data);
+ }
+
+ static void layer_surface_handle_closed(void* data, struct zwlr_layer_surface_v1* _surface) {
+diff --git a/src/layer-surface.h b/src/layer-surface.h
+index e955147..6b0397f 100644
+--- a/src/layer-surface.h
++++ b/src/layer-surface.h
+@@ -18,6 +18,9 @@ struct geom_size_t {
+ struct layer_surface_t {
+ struct xdg_surface_server_t super;
+
++ void *data;
++ void (*configure)(uint32_t w, uint32_t h, void *data);
++
+ // Virtual functions (NULL by default, can be overridden by the user of this library)
+ // Ask the toolkit to unmap and remap the surface
+ void (*remap)(struct layer_surface_t* super);
+--
+2.48.1
+
diff --git a/phosh/tests/services/meson.build b/phosh/tests/services/meson.build
index 6caea2b3a..e5f854cec 100644
--- a/phosh/tests/services/meson.build
+++ b/phosh/tests/services/meson.build
@@ -23,5 +23,5 @@ mock_search_provider_exec = executable(
'mock-search-provider',
sources,
include_directories: root_inc,
- dependencies: [gio_dep, glib_dep, gtk_dep],
+ dependencies: [gio_dep, gio_unix_dep, glib_dep, gtk_dep],
)
diff --git a/phosh/tests/stubs/phosh.c b/phosh/tests/stubs/phosh.c
index 15c2a226c..16baca986 100644
--- a/phosh/tests/stubs/phosh.c
+++ b/phosh/tests/stubs/phosh.c
@@ -136,20 +136,6 @@ phosh_shell_get_launcher_entry_manager (PhoshShell *self)
}
-PhoshSplashManager *
-phosh_shell_get_splash_manager (PhoshShell *self)
-{
- return NULL;
-}
-
-
-gboolean
-phosh_shell_get_show_splash (PhoshShell *self)
-{
- return FALSE;
-}
-
-
gboolean
phosh_shell_get_blanked (PhoshShell *self)
{
diff --git a/phosh/tests/stubs/toplevel-manager.c b/phosh/tests/stubs/toplevel-manager.c
index 6d2bf529b..a243081af 100644
--- a/phosh/tests/stubs/toplevel-manager.c
+++ b/phosh/tests/stubs/toplevel-manager.c
@@ -11,9 +11,8 @@
enum {
- TOPLEVEL_ADDED,
- TOPLEVEL_CHANGED,
- TOPLEVEL_MISSING,
+ SIGNAL_TOPLEVEL_ADDED,
+ SIGNAL_TOPLEVEL_CHANGED,
N_SIGNALS
};
static guint signals[N_SIGNALS] = { 0 };
@@ -28,29 +27,14 @@ G_DEFINE_TYPE (PhoshToplevelManager, phosh_toplevel_manager, G_TYPE_OBJECT);
static void
phosh_toplevel_manager_class_init (PhoshToplevelManagerClass *klass)
{
- signals[TOPLEVEL_ADDED] = g_signal_new ("toplevel-added",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE,
- 1,
- PHOSH_TYPE_TOPLEVEL);
-
- signals[TOPLEVEL_ADDED] = g_signal_new ("toplevel-changed",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE,
- 1,
- PHOSH_TYPE_TOPLEVEL);
-
- signals[TOPLEVEL_MISSING] = g_signal_new ("toplevel-missing",
- G_TYPE_FROM_CLASS (klass),
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE,
- 1,
- G_TYPE_APP_INFO);
+ signals[SIGNAL_TOPLEVEL_ADDED] = g_signal_new (
+ "toplevel-added",
+ G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+ NULL, G_TYPE_NONE, 1, PHOSH_TYPE_TOPLEVEL);
+ signals[SIGNAL_TOPLEVEL_ADDED] = g_signal_new (
+ "toplevel-changed",
+ G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+ NULL, G_TYPE_NONE, 1, PHOSH_TYPE_TOPLEVEL);
}
diff --git a/phosh/tests/test-activity.c b/phosh/tests/test-activity.c
index 852f2359e..66282fac4 100644
--- a/phosh/tests/test-activity.c
+++ b/phosh/tests/test-activity.c
@@ -11,10 +11,10 @@
static void
test_phosh_activity_new(void)
{
- PhoshActivity *activity = PHOSH_ACTIVITY (phosh_activity_new ("com.example.foo"));
+ PhoshActivity *activity = g_object_ref_sink (PHOSH_ACTIVITY (phosh_activity_new ("com.example.foo")));
g_assert (activity);
g_assert_cmpstr (phosh_activity_get_app_id (activity), ==, "com.example.foo");
- gtk_widget_destroy (GTK_WIDGET (activity));
+ g_object_unref (GTK_WIDGET (activity));
}
diff --git a/phosh/tests/test-app-auth-prompt.c b/phosh/tests/test-app-auth-prompt.c
index 6310e277a..be31166c5 100644
--- a/phosh/tests/test-app-auth-prompt.c
+++ b/phosh/tests/test-app-auth-prompt.c
@@ -13,19 +13,19 @@
static void
test_app_auth_prompt_new (PhoshTestCompositorFixture *fixture, gconstpointer unused)
{
- GtkWidget *prompt = g_object_new (PHOSH_TYPE_APP_AUTH_PROMPT,
+ GtkWidget *prompt = g_object_ref_sink (g_object_new (PHOSH_TYPE_APP_AUTH_PROMPT,
"monitor", phosh_test_get_monitor (fixture->state),
"title", "title",
"subtitle", "subtitle",
"body", "body",
"grant-label", "ok",
"deny-label", "cancel",
- NULL);
+ NULL));
g_assert_true (PHOSH_IS_APP_AUTH_PROMPT (prompt));
gtk_widget_set_visible (prompt, TRUE);
- gtk_widget_destroy (prompt);
+ g_object_unref (prompt);
}
int
diff --git a/phosh/tests/test-app-grid-button.c b/phosh/tests/test-app-grid-button.c
index affa728be..4d59b388e 100644
--- a/phosh/tests/test-app-grid-button.c
+++ b/phosh/tests/test-app-grid-button.c
@@ -22,7 +22,7 @@ test_phosh_app_grid_button_new (void)
GAppInfo *got_info;
GtkWidget *btn;
- btn = phosh_app_grid_button_new (info);
+ btn = g_object_ref_sink (phosh_app_grid_button_new (info));
g_assert_true (PHOSH_IS_APP_GRID_BUTTON (btn));
mode = phosh_app_grid_button_get_mode (PHOSH_APP_GRID_BUTTON (btn));
@@ -34,7 +34,7 @@ test_phosh_app_grid_button_new (void)
g_object_get (btn, "app-info", &got_info, NULL);
g_assert_true (info == got_info);
- gtk_widget_destroy (btn);
+ g_object_unref (btn);
}
@@ -48,7 +48,7 @@ test_phosh_app_grid_button_new_favorite (void)
NULL);
GtkWidget *btn;
- btn = phosh_app_grid_button_new_favorite (info);
+ btn = g_object_ref_sink (phosh_app_grid_button_new_favorite (info));
g_assert_true (PHOSH_IS_APP_GRID_BUTTON (btn));
mode = phosh_app_grid_button_get_mode (PHOSH_APP_GRID_BUTTON (btn));
@@ -57,7 +57,7 @@ test_phosh_app_grid_button_new_favorite (void)
g_object_get (btn, "mode", &mode, NULL);
g_assert_true (mode == PHOSH_APP_GRID_BUTTON_FAVORITES);
- gtk_widget_destroy (btn);
+ g_object_unref (btn);
}
@@ -74,7 +74,7 @@ test_phosh_app_grid_button_set_app_info (void)
NULL);
GtkWidget *btn;
- btn = phosh_app_grid_button_new (info1);
+ btn = g_object_ref_sink (phosh_app_grid_button_new (info1));
g_assert_true (info1 == phosh_app_grid_button_get_app_info (
PHOSH_APP_GRID_BUTTON (btn)));
@@ -89,7 +89,7 @@ test_phosh_app_grid_button_set_app_info (void)
PHOSH_APP_GRID_BUTTON (btn)));
g_assert_false (gtk_widget_is_sensitive (btn));
- gtk_widget_destroy (btn);
+ g_object_unref (btn);
}
@@ -103,7 +103,7 @@ test_phosh_app_grid_button_set_mode (void)
NULL);
GtkWidget *btn;
- btn = phosh_app_grid_button_new (info);
+ btn = g_object_ref_sink (phosh_app_grid_button_new (info));
g_assert_true (PHOSH_IS_APP_GRID_BUTTON (btn));
phosh_app_grid_button_set_mode (PHOSH_APP_GRID_BUTTON (btn),
@@ -118,7 +118,7 @@ test_phosh_app_grid_button_set_mode (void)
mode = phosh_app_grid_button_get_mode (PHOSH_APP_GRID_BUTTON (btn));
g_assert_true (mode == PHOSH_APP_GRID_BUTTON_LAUNCHER);
- gtk_widget_destroy (btn);
+ g_object_unref (btn);
}
@@ -131,7 +131,7 @@ test_phosh_app_grid_button_set_invalid_mode (void)
"com.example.foo",
G_APP_INFO_CREATE_NONE,
NULL);
- GtkWidget *btn = phosh_app_grid_button_new (info);
+ GtkWidget *btn = g_object_ref_sink (phosh_app_grid_button_new (info));
/* Boom */
phosh_app_grid_button_set_mode (PHOSH_APP_GRID_BUTTON (btn),
@@ -148,10 +148,10 @@ test_phosh_app_grid_button_null_app_info (void)
{
GtkWidget *btn;
- btn = phosh_app_grid_button_new (NULL);
+ btn = g_object_ref_sink (phosh_app_grid_button_new (NULL));
g_assert_null (phosh_app_grid_button_get_app_info (
PHOSH_APP_GRID_BUTTON (btn)));
- gtk_widget_destroy (btn);
+ g_object_unref (btn);
}
@@ -162,26 +162,24 @@ test_phosh_app_grid_button_menu (void)
GtkWidget *btn;
gboolean is_favorite;
g_autoptr (GAppInfo) info = NULL;
- GActionGroup *actions;
list = phosh_favorite_list_model_get_default ();
info = G_APP_INFO (g_desktop_app_info_new ("demo.app.Second.desktop"));
- btn = phosh_app_grid_button_new (info);
+ btn = g_object_ref_sink (phosh_app_grid_button_new (info));
- actions = gtk_widget_get_action_group (btn, "app-btn");
- g_action_group_activate_action (actions, "favorite-add", NULL);
+ gtk_widget_activate_action_variant (btn, "app-btn.favorite-add", NULL);
is_favorite = phosh_favorite_list_model_app_is_favorite (list, info);
g_assert_true (is_favorite);
- g_action_group_activate_action (actions, "favorite-remove", NULL);
+ gtk_widget_activate_action_variant (btn, "app-btn.favorite-remove", NULL);
is_favorite = phosh_favorite_list_model_app_is_favorite (list, info);
g_assert_false (is_favorite);
- gtk_widget_destroy (btn);
+ g_object_unref (btn);
}
@@ -203,7 +201,7 @@ test_phosh_app_grid_button_is_favorite (void)
settings = g_settings_new ("sm.puri.phosh");
g_settings_set_strv (settings, "favorites", NULL);
- btn = phosh_app_grid_button_new (info);
+ btn = g_object_ref_sink (phosh_app_grid_button_new (info));
g_assert_true (PHOSH_IS_APP_GRID_BUTTON (btn));
mode = phosh_app_grid_button_get_mode (PHOSH_APP_GRID_BUTTON (btn));
@@ -222,7 +220,7 @@ test_phosh_app_grid_button_is_favorite (void)
g_assert_true (info == phosh_app_grid_button_get_app_info (
PHOSH_APP_GRID_BUTTON (btn)));
- gtk_widget_destroy (btn);
+ g_object_unref (btn);
}
@@ -233,20 +231,19 @@ test_phosh_app_grid_button_folder_add_action (void)
g_autoptr (GAppInfo) info = G_APP_INFO (g_desktop_app_info_new ("demo.app.First.desktop"));
g_autoptr (GAppInfo) got_info = NULL;
- GtkWidget *btn = phosh_app_grid_button_new (info);
- GActionGroup *actions = gtk_widget_get_action_group (btn, "app-btn");
+ GtkWidget *btn = g_object_ref_sink (phosh_app_grid_button_new (info));
GVariant *param = g_variant_new_string ("foo");
GListModel *apps = phosh_folder_info_get_app_infos (folder_info);
g_assert_cmpuint (g_list_model_get_n_items (apps), ==, 0);
- g_action_group_activate_action (actions, "folder-add", param);
+ gtk_widget_activate_action_variant (btn, "app-btn.folder-add", param);
g_assert_cmpuint (g_list_model_get_n_items (apps), ==, 1);
got_info = g_list_model_get_item (apps, 0);
g_assert_true (g_app_info_equal (info, got_info));
- gtk_widget_destroy (btn);
+ g_object_unref (btn);
}
@@ -259,14 +256,13 @@ test_phosh_app_grid_button_folder_new_action (void)
g_autoptr (GSettings) settings = g_settings_new (PHOSH_FOLDERS_SCHEMA_ID);
g_auto (GStrv) folders = NULL;
- GtkWidget *btn = phosh_app_grid_button_new (info);
- GActionGroup *actions = gtk_widget_get_action_group (btn, "app-btn");
+ GtkWidget *btn = g_object_ref_sink (phosh_app_grid_button_new (info));
GListModel *apps = NULL;
/* Clear all folders */
g_settings_set_strv (settings, "folder-children", NULL);
- g_action_group_activate_action (actions, "folder-new", NULL);
+ gtk_widget_activate_action_variant (btn, "app-btn.folder-new", NULL);
/* Now there must a new folder with our app-id */
folders = g_settings_get_strv (settings, "folder-children");
@@ -281,7 +277,7 @@ test_phosh_app_grid_button_folder_new_action (void)
got_info = g_list_model_get_item (apps, 0);
g_assert_true (g_app_info_equal (info, got_info));
- gtk_widget_destroy (btn);
+ g_object_unref (btn);
}
@@ -291,18 +287,17 @@ test_phosh_app_grid_button_folder_remove_action (void)
g_autoptr (PhoshFolderInfo) folder_info = phosh_folder_info_new_from_folder_path ("bar");
g_autoptr (GAppInfo) info = G_APP_INFO (g_desktop_app_info_new ("demo.app.First.desktop"));
- GtkWidget *btn = phosh_app_grid_button_new (info);
- GActionGroup *actions = gtk_widget_get_action_group (btn, "app-btn");
+ GtkWidget *btn = g_object_ref_sink (phosh_app_grid_button_new (info));
GListModel *apps = phosh_folder_info_get_app_infos (folder_info);
phosh_app_grid_button_set_folder_info (PHOSH_APP_GRID_BUTTON (btn), folder_info);
phosh_folder_info_add_app_info (folder_info, info);
g_assert_cmpuint (g_list_model_get_n_items (apps), ==, 1);
- g_action_group_activate_action (actions, "folder-remove", NULL);
+ gtk_widget_activate_action_variant (btn, "app-btn.folder-remove", NULL);
g_assert_cmpuint (g_list_model_get_n_items (apps), ==, 0);
- gtk_widget_destroy (btn);
+ g_object_unref (btn);
}
@@ -315,9 +310,8 @@ test_phosh_app_grid_button_clean_up_empty_folder (void)
g_autoptr (GAppInfo) first_info = G_APP_INFO (g_desktop_app_info_new ("demo.app.First.desktop"));
g_autoptr (GAppInfo) second_info = G_APP_INFO (g_desktop_app_info_new ("demo.app.Second.desktop"));
g_autoptr (GSettings) settings = g_settings_new (PHOSH_FOLDERS_SCHEMA_ID);
- GActionGroup *actions;
- GtkWidget *first_btn = phosh_app_grid_button_new (first_info);
- GtkWidget *second_btn = phosh_app_grid_button_new (second_info);
+ GtkWidget *first_btn = g_object_ref_sink (phosh_app_grid_button_new (first_info));
+ GtkWidget *second_btn = g_object_ref_sink (phosh_app_grid_button_new (second_info));
g_settings_set_strv (settings, "folder-children", folders);
phosh_folder_info_add_app_info (folder_info, first_info);
@@ -325,14 +319,12 @@ test_phosh_app_grid_button_clean_up_empty_folder (void)
phosh_app_grid_button_set_folder_info (PHOSH_APP_GRID_BUTTON (first_btn), folder_info);
phosh_app_grid_button_set_folder_info (PHOSH_APP_GRID_BUTTON (second_btn), folder_info);
- actions = gtk_widget_get_action_group (first_btn, "app-btn");
- g_action_group_activate_action (actions, "folder-remove", NULL);
+ gtk_widget_activate_action_variant (first_btn, "app-btn.folder-remove", NULL);
new_folders = g_settings_get_strv (settings, "folder-children");
g_assert_cmpstrv (new_folders, folders);
g_strfreev (new_folders);
- actions = gtk_widget_get_action_group (second_btn, "app-btn");
- g_action_group_activate_action (actions, "folder-remove", NULL);
+ gtk_widget_activate_action_variant (second_btn, "app-btn.folder-remove", NULL);
new_folders = g_settings_get_strv (settings, "folder-children");
g_assert_cmpstrv (new_folders, (const char *[]) { NULL });
}
diff --git a/phosh/tests/test-app-grid-folder-button.c b/phosh/tests/test-app-grid-folder-button.c
index c82a13c51..1eb12f0fa 100644
--- a/phosh/tests/test-app-grid-folder-button.c
+++ b/phosh/tests/test-app-grid-folder-button.c
@@ -34,7 +34,7 @@ test_phosh_app_grid_folder_button_new (void)
GtkWidget *button;
info = create_dummy_folder_info ();
- button = phosh_app_grid_folder_button_new_from_folder_info (info);
+ button = g_object_ref_sink (phosh_app_grid_folder_button_new_from_folder_info (info));
g_assert_true (PHOSH_IS_APP_GRID_FOLDER_BUTTON (button));
g_object_get (button, "folder-info", &got_info, NULL);
@@ -43,7 +43,7 @@ test_phosh_app_grid_folder_button_new (void)
g_object_get (button, "label", &label, NULL);
g_assert_cmpstr (label, ==, "Foo");
- gtk_widget_destroy (button);
+ g_object_unref (button);
}
diff --git a/phosh/tests/test-app-list-model.c b/phosh/tests/test-app-list-model.c
index bf0fcaaf9..09b987a45 100644
--- a/phosh/tests/test-app-list-model.c
+++ b/phosh/tests/test-app-list-model.c
@@ -10,7 +10,7 @@
#include "app-list-model.h"
static void
-test_phosh_app_list_model_get_default (void)
+test_phosh_app_list_model_get_default(void)
{
PhoshAppListModel *model1 = phosh_app_list_model_get_default ();
PhoshAppListModel *model2 = phosh_app_list_model_get_default ();
@@ -29,7 +29,7 @@ test_phosh_app_list_model_get_default (void)
typedef struct {
GMainLoop *loop;
PhoshAppListModel *model;
- gboolean changed;
+ gboolean changed;
} ItemsChangedContext;
@@ -62,7 +62,6 @@ test_phosh_app_list_model_api (void)
{
PhoshAppListModel *model = phosh_app_list_model_get_default ();
g_autoptr (GMainLoop) loop = g_main_loop_new (NULL, FALSE);
- g_autoptr (GAppInfo) info = NULL;
ItemsChangedContext context = {
.loop = loop,
.model = model,
@@ -71,19 +70,12 @@ test_phosh_app_list_model_api (void)
g_assert_true (PHOSH_IS_APP_LIST_MODEL (model));
g_assert_true (G_IS_LIST_MODEL (model));
g_assert_cmpint (g_list_model_get_n_items (G_LIST_MODEL (model)), ==, 0);
-
g_assert_null (phosh_app_list_model_lookup_by_startup_wm_class (model, "whatever"));
-
g_assert_true (g_list_model_get_item_type (G_LIST_MODEL (model)) == G_TYPE_APP_INFO);
g_signal_connect (model, "items-changed", G_CALLBACK (on_items_changed), &context);
g_main_loop_run (loop);
- g_assert_true (context.changed);
-
- info = g_list_model_get_item (G_LIST_MODEL (model), 0);
- phosh_app_list_model_add_exec (model, "an/exec/with/odd/path1", info);
- g_assert_true (G_IS_APP_INFO (phosh_app_list_model_lookup_by_exec (model, "path1")));
- g_assert_null (phosh_app_list_model_lookup_by_exec (model, "path2"));
+ g_assert_true (context.changed);
g_assert_finalize_object (model);
}
@@ -93,8 +85,8 @@ main (int argc, char *argv[])
{
g_test_init (&argc, &argv, NULL);
- g_test_add_func ("/phosh/app-list-model/new", test_phosh_app_list_model_get_default);
- g_test_add_func ("/phosh/app-list-model/api", test_phosh_app_list_model_api);
+ g_test_add_func("/phosh/app-list-model/new", test_phosh_app_list_model_get_default);
+ g_test_add_func("/phosh/app-list-model/api", test_phosh_app_list_model_api);
- return g_test_run ();
+ return g_test_run();
}
diff --git a/phosh/tests/test-background.c b/phosh/tests/test-background.c
index 05fea15ff..3be4456cd 100644
--- a/phosh/tests/test-background.c
+++ b/phosh/tests/test-background.c
@@ -48,11 +48,11 @@ test_background_new (Fixture *fixture, gconstpointer unused)
gboolean primary;
GtkWidget *background;
- background = phosh_background_new (phosh_wayland_get_zwlr_layer_shell_v1(
+ background = g_object_ref_sink (phosh_background_new (phosh_wayland_get_zwlr_layer_shell_v1(
fixture->base.state->wl),
phosh_test_get_monitor (fixture->base.state),
TRUE,
- ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND);
+ ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND));
gtk_widget_set_visible (background, TRUE);
@@ -64,7 +64,7 @@ test_background_new (Fixture *fixture, gconstpointer unused)
g_object_get (background, "primary", &primary, NULL);
g_assert_false (primary);
- gtk_widget_destroy (background);
+ g_object_unref (background);
}
int
diff --git a/phosh/tests/test-connectivity-info.c b/phosh/tests/test-connectivity-info.c
index 242d4ac91..cf3656baa 100644
--- a/phosh/tests/test-connectivity-info.c
+++ b/phosh/tests/test-connectivity-info.c
@@ -13,10 +13,10 @@ test_phosh_connectivity_info_new (void)
{
GtkWidget *widget;
- widget = phosh_connectivity_info_new ();
+ widget = g_object_ref_sink (phosh_connectivity_info_new ());
g_assert_true (PHOSH_IS_CONNECTIVITY_INFO (widget));
- gtk_widget_destroy (widget);
+ g_object_unref (widget);
}
int
diff --git a/phosh/tests/test-css.c b/phosh/tests/test-css.c
index 07cc5177a..325f4073b 100644
--- a/phosh/tests/test-css.c
+++ b/phosh/tests/test-css.c
@@ -14,15 +14,10 @@ static const char *
load_theme (const char *theme_name)
{
const char *style;
- g_autoptr (GtkCssProvider) provider = gtk_css_provider_new ();
g_debug ("GTK theme: %s", theme_name);
style = phosh_style_manager_get_stylesheet (theme_name);
- gtk_css_provider_load_from_resource (provider, style);
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
return style;
}
diff --git a/phosh/tests/test-drag-surface.c b/phosh/tests/test-drag-surface.c
index a46e1dde8..e0449d452 100644
--- a/phosh/tests/test-drag-surface.c
+++ b/phosh/tests/test-drag-surface.c
@@ -9,7 +9,6 @@
#include "testlib-compositor.h"
#include "drag-surface.h"
-#include
#include
@@ -19,7 +18,7 @@ test_drag_surface_g_object_new (PhoshTestCompositorFixture *fixture, gconstpoint
{
g_autofree char *namespace = g_strdup_printf ("phosh test %s", __func__);
PhoshMonitor *monitor = phosh_test_get_monitor (fixture->state);
- GtkWidget *surface = g_object_new (PHOSH_TYPE_DRAG_SURFACE,
+ GtkWidget *surface = g_object_ref_sink (g_object_new (PHOSH_TYPE_DRAG_SURFACE,
"layer-shell", phosh_wayland_get_zwlr_layer_shell_v1 (
fixture->state->wl),
"layer-shell-effects",
@@ -38,7 +37,7 @@ test_drag_surface_g_object_new (PhoshTestCompositorFixture *fixture, gconstpoint
"drag-handle", 10,
"drag-mode", PHOSH_DRAG_SURFACE_DRAG_MODE_HANDLE,
"threshold", 0.1,
- NULL);
+ NULL));
g_assert_true (PHOSH_IS_DRAG_SURFACE (surface));
gtk_widget_set_visible (surface, TRUE);
@@ -55,7 +54,7 @@ test_drag_surface_g_object_new (PhoshTestCompositorFixture *fixture, gconstpoint
gtk_widget_set_visible (surface, FALSE);
g_assert_false (gtk_widget_get_visible (surface));
g_assert_false (gtk_widget_get_mapped (surface));
- gtk_widget_destroy (surface);
+ g_object_unref (surface);
}
@@ -64,7 +63,7 @@ test_drag_surface_set_state (PhoshTestCompositorFixture *fixture, gconstpointer
{
g_autofree char *namespace = g_strdup_printf ("phosh test %s", __func__);
PhoshMonitor *monitor = phosh_test_get_monitor (fixture->state);
- GtkWidget *surface = g_object_new (PHOSH_TYPE_DRAG_SURFACE,
+ GtkWidget *surface = g_object_ref_sink (g_object_new (PHOSH_TYPE_DRAG_SURFACE,
"layer-shell", phosh_wayland_get_zwlr_layer_shell_v1 (
fixture->state->wl),
"layer-shell-effects",
@@ -78,7 +77,7 @@ test_drag_surface_set_state (PhoshTestCompositorFixture *fixture, gconstpointer
"anchor", (ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM |
ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT),
- NULL);
+ NULL));
g_assert_true (PHOSH_IS_DRAG_SURFACE (surface));
gtk_widget_set_visible (surface, TRUE);
@@ -90,7 +89,7 @@ test_drag_surface_set_state (PhoshTestCompositorFixture *fixture, gconstpointer
==, PHOSH_DRAG_SURFACE_STATE_FOLDED);
gtk_widget_set_visible (surface, FALSE);
- gtk_widget_destroy (surface);
+ g_object_unref (surface);
}
diff --git a/phosh/tests/test-end-session-dialog.c b/phosh/tests/test-end-session-dialog.c
index 5aa62dfcf..1c102cc0c 100644
--- a/phosh/tests/test-end-session-dialog.c
+++ b/phosh/tests/test-end-session-dialog.c
@@ -18,12 +18,12 @@ test_end_session_dialog_new (PhoshTestCompositorFixture *fixture, gconstpointer
{
GtkWidget *dialog;
- dialog = g_object_new (PHOSH_TYPE_END_SESSION_DIALOG,
+ dialog = g_object_ref_sink (g_object_new (PHOSH_TYPE_END_SESSION_DIALOG,
"monitor", phosh_test_get_monitor (fixture->state),
"action", PHOSH_END_SESSION_ACTION_LOGOUT,
"timeout", 0,
"inhibitor-paths", NULL,
- NULL);
+ NULL));
g_assert_true (PHOSH_IS_END_SESSION_DIALOG (dialog));
@@ -34,7 +34,7 @@ test_end_session_dialog_new (PhoshTestCompositorFixture *fixture, gconstpointer
gtk_widget_set_visible (dialog, FALSE);
g_assert_false (gtk_widget_get_visible (dialog));
g_assert_false (gtk_widget_get_mapped (dialog));
- gtk_widget_destroy (dialog);
+ g_object_unref (dialog);
}
@@ -59,12 +59,12 @@ test_end_session_dialog_timeout (PhoshTestCompositorFixture *fixture, gconstpoin
PhoshEndSessionDialog *dialog = NULL;
g_autoptr (GMainLoop) mainloop = NULL;
- dialog = g_object_new (PHOSH_TYPE_END_SESSION_DIALOG,
+ dialog = g_object_ref_sink (g_object_new (PHOSH_TYPE_END_SESSION_DIALOG,
"monitor", phosh_test_get_monitor (fixture->state),
"action", PHOSH_END_SESSION_ACTION_LOGOUT,
"timeout", 1,
"inhibitor-paths", NULL,
- NULL);
+ NULL));
g_assert_true (PHOSH_IS_END_SESSION_DIALOG (dialog));
mainloop = g_main_loop_new (NULL, FALSE);
@@ -77,7 +77,7 @@ test_end_session_dialog_timeout (PhoshTestCompositorFixture *fixture, gconstpoin
/* Letting the dialog timeout means confirmation */
g_assert_true (phosh_end_session_dialog_get_action_confirmed (dialog));
- gtk_widget_destroy (GTK_WIDGET (dialog));
+ g_object_unref (GTK_WIDGET (dialog));
}
diff --git a/phosh/tests/test-fading-label.c b/phosh/tests/test-fading-label.c
index 64e1a46bc..676c7af25 100644
--- a/phosh/tests/test-fading-label.c
+++ b/phosh/tests/test-fading-label.c
@@ -13,14 +13,14 @@ test_phosh_fading_label_new (void)
{
PhoshFadingLabel *fading_label;
- fading_label = PHOSH_FADING_LABEL (phosh_fading_label_new ("label"));
+ fading_label = g_object_ref_sink (PHOSH_FADING_LABEL (phosh_fading_label_new ("label")));
gtk_widget_set_visible (GTK_WIDGET (fading_label), TRUE);
g_assert_cmpstr (phosh_fading_label_get_label (fading_label), ==, "label");
phosh_fading_label_set_label (fading_label, "label2");
g_assert_cmpstr (phosh_fading_label_get_label (fading_label), ==, "label2");
- gtk_widget_destroy (GTK_WIDGET (fading_label));
+ g_object_unref (GTK_WIDGET (fading_label));
}
diff --git a/phosh/tests/test-gtk-mount-manager.c b/phosh/tests/test-gtk-mount-manager.c
index 825980ea4..66b973714 100644
--- a/phosh/tests/test-gtk-mount-manager.c
+++ b/phosh/tests/test-gtk-mount-manager.c
@@ -11,8 +11,6 @@
#include "testlib-full-shell.h"
-#include
-
#define BUS_NAME "org.gtk.MountOperationHandler"
#define OBJECT_PATH "/org/gtk/MountOperationHandler"
diff --git a/phosh/tests/test-layer-surface.c b/phosh/tests/test-layer-surface.c
index 1084a7239..56c37f077 100644
--- a/phosh/tests/test-layer-surface.c
+++ b/phosh/tests/test-layer-surface.c
@@ -9,7 +9,6 @@
#include "testlib-compositor.h"
#include "layersurface-priv.h"
-#include
#include
@@ -31,7 +30,7 @@ test_layer_surface_new (PhoshTestCompositorFixture *fixture, gconstpointer unuse
monitor->wl_output);
g_assert_true (PHOSH_IS_LAYER_SURFACE (surface));
- gtk_widget_destroy (surface);
+ g_object_unref (surface);
}
@@ -60,7 +59,7 @@ test_layer_surface_g_object_new (PhoshTestCompositorFixture *fixture, gconstpoin
gtk_widget_set_visible (surface, FALSE);
g_assert_false (gtk_widget_get_visible (surface));
g_assert_false (gtk_widget_get_mapped (surface));
- gtk_widget_destroy (surface);
+ g_object_unref (surface);
}
@@ -118,7 +117,7 @@ test_layer_surface_set_size (PhoshTestCompositorFixture *fixture, gconstpointer
g_assert_cmpint (height_count, ==, 3);
gtk_widget_set_visible (surface, TRUE);
gtk_widget_set_visible (surface, FALSE);
- gtk_widget_destroy (surface);
+ g_object_unref (surface);
}
diff --git a/phosh/tests/test-lockshield.c b/phosh/tests/test-lockshield.c
index 57654d6aa..4d255199a 100644
--- a/phosh/tests/test-lockshield.c
+++ b/phosh/tests/test-lockshield.c
@@ -19,7 +19,7 @@ test_lockshield_new (PhoshTestCompositorFixture *fixture, gconstpointer unused)
g_assert_true (PHOSH_IS_LOCKSHIELD (panel));
gtk_widget_set_visible (panel, TRUE);
- gtk_widget_destroy (panel);
+ g_object_unref (panel);
}
int
diff --git a/phosh/tests/test-notification-content.c b/phosh/tests/test-notification-content.c
index 220819893..4c2b56a41 100644
--- a/phosh/tests/test-notification-content.c
+++ b/phosh/tests/test-notification-content.c
@@ -150,8 +150,8 @@ test_phosh_notification_content_actions (void)
actioned_called = FALSE;
- g_action_group_activate_action (gtk_widget_get_action_group (content, "noti"),
- "activate",
+ gtk_widget_activate_action_variant (content,
+ "noti.activate",
g_variant_new_string ("demo-time"));
g_assert_true (actioned_called);
diff --git a/phosh/tests/test-osd-window.c b/phosh/tests/test-osd-window.c
index 407c87afd..b50e25eeb 100644
--- a/phosh/tests/test-osd-window.c
+++ b/phosh/tests/test-osd-window.c
@@ -31,7 +31,7 @@ test_osd_window_new (PhoshTestCompositorFixture *fixture, gconstpointer unused)
NULL);
gtk_widget_set_visible (osd, TRUE);
- gtk_widget_destroy (osd);
+ g_object_unref (osd);
}
int
diff --git a/phosh/tests/test-overview.c b/phosh/tests/test-overview.c
index 1da3a0f59..148f96e69 100644
--- a/phosh/tests/test-overview.c
+++ b/phosh/tests/test-overview.c
@@ -8,14 +8,14 @@
#include "overview.h"
-#include
+#include
static void
test_phosh_overview_new(void)
{
- GtkWidget *window = phosh_overview_new ();
+ GtkWidget *window = g_object_ref_sink (phosh_overview_new ());
g_assert (window);
- gtk_widget_destroy (window);
+ g_object_unref (window);
}
@@ -24,7 +24,7 @@ main (int argc,
char *argv[])
{
gtk_test_init (&argc, &argv, NULL);
- hdy_init ();
+ adw_init ();
g_test_add_func("/phosh/overview/new", test_phosh_overview_new);
return g_test_run();
diff --git a/phosh/tests/test-plugin-loader.c b/phosh/tests/test-plugin-loader.c
index bf0d48683..6cdfb4ba3 100644
--- a/phosh/tests/test-plugin-loader.c
+++ b/phosh/tests/test-plugin-loader.c
@@ -56,7 +56,7 @@ test_plugin_loader_load (void)
g_assert_true (GTK_IS_WIDGET (widget));
g_object_ref_sink (widget);
- gtk_widget_destroy (widget);
+ g_object_unref (widget);
#endif
g_assert_finalize_object (plugin_loader);
}
diff --git a/phosh/tests/test-power-menu.c b/phosh/tests/test-power-menu.c
index 98394a59c..ebd714b13 100644
--- a/phosh/tests/test-power-menu.c
+++ b/phosh/tests/test-power-menu.c
@@ -16,7 +16,7 @@ test_phosh_power_menu_new (PhoshTestCompositorFixture *fixture, gconstpointer da
PhoshPowerMenu *menu;
menu = phosh_power_menu_new (phosh_test_get_monitor (fixture->state));
- gtk_widget_destroy (GTK_WIDGET (menu));
+ g_object_unref (GTK_WIDGET (menu));
}
int
diff --git a/phosh/tests/test-quick-setting.c b/phosh/tests/test-quick-setting.c
index e8d6bfc9f..f645d1678 100644
--- a/phosh/tests/test-quick-setting.c
+++ b/phosh/tests/test-quick-setting.c
@@ -23,7 +23,7 @@ test_phosh_quick_setting_new (void)
const char *action_name;
const char *action_target;
- quick_setting = g_object_new (PHOSH_TYPE_QUICK_SETTING, NULL);
+ quick_setting = g_object_ref_sink (g_object_new (PHOSH_TYPE_QUICK_SETTING, NULL));
g_assert_true (PHOSH_IS_QUICK_SETTING (quick_setting));
active = phosh_quick_setting_get_active (quick_setting);
@@ -44,71 +44,74 @@ test_phosh_quick_setting_new (void)
action_target = phosh_quick_setting_get_long_press_action_target (quick_setting);
g_assert_true (action_target == NULL);
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
status_page = phosh_status_page_new ();
- quick_setting = PHOSH_QUICK_SETTING (phosh_quick_setting_new (status_page));
+ quick_setting = g_object_ref_sink (PHOSH_QUICK_SETTING (phosh_quick_setting_new (status_page)));
g_assert_true (PHOSH_IS_QUICK_SETTING (quick_setting));
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
static void
test_phosh_quick_setting_add_status_icon (void)
{
- GtkContainer *quick_setting;
+ GtkWidget *quick_setting;
PhoshStatusIcon *status_icon;
- GtkWidget *button_box_wid;
- g_autoptr (GList) box_children = NULL, button_box_children = NULL;
+ GtkWidget *button;
+ GtkWidget *button_box;
PhoshStatusIcon *icon_wid;
GtkLabel *label_wid;
const char *label;
const char *got_label;
- quick_setting = GTK_CONTAINER (phosh_quick_setting_new (NULL));
+ quick_setting = g_object_ref_sink (phosh_quick_setting_new (NULL));
label = "Foo";
status_icon = g_object_new (PHOSH_TYPE_STATUS_ICON, "icon-name", "face-smile-symbolic", "info",
label, NULL);
phosh_quick_setting_set_status_icon (PHOSH_QUICK_SETTING (quick_setting), status_icon);
- box_children = gtk_container_get_children (quick_setting);
- button_box_wid = gtk_bin_get_child (g_list_nth_data (box_children, 0));
- button_box_children = gtk_container_get_children (GTK_CONTAINER (button_box_wid));
- icon_wid = g_list_nth_data (button_box_children, 0);
- label_wid = g_list_nth_data (button_box_children, 1);
+ button = gtk_widget_get_first_child (quick_setting);
+ button_box = gtk_button_get_child (GTK_BUTTON (button));
+ icon_wid = PHOSH_STATUS_ICON (gtk_widget_get_first_child (button_box));
+ label_wid = GTK_LABEL (gtk_widget_get_last_child (button_box));
g_assert_true (icon_wid == status_icon);
got_label = gtk_label_get_text (label_wid);
g_assert_cmpstr (label, ==, got_label);
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
static void
test_phosh_quick_setting_remove_status_icon (void)
{
- GtkContainer *quick_setting;
+ GtkWidget *quick_setting;
PhoshStatusIcon *status_icon;
- GtkWidget *button_box_wid;
- g_autoptr (GList) box_children = NULL, button_box_children = NULL;
+ GtkWidget *button;
+ GtkWidget *button_box;
+ GtkWidget *icon_wid;
+ GtkWidget *label_wid;
- quick_setting = GTK_CONTAINER (phosh_quick_setting_new (NULL));
+
+ quick_setting = g_object_ref_sink (phosh_quick_setting_new (NULL));
status_icon = PHOSH_STATUS_ICON (phosh_status_icon_new ());
phosh_quick_setting_set_status_icon (PHOSH_QUICK_SETTING (quick_setting), status_icon);
phosh_quick_setting_set_status_icon (PHOSH_QUICK_SETTING (quick_setting), NULL);
- box_children = gtk_container_get_children (quick_setting);
- button_box_wid = gtk_bin_get_child (g_list_nth_data (box_children, 0));
- button_box_children = gtk_container_get_children (GTK_CONTAINER (button_box_wid));
+ button = gtk_widget_get_first_child (quick_setting);
+ button_box = gtk_button_get_child (GTK_BUTTON (button));
+ icon_wid = gtk_widget_get_first_child (button_box);
+ label_wid = gtk_widget_get_last_child (button_box);
- g_assert_cmpuint (g_list_length (button_box_children), ==, 1);
- g_assert_false (PHOSH_IS_STATUS_ICON (g_list_nth_data (button_box_children, 0)));
+ g_assert_true (icon_wid == label_wid);
+ g_assert_false (PHOSH_IS_STATUS_ICON (icon_wid));
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
@@ -118,7 +121,7 @@ test_phosh_quick_setting_set_active (void)
GtkWidget *quick_setting;
GtkStateFlags flags;
- quick_setting = phosh_quick_setting_new (NULL);
+ quick_setting = g_object_ref_sink (phosh_quick_setting_new (NULL));
phosh_quick_setting_set_active (PHOSH_QUICK_SETTING (quick_setting), TRUE);
flags = gtk_widget_get_state_flags (quick_setting);
@@ -128,7 +131,7 @@ test_phosh_quick_setting_set_active (void)
flags = gtk_widget_get_state_flags (quick_setting);
g_assert_false (flags & GTK_STATE_FLAG_CHECKED);
- gtk_widget_destroy (quick_setting);
+ g_object_unref (quick_setting);
}
@@ -139,14 +142,14 @@ test_phosh_quick_setting_get_active (void)
gboolean active;
gboolean got_active;
- quick_setting = PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL));
+ quick_setting = g_object_ref_sink (PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL)));
active = TRUE;
phosh_quick_setting_set_active (quick_setting, active);
got_active = phosh_quick_setting_get_active (quick_setting);
g_assert_true (got_active == active);
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
@@ -154,24 +157,24 @@ static void
test_phosh_quick_setting_set_showing_status (void)
{
PhoshQuickSetting *quick_setting;
- g_autoptr (GList) box_children = NULL;
+ GtkWidget *arrow_btn;
GtkWidget *arrow;
const char *icon_name;
- quick_setting = PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL));
+ quick_setting = g_object_ref_sink (PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL)));
- box_children = gtk_container_get_children (GTK_CONTAINER (quick_setting));
- arrow = gtk_bin_get_child (g_list_nth_data (box_children, 2));
+ arrow_btn = gtk_widget_get_last_child (GTK_WIDGET (quick_setting));
+ arrow = gtk_button_get_child (GTK_BUTTON (arrow_btn));
phosh_quick_setting_set_showing_status (quick_setting, TRUE);
- gtk_image_get_icon_name (GTK_IMAGE (arrow), &icon_name, NULL);
+ icon_name = gtk_image_get_icon_name (GTK_IMAGE (arrow));
g_assert_cmpstr ("go-down-symbolic", ==, icon_name);
phosh_quick_setting_set_showing_status (quick_setting, FALSE);
- gtk_image_get_icon_name (GTK_IMAGE (arrow), &icon_name, NULL);
+ icon_name = gtk_image_get_icon_name (GTK_IMAGE (arrow));
g_assert_cmpstr ("go-next-symbolic", ==, icon_name);
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
@@ -182,14 +185,14 @@ test_phosh_quick_setting_get_showing_status (void)
gboolean showing_status;
gboolean got_showing_status;
- quick_setting = PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL));
+ quick_setting = g_object_ref_sink (PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL)));
showing_status = TRUE;
phosh_quick_setting_set_showing_status (quick_setting, showing_status);
got_showing_status = phosh_quick_setting_get_showing_status (quick_setting);
g_assert_true (got_showing_status == showing_status);
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
@@ -197,14 +200,12 @@ static void
test_phosh_quick_setting_set_can_show_status (void)
{
PhoshQuickSetting *quick_setting;
- g_autoptr (GList) box_children = NULL;
GtkWidget *arrow_btn;
gboolean can_show_status;
- quick_setting = PHOSH_QUICK_SETTING (phosh_quick_setting_new (phosh_status_page_new ()));
+ quick_setting = g_object_ref_sink (PHOSH_QUICK_SETTING (phosh_quick_setting_new (phosh_status_page_new ())));
- box_children = gtk_container_get_children (GTK_CONTAINER (quick_setting));
- arrow_btn = g_list_nth_data (box_children, 2);
+ arrow_btn = gtk_widget_get_last_child (GTK_WIDGET (quick_setting));
can_show_status = TRUE;
phosh_quick_setting_set_can_show_status (quick_setting, can_show_status);
@@ -214,7 +215,7 @@ test_phosh_quick_setting_set_can_show_status (void)
phosh_quick_setting_set_can_show_status (quick_setting, can_show_status);
g_assert_false (gtk_widget_get_visible (arrow_btn));
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
@@ -225,14 +226,14 @@ test_phosh_quick_setting_get_can_show_status (void)
gboolean can_show_status;
gboolean got_can_show_status;
- quick_setting = PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL));
+ quick_setting = g_object_ref_sink (PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL)));
can_show_status = TRUE;
phosh_quick_setting_set_can_show_status (quick_setting, can_show_status);
got_can_show_status = phosh_quick_setting_get_can_show_status (quick_setting);
g_assert_true (got_can_show_status == can_show_status);
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
@@ -241,14 +242,12 @@ test_phosh_quick_setting_set_status_page (void)
{
PhoshQuickSetting *quick_setting;
PhoshStatusPage *status_page;
- g_autoptr (GList) box_children = NULL;
GtkWidget *arrow_btn;
- quick_setting = PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL));
+ quick_setting = g_object_ref_sink (PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL)));
phosh_quick_setting_set_can_show_status (quick_setting, TRUE);
- box_children = gtk_container_get_children (GTK_CONTAINER (quick_setting));
- arrow_btn = g_list_nth_data (box_children, 2);
+ arrow_btn = gtk_widget_get_last_child (GTK_WIDGET (quick_setting));
g_assert_false (gtk_widget_get_visible (arrow_btn));
@@ -256,7 +255,7 @@ test_phosh_quick_setting_set_status_page (void)
phosh_quick_setting_set_status_page (quick_setting, status_page);
g_assert_true (gtk_widget_get_visible (arrow_btn));
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
@@ -267,14 +266,14 @@ test_phosh_quick_setting_get_status_page (void)
PhoshStatusPage *status_page;
PhoshStatusPage *got_status_page;
- quick_setting = PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL));
+ quick_setting = g_object_ref_sink (PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL)));
status_page = phosh_status_page_new ();
phosh_quick_setting_set_status_page (quick_setting, status_page);
got_status_page = phosh_quick_setting_get_status_page (quick_setting);
g_assert_true (got_status_page == status_page);
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
@@ -285,14 +284,14 @@ test_phosh_quick_setting_get_long_press_action_name (void)
const char *action_name;
const char *got_action_name;
- quick_setting = PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL));
+ quick_setting = g_object_ref_sink (PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL)));
action_name = "foo";
phosh_quick_setting_set_long_press_action_name (quick_setting, action_name);
got_action_name = phosh_quick_setting_get_long_press_action_name (quick_setting);
g_assert_cmpstr (action_name, ==, got_action_name);
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
@@ -303,14 +302,14 @@ test_phosh_quick_setting_get_long_press_action_target (void)
const char *action_target;
const char *got_action_target;
- quick_setting = PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL));
+ quick_setting = g_object_ref_sink (PHOSH_QUICK_SETTING (phosh_quick_setting_new (NULL)));
action_target = "foo";
phosh_quick_setting_set_long_press_action_target (quick_setting, action_target);
got_action_target = phosh_quick_setting_get_long_press_action_target (quick_setting);
g_assert_cmpstr (action_target, ==, got_action_target);
- gtk_widget_destroy (GTK_WIDGET (quick_setting));
+ g_object_unref (GTK_WIDGET (quick_setting));
}
diff --git a/phosh/tests/test-quick-settings-box.c b/phosh/tests/test-quick-settings-box.c
index 062e4a956..196f6a9cd 100644
--- a/phosh/tests/test-quick-settings-box.c
+++ b/phosh/tests/test-quick-settings-box.c
@@ -10,6 +10,24 @@
#include "quick-setting.h"
+static guint
+count_children (PhoshQuickSettingsBox *box)
+{
+ int count = 0;
+ GtkWidget *child = gtk_widget_get_first_child (GTK_WIDGET (box));
+
+ g_return_val_if_fail (GTK_IS_REVEALER (child), 0);
+
+ child = gtk_widget_get_next_sibling (child);
+ while (child != NULL) {
+ count += 1;
+ child = gtk_widget_get_next_sibling (child);
+ }
+
+ return count;
+}
+
+
static void
test_phosh_quick_settings_box_new (void)
{
@@ -17,14 +35,15 @@ test_phosh_quick_settings_box_new (void)
int max_columns;
int spacing;
gboolean can_show_status;
+ guint count;
g_autoptr (GList) children = NULL;
box = g_object_new (PHOSH_TYPE_QUICK_SETTINGS_BOX, NULL);
g_object_ref_sink (box);
g_assert_true (PHOSH_IS_QUICK_SETTINGS_BOX (box));
- children = gtk_container_get_children (GTK_CONTAINER (box));
- g_assert_cmpuint (g_list_length (children), ==, 0);
+ count = count_children (box);
+ g_assert_cmpuint (count, ==, 0);
max_columns = phosh_quick_settings_box_get_max_columns (box);
g_assert_cmpuint (max_columns, ==, 3);
@@ -47,18 +66,17 @@ test_phosh_quick_settings_box_new (void)
static void
test_phosh_quick_settings_box_add (void)
{
- GtkContainer *box;
+ GtkWidget *box;
GtkWidget *child;
- g_autoptr (GList) children = NULL;
+ guint count;
- box = GTK_CONTAINER (phosh_quick_settings_box_new (3, 0));
+ box = phosh_quick_settings_box_new (3, 0);
g_object_ref_sink (box);
child = phosh_quick_setting_new (NULL);
phosh_quick_settings_box_add (PHOSH_QUICK_SETTINGS_BOX (box), PHOSH_QUICK_SETTING (child));
- children = gtk_container_get_children (box);
- g_assert_cmpuint (g_list_length (children), ==, 1);
- g_assert_true (g_list_nth_data (children, 0) == child);
+ count = count_children (PHOSH_QUICK_SETTINGS_BOX (box));
+ g_assert_cmpuint (count, ==, 1);
g_assert_finalize_object (box);
}
@@ -67,18 +85,19 @@ test_phosh_quick_settings_box_add (void)
static void
test_phosh_quick_settings_box_remove (void)
{
- GtkContainer *box;
+ GtkWidget *box;
GtkWidget *child;
- g_autoptr (GList) children = NULL;
+ guint count;
+
- box = GTK_CONTAINER (phosh_quick_settings_box_new (3, 0));
+ box = phosh_quick_settings_box_new (3, 0);
g_object_ref_sink (box);
child = phosh_quick_setting_new (NULL);
phosh_quick_settings_box_add (PHOSH_QUICK_SETTINGS_BOX (box), PHOSH_QUICK_SETTING (child));
phosh_quick_settings_box_remove (PHOSH_QUICK_SETTINGS_BOX (box), PHOSH_QUICK_SETTING (child));
- children = gtk_container_get_children (box);
- g_assert_cmpuint (g_list_length (children), ==, 0);
+ count = count_children (PHOSH_QUICK_SETTINGS_BOX (box));
+ g_assert_cmpuint (count, ==, 0);
g_assert_finalize_object (box);
}
@@ -134,9 +153,9 @@ test_phosh_quick_settings_box_set_can_show_status (void)
box = PHOSH_QUICK_SETTINGS_BOX (phosh_quick_settings_box_new (3, 0));
g_object_ref_sink (box);
child_a = g_object_new (PHOSH_TYPE_QUICK_SETTING, "can-show-status", TRUE, NULL);
- gtk_container_add (GTK_CONTAINER (box), GTK_WIDGET (child_a));
+ phosh_quick_settings_box_add (box, child_a);
child_b = g_object_new (PHOSH_TYPE_QUICK_SETTING, "can-show-status", FALSE, NULL);
- gtk_container_add (GTK_CONTAINER (box), GTK_WIDGET (child_b));
+ phosh_quick_settings_box_add (box, child_b);
can_show_status = TRUE;
phosh_quick_settings_box_set_can_show_status (box, can_show_status);
diff --git a/phosh/tests/test-shell.c b/phosh/tests/test-shell.c
index 76b8e8539..4da8c3ff0 100644
--- a/phosh/tests/test-shell.c
+++ b/phosh/tests/test-shell.c
@@ -14,8 +14,9 @@
#include "wall-clock.h"
#include
-#include
+#include
+GMainLoop *global_loop;
static void
compositor_setup (PhoshTestCompositorFixture *fixture, gconstpointer unused)
@@ -46,7 +47,7 @@ compositor_teardown (PhoshTestCompositorFixture *fixture, gconstpointer unused)
static gboolean
on_idle (gpointer data)
{
- gtk_main_quit ();
+ g_main_loop_quit (global_loop);
*(gboolean*)data = TRUE;
@@ -66,8 +67,8 @@ phosh_test_get_shell (GLogLevelFlags *saved_flags)
PhoshShell *shell;
GLogLevelFlags flags;
- gtk_init (NULL, NULL);
- hdy_init ();
+ gtk_init ();
+ adw_init ();
g_log_writer_default_set_debug_domains ((const char * const[]){ "all", NULL });
@@ -134,7 +135,8 @@ test_shell_new (PhoshTestCompositorFixture *fixture, gconstpointer unused)
g_assert_cmpint (phosh_monitor_manager_get_num_monitors (mm), ==, 1);
g_idle_add (on_idle, &success);
- gtk_main ();
+ global_loop = g_main_loop_new (NULL, FALSE);
+ g_main_loop_run (global_loop);
/* No warnings allowed from here on */
g_log_set_always_fatal (flags);
@@ -170,7 +172,8 @@ test_shell_new_two_outputs (PhoshTestCompositorFixture *fixture, gconstpointer u
g_main_context_iteration (NULL, FALSE);
g_idle_add (on_idle, &success);
- gtk_main ();
+ global_loop = g_main_loop_new (NULL, FALSE);
+ g_main_loop_run (global_loop);
g_log_set_always_fatal (flags);
g_assert_true (success);
diff --git a/phosh/tests/test-status-icon.c b/phosh/tests/test-status-icon.c
index fb5ce5688..06c171868 100644
--- a/phosh/tests/test-status-icon.c
+++ b/phosh/tests/test-status-icon.c
@@ -13,10 +13,9 @@ test_phosh_status_icon_new (void)
{
GtkWidget *widget;
g_autofree char *icon_name = NULL;
- GtkIconSize icon_size;
guint pixel_size;
- widget = phosh_status_icon_new ();
+ widget = g_object_ref_sink (phosh_status_icon_new ());
g_assert_true (PHOSH_IS_STATUS_ICON (widget));
icon_name = phosh_status_icon_get_icon_name (PHOSH_STATUS_ICON (widget));
@@ -29,36 +28,7 @@ test_phosh_status_icon_new (void)
pixel_size = phosh_status_icon_get_pixel_size (PHOSH_STATUS_ICON (widget));
g_assert_true (pixel_size == 24);
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- icon_size = phosh_status_icon_get_icon_size (PHOSH_STATUS_ICON (widget));
- G_GNUC_END_IGNORE_DEPRECATIONS
- g_assert_true (icon_size == GTK_ICON_SIZE_LARGE_TOOLBAR);
-
- gtk_widget_destroy (widget);
-}
-
-
-static void
-test_phosh_status_icon_icon_size (void)
-{
- GtkWidget *widget;
- GtkIconSize icon_size;
-
- widget = phosh_status_icon_new ();
- g_assert_true (PHOSH_IS_STATUS_ICON (widget));
-
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- icon_size = phosh_status_icon_get_icon_size (PHOSH_STATUS_ICON (widget));
- G_GNUC_END_IGNORE_DEPRECATIONS
- g_assert_true (icon_size == GTK_ICON_SIZE_LARGE_TOOLBAR);
-
- G_GNUC_BEGIN_IGNORE_DEPRECATIONS
- phosh_status_icon_set_icon_size (PHOSH_STATUS_ICON (widget), GTK_ICON_SIZE_SMALL_TOOLBAR);
- icon_size = phosh_status_icon_get_icon_size (PHOSH_STATUS_ICON (widget));
- G_GNUC_END_IGNORE_DEPRECATIONS
- g_assert_true (icon_size == GTK_ICON_SIZE_SMALL_TOOLBAR);
-
- gtk_widget_destroy (widget);
+ g_object_unref (widget);
}
@@ -68,7 +38,7 @@ test_phosh_status_icon_pixel_size (void)
GtkWidget *widget;
guint pixel_size;
- widget = phosh_status_icon_new ();
+ widget = g_object_ref_sink (phosh_status_icon_new ());
g_assert_true (PHOSH_IS_STATUS_ICON (widget));
pixel_size = phosh_status_icon_get_pixel_size (PHOSH_STATUS_ICON (widget));
@@ -78,7 +48,7 @@ test_phosh_status_icon_pixel_size (void)
pixel_size = phosh_status_icon_get_pixel_size (PHOSH_STATUS_ICON (widget));
g_assert_true (pixel_size == 16);
- gtk_widget_destroy (widget);
+ g_object_unref (widget);
}
@@ -88,7 +58,7 @@ test_phosh_status_icon_icon_name (void)
GtkWidget *widget;
g_autofree char *icon_name = NULL;
- widget = phosh_status_icon_new ();
+ widget = g_object_ref_sink (phosh_status_icon_new ());
g_assert_true (PHOSH_IS_STATUS_ICON (widget));
icon_name = phosh_status_icon_get_icon_name (PHOSH_STATUS_ICON (widget));
@@ -103,7 +73,7 @@ test_phosh_status_icon_icon_name (void)
g_object_get (widget, "icon-name", &icon_name, NULL);
g_assert_cmpstr (icon_name, ==, "test-symbolic");
- gtk_widget_destroy (widget);
+ g_object_unref (widget);
}
static void
@@ -114,7 +84,7 @@ test_phosh_status_icon_extra_widget (void)
GtkWidget *new_extra;
extra = gtk_label_new (NULL);
- widget = phosh_status_icon_new ();
+ widget = g_object_ref_sink (phosh_status_icon_new ());
g_assert_true (PHOSH_IS_STATUS_ICON (widget));
extra = phosh_status_icon_get_extra_widget (PHOSH_STATUS_ICON (widget));
@@ -124,7 +94,7 @@ test_phosh_status_icon_extra_widget (void)
new_extra = phosh_status_icon_get_extra_widget (PHOSH_STATUS_ICON (widget));
g_assert_true (extra == new_extra);
- gtk_widget_destroy (widget);
+ g_object_unref (widget);
}
@@ -136,7 +106,6 @@ main (int argc,
gtk_test_init (&argc, &argv, NULL);
g_test_add_func("/phosh/status-icon/new", test_phosh_status_icon_new);
- g_test_add_func("/phosh/status-icon/icon-size", test_phosh_status_icon_icon_size);
g_test_add_func("/phosh/status-icon/pixel-size", test_phosh_status_icon_pixel_size);
g_test_add_func("/phosh/status-icon/icon-name", test_phosh_status_icon_icon_name);
g_test_add_func("/phosh/status-icon/extra-widget", test_phosh_status_icon_extra_widget);
diff --git a/phosh/tests/test-system-modal-dialog.c b/phosh/tests/test-system-modal-dialog.c
index 70c4f2d4c..e457cde4b 100644
--- a/phosh/tests/test-system-modal-dialog.c
+++ b/phosh/tests/test-system-modal-dialog.c
@@ -41,7 +41,7 @@ test_system_modal_dialog_new (PhoshTestCompositorFixture *fixture, gconstpointer
gtk_widget_set_visible (dialog, FALSE);
g_assert_false (gtk_widget_get_visible (dialog));
g_assert_false (gtk_widget_get_mapped (dialog));
- gtk_widget_destroy (dialog);
+ g_object_unref (dialog);
}
diff --git a/phosh/tests/test-system-modal.c b/phosh/tests/test-system-modal.c
index 0e6699fd5..f53afb69e 100644
--- a/phosh/tests/test-system-modal.c
+++ b/phosh/tests/test-system-modal.c
@@ -19,11 +19,10 @@ test_system_modal_new (PhoshTestCompositorFixture *fixture, gconstpointer unused
GtkWidget *modal = phosh_system_modal_new (phosh_test_get_monitor (fixture->state));
g_assert_true (PHOSH_IS_SYSTEM_MODAL (modal));
- g_assert_true (gtk_style_context_has_class (
- gtk_widget_get_style_context (modal),
+ g_assert_true (gtk_widget_has_css_class (modal,
"phosh-system-modal"));
- gtk_widget_destroy (modal);
+ g_object_unref (modal);
}
@@ -43,7 +42,7 @@ test_system_modal_g_object_new (PhoshTestCompositorFixture *fixture, gconstpoint
gtk_widget_set_visible (modal, FALSE);
g_assert_false (gtk_widget_get_visible (modal));
g_assert_false (gtk_widget_get_mapped (modal));
- gtk_widget_destroy (modal);
+ g_object_unref (modal);
}
diff --git a/phosh/tests/test-timestamp-label.c b/phosh/tests/test-timestamp-label.c
index c2a17873d..6d4367b04 100644
--- a/phosh/tests/test-timestamp-label.c
+++ b/phosh/tests/test-timestamp-label.c
@@ -49,7 +49,7 @@ test_phosh_timestamp_label_get_set_timestamp (void)
static void
test_phosh_timestamp_label_destroy (void)
{
- PhoshTimestampLabel *widget = phosh_timestamp_label_new ();
+ PhoshTimestampLabel *widget = g_object_ref_sink (phosh_timestamp_label_new ());
GDateTime *item_set_to = NULL;
g_autoptr (GDateTime) now = g_date_time_new_now_local ();
@@ -62,10 +62,7 @@ test_phosh_timestamp_label_destroy (void)
item_set_to = phosh_timestamp_label_get_timestamp (PHOSH_TIMESTAMP_LABEL (widget));
g_assert_true (item_set_to == now);
- gtk_widget_destroy (GTK_WIDGET(widget));
- item_set_to = phosh_timestamp_label_get_timestamp (PHOSH_TIMESTAMP_LABEL (widget));
- g_assert_null (item_set_to);
- g_object_ref_sink (widget);
+ g_object_unref (GTK_WIDGET(widget));
}
diff --git a/phosh/tests/testlib-full-shell.c b/phosh/tests/testlib-full-shell.c
index e8324b7df..3f188750e 100644
--- a/phosh/tests/testlib-full-shell.c
+++ b/phosh/tests/testlib-full-shell.c
@@ -12,9 +12,9 @@
#include "fake-clock.h"
#include "shell-priv.h"
+#include
#include
#include
-#include
/**
@@ -26,12 +26,14 @@
GPid comp_pid;
+GMainLoop *loop;
+
static gboolean
stop_shell (gpointer unused)
{
g_debug ("Stopping shell");
- gtk_main_quit ();
+ g_main_loop_quit (loop);
return G_SOURCE_REMOVE;
}
@@ -64,8 +66,8 @@ phosh_test_full_shell_thread (gpointer data)
signal (SIGTRAP, kill_compositor);
- gtk_init (NULL, NULL);
- hdy_init ();
+ gtk_init ();
+ adw_init ();
cui_init (TRUE);
g_log_writer_default_set_debug_domains ((const char *const *)fixture->log_domains);
@@ -81,9 +83,9 @@ phosh_test_full_shell_thread (gpointer data)
gtk_css_provider_load_from_resource (provider,
"/mobi/phosh/tests/screenshot-no-anim-overrides.css");
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_USER);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_USER);
g_assert_false (phosh_shell_is_startup_finished (shell));
@@ -95,7 +97,8 @@ phosh_test_full_shell_thread (gpointer data)
g_async_queue_push (fixture->queue, (gpointer)TRUE);
- gtk_main ();
+ loop = g_main_loop_new (NULL, FALSE);
+ g_main_loop_run (loop);
g_assert_finalize_object (wall_clock);
g_assert_finalize_object (shell);
@@ -177,7 +180,7 @@ phosh_test_full_shell_teardown (PhoshTestFullShellFixture *fixture, gconstpointe
{
g_autoptr (GFile) file = g_file_new_for_path (fixture->tmpdir);
- gdk_threads_add_idle (stop_shell, NULL);
+ g_idle_add (stop_shell, NULL);
g_thread_join (fixture->comp_and_shell);
g_async_queue_unref (fixture->queue);
diff --git a/phosh/tests/testlib.c b/phosh/tests/testlib.c
index 0988ca87b..49af15acd 100644
--- a/phosh/tests/testlib.c
+++ b/phosh/tests/testlib.c
@@ -11,7 +11,6 @@
#include "testlib-head-stub.h"
#include "layersurface.h"
-#include
#include
#include
diff --git a/phosh/tools/app-buttons.c b/phosh/tools/app-buttons.c
index 5307cb083..ed8ada4a8 100644
--- a/phosh/tools/app-buttons.c
+++ b/phosh/tools/app-buttons.c
@@ -6,46 +6,50 @@
* Author: Zander Brown
*/
-#include
+#include "gio/gio.h"
+#include
#include
-int
-main (int argc, char **argv)
+
+static void
+css_setup (void)
{
- GtkWidget *window = NULL;
- GtkWidget *wrap;
- GtkWidget *box = NULL;
- GtkWidget *btn = NULL;
GtkCssProvider *provider = NULL;
GFile *file = NULL;
- GError *error = NULL;
- GDesktopAppInfo *info = NULL;
-
- gtk_init (&argc, &argv);
provider = gtk_css_provider_new ();
file = g_file_new_for_uri ("resource:///mobi/phosh/stylesheet/adwaita-dark.css");
+ gtk_css_provider_load_from_file (provider, file);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (file);
+
+ g_object_set (adw_style_manager_get_default (),
+ "color-scheme", ADW_COLOR_SCHEME_FORCE_DARK,
+ NULL);
+}
- if (!gtk_css_provider_load_from_file (provider, file, &error)) {
- g_warning ("Failed to load CSS file: %s", error->message);
- g_clear_error (&error);
- return 1;
- }
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
- window = g_object_new (GTK_TYPE_WINDOW,
- "visible", TRUE,
+
+static void
+on_activate (AdwApplication *app)
+{
+ GtkWindow *window;
+ GtkBox *wrap;
+ GtkBox *box;
+ GtkButton *btn;
+ GDesktopAppInfo *info;
+
+ css_setup ();
+
+ window = g_object_new (GTK_TYPE_APPLICATION_WINDOW,
+ "application", app,
"default-height", 100,
"default-width", 360,
"height-request", 100,
"width-request", 360,
"title", "PhoshAppGridButton Demo",
NULL);
- g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
- gtk_window_set_deletable (GTK_WINDOW (window), FALSE);
-
wrap = g_object_new (GTK_TYPE_BOX,
"spacing", 20,
"orientation", GTK_ORIENTATION_VERTICAL,
@@ -55,10 +59,8 @@ main (int argc, char **argv)
"margin-bottom", 6,
"halign", GTK_ALIGN_CENTER,
"valign", GTK_ALIGN_CENTER,
- "visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (window), wrap);
-
+ gtk_window_set_child (window, GTK_WIDGET (wrap));
box = g_object_new (GTK_TYPE_BOX,
"spacing", 20,
"margin-start", 6,
@@ -67,9 +69,8 @@ main (int argc, char **argv)
"margin-bottom", 6,
"halign", GTK_ALIGN_CENTER,
"valign", GTK_ALIGN_CENTER,
- "visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (wrap), box);
+ gtk_box_append (wrap, GTK_WIDGET (box));
info = g_desktop_app_info_new ("org.gtk.Demo4.desktop");
btn = g_object_new (PHOSH_TYPE_APP_GRID_BUTTON,
@@ -77,7 +78,7 @@ main (int argc, char **argv)
"mode", PHOSH_APP_GRID_BUTTON_FAVORITES,
"visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (box), btn);
+ gtk_box_append (box, GTK_WIDGET (btn));
info = g_desktop_app_info_new ("org.gtk.IconBrowser4.desktop");
btn = g_object_new (PHOSH_TYPE_APP_GRID_BUTTON,
@@ -85,7 +86,7 @@ main (int argc, char **argv)
"mode", PHOSH_APP_GRID_BUTTON_FAVORITES,
"visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (box), btn);
+ gtk_box_append (box, GTK_WIDGET (btn));
box = g_object_new (GTK_TYPE_BOX,
"spacing", 20,
@@ -95,25 +96,34 @@ main (int argc, char **argv)
"margin-bottom", 6,
"halign", GTK_ALIGN_CENTER,
"valign", GTK_ALIGN_CENTER,
- "visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (wrap), box);
+ gtk_box_append (wrap, GTK_WIDGET (box));
info = g_desktop_app_info_new ("org.gtk.Demo4.desktop");
btn = g_object_new (PHOSH_TYPE_APP_GRID_BUTTON,
"app-info", info,
"visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (box), btn);
+ gtk_box_append (box, GTK_WIDGET (btn));
info = g_desktop_app_info_new ("org.gtk.IconBrowser4.desktop");
btn = g_object_new (PHOSH_TYPE_APP_GRID_BUTTON,
"app-info", info,
"visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (box), btn);
+ gtk_box_append (box, GTK_WIDGET (btn));
+
+ gtk_window_present (window);
+}
+
- gtk_main ();
+int
+main (int argc, char **argv)
+{
+ g_autoptr (AdwApplication) app = NULL;
- return 0;
+ app = adw_application_new ("mobi.phosh.tools.AppGridButtonDemo",
+ G_APPLICATION_DEFAULT_FLAGS);
+ g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
+ return g_application_run (G_APPLICATION (app), argc, argv);
}
diff --git a/phosh/tools/app-grid-standalone.c b/phosh/tools/app-grid-standalone.c
index 3528d9529..bdbe2c50e 100644
--- a/phosh/tools/app-grid-standalone.c
+++ b/phosh/tools/app-grid-standalone.c
@@ -9,55 +9,56 @@
*/
#include
+#include
+
static void
css_setup (void)
{
GtkCssProvider *provider;
GFile *file;
- GError *error = NULL;
provider = gtk_css_provider_new ();
file = g_file_new_for_uri ("resource:///mobi/phosh/stylesheet/adwaita-dark.css");
- if (!gtk_css_provider_load_from_file (provider, file, &error)) {
- g_warning ("Failed to load CSS file: %s", error->message);
- g_clear_error (&error);
- g_object_unref (file);
- return;
- }
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ gtk_css_provider_load_from_file (provider, file);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
g_object_unref (file);
+
+ g_object_set (adw_style_manager_get_default (),
+ "color-scheme", ADW_COLOR_SCHEME_FORCE_DARK,
+ NULL);
}
-int
-main (int argc, char *argv[])
-{
- GtkWidget *win;
- GtkWidget *widget;
- gtk_init (&argc, &argv);
+static void
+on_activate (AdwApplication *app)
+{
+ GtkWindow *window;
+ GtkWidget *grid;
css_setup ();
- g_object_set (gtk_settings_get_default (),
- "gtk-application-prefer-dark-theme", TRUE,
- NULL);
-
- win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- g_signal_connect (win, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
-
- gtk_widget_set_visible (win, TRUE);
-
- widget = g_object_new (PHOSH_TYPE_APP_GRID, NULL);
+ window = g_object_new (GTK_TYPE_APPLICATION_WINDOW,
+ "application", app,
+ "title", "AppGridStandalone",
+ NULL);
+ grid = g_object_new (PHOSH_TYPE_APP_GRID, NULL);
+ gtk_window_set_child (window, grid);
- gtk_widget_set_visible (widget, TRUE);
+ gtk_window_present (window);
+}
- gtk_container_add (GTK_CONTAINER (win), widget);
- gtk_main ();
+int
+main (int argc, char *argv[])
+{
+ g_autoptr (AdwApplication) app = NULL;
- return 0;
+ app = adw_application_new ("mobi.phosh.tools.AppGridStandalone",
+ G_APPLICATION_DEFAULT_FLAGS);
+ g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
+ return g_application_run (G_APPLICATION (app), argc, argv);
}
diff --git a/phosh/tools/app-scroll.c b/phosh/tools/app-scroll.c
index 34cc5a0d7..5c0240b4a 100644
--- a/phosh/tools/app-scroll.c
+++ b/phosh/tools/app-scroll.c
@@ -6,49 +6,53 @@
* Author: Zander Brown
*/
-#include
+#include
#include
-int
-main (int argc, char **argv)
+
+static void
+css_setup (void)
{
- GtkWidget *window = NULL;
- GtkWidget *scrolled = NULL;
- GtkWidget *box = NULL;
- GtkWidget *activity = NULL;
GtkCssProvider *provider = NULL;
GFile *file = NULL;
- GError *error = NULL;
-
- gtk_init (&argc, &argv);
provider = gtk_css_provider_new ();
file = g_file_new_for_uri ("resource:///mobi/phosh/stylesheet/adwaita-dark.css");
+ gtk_css_provider_load_from_file (provider, file);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (file);
+
+ g_object_set (adw_style_manager_get_default (),
+ "color-scheme", ADW_COLOR_SCHEME_FORCE_DARK,
+ NULL);
+}
+
+
+static void
+on_activate (AdwApplication *app)
+{
+ GtkWindow *window;
+ GtkScrolledWindow *scrolled;
+ GtkBox *box;
+ GtkWidget *activity;
+
+ css_setup ();
- if (!gtk_css_provider_load_from_file (provider, file, &error)) {
- g_warning ("Failed to load CSS file: %s", error->message);
- g_clear_error (&error);
- return 1;
- }
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
- window = g_object_new (GTK_TYPE_WINDOW,
- "visible", TRUE,
+ window = g_object_new (GTK_TYPE_APPLICATION_WINDOW,
+ "application", app,
"default-height", 640,
"default-width", 360,
"height-request", 640,
"width-request", 360,
"title", "PhoshApp Demo",
NULL);
- g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
scrolled = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
"vscrollbar-policy", GTK_POLICY_NEVER,
- "visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (window), scrolled);
+ gtk_window_set_child (window, GTK_WIDGET (scrolled));
box = g_object_new (GTK_TYPE_BOX,
"spacing", 18,
@@ -58,29 +62,36 @@ main (int argc, char **argv)
"margin-bottom", 10,
"halign", GTK_ALIGN_CENTER,
"valign", GTK_ALIGN_FILL,
- "visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (scrolled), box);
+ gtk_scrolled_window_set_child (scrolled, GTK_WIDGET (box));
activity = g_object_new (PHOSH_TYPE_ACTIVITY,
"app-id", "org.gnome.Calculator",
"title", "1 + 1 = 2",
"win-width", 360,
"win-height", 640,
- "visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (box), activity);
+ gtk_box_append (box, activity);
activity = g_object_new (PHOSH_TYPE_ACTIVITY,
"app-id", "org.gnome.Nautilus",
"title", "Home",
"win-width", 640,
"win-height", 360,
- "visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (box), activity);
+ gtk_box_append (box, activity);
+
+ gtk_window_present (window);
+}
- gtk_main ();
- return 0;
+int
+main (int argc, char **argv)
+{
+ g_autoptr (AdwApplication) app = NULL;
+
+ app = adw_application_new ("mobi.phosh.tools.AppScrollDemo",
+ G_APPLICATION_DEFAULT_FLAGS);
+ g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
+ return g_application_run (G_APPLICATION (app), argc, argv);
}
diff --git a/phosh/tools/custom-quick-settings-standalone.c b/phosh/tools/custom-quick-settings-standalone.c
index 3e0876048..22d0467f3 100644
--- a/phosh/tools/custom-quick-settings-standalone.c
+++ b/phosh/tools/custom-quick-settings-standalone.c
@@ -16,29 +16,31 @@
#include "phosh-config.h"
-#include
+#include
#include "plugin-loader.h"
#include "quick-setting.h"
#include "quick-settings-box.h"
+
static void
css_setup (void)
{
- g_autoptr (GtkCssProvider) provider = NULL;
- g_autoptr (GFile) file = NULL;
- g_autoptr (GError) error = NULL;
+ GtkCssProvider *provider;
+ GFile *file;
provider = gtk_css_provider_new ();
file = g_file_new_for_uri ("resource:///mobi/phosh/stylesheet/adwaita-dark.css");
- if (!gtk_css_provider_load_from_file (provider, file, &error)) {
- g_warning ("Failed to load CSS file: %s", error->message);
- return;
- }
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ gtk_css_provider_load_from_file (provider, file);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (file);
+
+ g_object_set (adw_style_manager_get_default (),
+ "color-scheme", ADW_COLOR_SCHEME_FORCE_DARK,
+ NULL);
}
@@ -58,62 +60,76 @@ get_plugin_dirs (GStrv plugins)
static GtkWidget *
-setup_plugins (GStrv plugin_dirs, GStrv plugins, const char *const *enabled)
+setup_plugins (const char *const *enabled)
{
- GtkWidget *box;
+ PhoshQuickSettingsBox *box;
+ g_auto (GStrv) plugins = g_strsplit (PLUGINS, " ", -1);
+ g_auto (GStrv) plugin_dirs = NULL;
g_autoptr (PhoshPluginLoader) loader = NULL;
- box = phosh_quick_settings_box_new (3, 12);
+ plugin_dirs = get_plugin_dirs (plugins);
+
+ box = PHOSH_QUICK_SETTINGS_BOX (phosh_quick_settings_box_new (3, 12));
loader = phosh_plugin_loader_new (plugin_dirs, PHOSH_EXTENSION_POINT_QUICK_SETTING_WIDGET);
for (int i = 0; i < g_strv_length (plugins); i++) {
char *plugin = plugins[i];
- GtkWidget* widget;
+ PhoshQuickSetting* widget;
if (!g_strv_contains (enabled, plugin))
continue;
- widget = phosh_plugin_loader_load_plugin (loader, plugin);
+ widget = PHOSH_QUICK_SETTING (phosh_plugin_loader_load_plugin (loader, plugin));
if (widget == NULL) {
g_warning ("Unable to load plugin: %s", plugin);
} else {
g_print ("Adding custom quick setting '%s'\n", plugin);
- gtk_container_add (GTK_CONTAINER (box), widget);
+ phosh_quick_settings_box_add (box, widget);
}
}
- return box;
+ return GTK_WIDGET (box);
+}
+
+
+static void
+on_activate (AdwApplication *app, const char *const *enabled)
+{
+ GtkWidget *box;
+ GtkWindow *window;
+
+ css_setup ();
+
+ box = setup_plugins (enabled);
+ window = g_object_new (GTK_TYPE_APPLICATION_WINDOW,
+ "application", app,
+ "title", "Custom Quick Settings",
+ NULL);
+ gtk_window_set_child (window, box);
+
+ gtk_window_present (window);
}
int
main (int argc, char *argv[])
{
- GtkWidget *win;
- GtkWidget *box;
g_autoptr (GOptionContext) opt_context = NULL;
g_autoptr (GError) err = NULL;
g_autoptr (GStrvBuilder) plugins_builder = g_strv_builder_new ();
- g_auto (GStrv) plugins = g_strsplit (PLUGINS, " ", -1);
- g_auto (GStrv) plugin_dirs = NULL;
g_auto (GStrv) enabled = NULL;
const GOptionEntry options [] = {
{ NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
};
+ g_autoptr (AdwApplication) app = NULL;
opt_context = g_option_context_new ("- spawn your quick setting");
g_option_context_add_main_entries (opt_context, options, NULL);
- g_option_context_add_group (opt_context, gtk_get_option_group (FALSE));
if (!g_option_context_parse (opt_context, &argc, &argv, &err)) {
g_warning ("%s", err->message);
return 1;
}
- gtk_init (&argc, &argv);
- hdy_init ();
-
- css_setup ();
-
if (argc < 2) {
g_print ("Pass at least one plugin name\n");
return 1;
@@ -123,22 +139,9 @@ main (int argc, char *argv[])
g_strv_builder_add (plugins_builder, argv[i]);
enabled = g_strv_builder_end (plugins_builder);
- g_object_set (gtk_settings_get_default (),
- "gtk-application-prefer-dark-theme", TRUE,
- NULL);
-
- win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title (GTK_WINDOW (win), "Custom Quick Settings");
- g_signal_connect (win, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
- gtk_widget_set_visible (win, TRUE);
-
- plugin_dirs = get_plugin_dirs (plugins);
- box = setup_plugins (plugin_dirs, plugins, (const char * const *)enabled);
- gtk_widget_set_visible (box, TRUE);
-
- gtk_container_add (GTK_CONTAINER (win), box);
-
- gtk_main ();
-
+ app = adw_application_new ("mobi.phosh.tools.CustomQuickSettingsStandalone",
+ G_APPLICATION_DEFAULT_FLAGS);
+ g_signal_connect (app, "activate", G_CALLBACK (on_activate), enabled);
+ return g_application_run (G_APPLICATION (app), 0, NULL);
return 0;
}
diff --git a/phosh/tools/notify-blocks.c b/phosh/tools/notify-blocks.c
index ae5c3a55c..6ad677a19 100644
--- a/phosh/tools/notify-blocks.c
+++ b/phosh/tools/notify-blocks.c
@@ -11,68 +11,67 @@
* notify-server-standalone
*/
-#include
+#include
#include
#include
#include
static void
-empty (PhoshNotificationFrame *self, GtkWidget *box)
+empty (PhoshNotificationFrame *self, GtkBox *box)
{
- gtk_container_remove (GTK_CONTAINER (box), GTK_WIDGET (self));
+ gtk_box_remove (box, GTK_WIDGET (self));
}
-int
-main (int argc, char **argv)
+static void
+css_setup (void)
{
- GtkWidget *window = NULL;
- GtkWidget *scrolled = NULL;
- GtkWidget *box = NULL;
- GtkWidget *frame = NULL;
- GDesktopAppInfo *app = NULL;
- GStrv actions = (char *[]) { "ok", "Okay", NULL };
- GIcon *image = NULL;
- PhoshNotification *notification = NULL;
GtkCssProvider *provider = NULL;
GFile *file = NULL;
- GError *error = NULL;
- g_autoptr (GDateTime) now = g_date_time_new_now_local ();
-
- gtk_init (&argc, &argv);
provider = gtk_css_provider_new ();
file = g_file_new_for_uri ("resource:///mobi/phosh/stylesheet/adwaita-dark.css");
-
- if (!gtk_css_provider_load_from_file (provider, file, &error)) {
- g_warning ("Failed to load CSS file: %s", error->message);
- g_clear_error (&error);
- return 1;
- }
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
- g_object_set (gtk_settings_get_default (),
- "gtk-application-prefer-dark-theme", TRUE,
+ gtk_css_provider_load_from_file (provider, file);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (file);
+
+ g_object_set (adw_style_manager_get_default (),
+ "color-scheme", ADW_COLOR_SCHEME_FORCE_DARK,
NULL);
+}
- window = g_object_new (GTK_TYPE_WINDOW,
- "visible", TRUE,
+
+static void
+on_activate (AdwApplication *app)
+{
+ GtkWindow *window;
+ GtkScrolledWindow *scrolled;
+ GtkBox *box;
+ GtkWidget *frame;
+ GDesktopAppInfo *info;
+ GStrv actions = (char *[]) { "ok", "Okay", NULL };
+ GIcon *image = NULL;
+ PhoshNotification *notification = NULL;
+ g_autoptr (GDateTime) now = g_date_time_new_now_local ();
+
+ css_setup ();
+
+ window = g_object_new (GTK_TYPE_APPLICATION_WINDOW,
+ "application", app,
"default-height", 640,
"default-width", 360,
"height-request", 640,
"width-request", 360,
"title", "PhoshNotificationFrame Demo",
NULL);
- g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
scrolled = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
"vscrollbar-policy", GTK_POLICY_NEVER,
- "visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (window), scrolled);
+ gtk_window_set_child (window, GTK_WIDGET (scrolled));
box = g_object_new (GTK_TYPE_BOX,
"margin-start", 6,
@@ -80,14 +79,13 @@ main (int argc, char **argv)
"margin-end", 6,
"margin-bottom", 6,
"orientation", GTK_ORIENTATION_VERTICAL,
- "visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (scrolled), box);
+ gtk_scrolled_window_set_child (scrolled, GTK_WIDGET (box));
- app = g_desktop_app_info_new ("org.gnome.Calculator.desktop");
+ info = g_desktop_app_info_new ("org.gnome.Calculator.desktop");
notification = phosh_notification_new (0,
"Not Shown",
- G_APP_INFO (app),
+ G_APP_INFO (info),
"2 + 2",
"= 4",
NULL,
@@ -103,7 +101,7 @@ main (int argc, char **argv)
phosh_notification_frame_bind_notification (PHOSH_NOTIFICATION_FRAME (frame),
notification);
g_signal_connect (frame, "empty", G_CALLBACK (empty), box);
- gtk_container_add (GTK_CONTAINER (box), frame);
+ gtk_box_append (box, frame);
image = g_themed_icon_new ("org.gnome.Software");
notification = phosh_notification_new (1,
@@ -124,9 +122,19 @@ main (int argc, char **argv)
phosh_notification_frame_bind_notification (PHOSH_NOTIFICATION_FRAME (frame),
notification);
g_signal_connect (frame, "empty", G_CALLBACK (empty), box);
- gtk_container_add (GTK_CONTAINER (box), frame);
+ gtk_box_append (box, frame);
- gtk_main ();
+ gtk_window_present (window);
+}
+
+
+int
+main (int argc, char **argv)
+{
+ g_autoptr (AdwApplication) app = NULL;
- return 0;
+ app = adw_application_new ("mobi.phosh.tools.NotificationFrameDemo",
+ G_APPLICATION_DEFAULT_FLAGS);
+ g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
+ return g_application_run (G_APPLICATION (app), argc, argv);
}
diff --git a/phosh/tools/notify-server-standalone.c b/phosh/tools/notify-server-standalone.c
index d59355b1c..38a96fcab 100644
--- a/phosh/tools/notify-server-standalone.c
+++ b/phosh/tools/notify-server-standalone.c
@@ -12,7 +12,7 @@
* If you just want to play around with styles, see notify-blocks
*/
-#include
+#include
#include
#include
@@ -25,7 +25,6 @@ create (gpointer item, gpointer data)
row = g_object_new (GTK_TYPE_LIST_BOX_ROW,
"activatable", FALSE,
- "visible", TRUE,
NULL);
frame = phosh_notification_frame_new (TRUE, NULL);
@@ -33,72 +32,80 @@ create (gpointer item, gpointer data)
gtk_widget_set_visible (frame, TRUE);
- gtk_container_add (GTK_CONTAINER (row), frame);
+ gtk_list_box_row_set_child (GTK_LIST_BOX_ROW (row), frame);
return row;
}
-int
-main (int argc, char **argv)
+static void
+css_setup (void)
{
- GtkWidget *window = NULL;
- GtkWidget *scrolled = NULL;
- GtkWidget *box = NULL;
- PhoshNotifyManager *manager = NULL;
GtkCssProvider *provider = NULL;
GFile *file = NULL;
- GError *error = NULL;
-
- gtk_init (&argc, &argv);
provider = gtk_css_provider_new ();
file = g_file_new_for_uri ("resource:///mobi/phosh/stylesheet/adwaita-dark.css");
-
- if (!gtk_css_provider_load_from_file (provider, file, &error)) {
- g_warning ("Failed to load CSS file: %s", error->message);
- g_clear_error (&error);
- return 1;
- }
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-
- g_object_set (gtk_settings_get_default (),
- "gtk-application-prefer-dark-theme", TRUE,
+ gtk_css_provider_load_from_file (provider, file);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (file);
+
+ g_object_set (adw_style_manager_get_default (),
+ "color-scheme", ADW_COLOR_SCHEME_FORCE_DARK,
NULL);
+}
+
+
+static void
+on_activate (AdwApplication *app)
+{
+ GtkWindow *window;
+ GtkScrolledWindow *scrolled;
+ GtkListBox *box;
+ PhoshNotifyManager *manager;
- window = g_object_new (GTK_TYPE_WINDOW,
- "visible", TRUE,
+ css_setup ();
+
+ window = g_object_new (GTK_TYPE_APPLICATION_WINDOW,
+ "application", app,
"default-height", 640,
"default-width", 360,
"height-request", 640,
"width-request", 360,
"title", "PhoshNotification Demo",
NULL);
- g_signal_connect (window, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
scrolled = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
"vscrollbar-policy", GTK_POLICY_AUTOMATIC,
"hscrollbar-policy", GTK_POLICY_NEVER,
- "visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (window), scrolled);
+ gtk_window_set_child (window, GTK_WIDGET (scrolled));
box = g_object_new (GTK_TYPE_LIST_BOX,
"selection-mode", GTK_SELECTION_NONE,
- "visible", TRUE,
NULL);
- gtk_container_add (GTK_CONTAINER (scrolled), box);
+ gtk_scrolled_window_set_child (scrolled, GTK_WIDGET (box));
manager = phosh_notify_manager_get_default ();
- gtk_list_box_bind_model (GTK_LIST_BOX (box),
+ gtk_list_box_bind_model (box,
G_LIST_MODEL (phosh_notify_manager_get_list (manager)),
create,
NULL,
NULL);
- gtk_main ();
+ gtk_window_present (window);
+}
+
+
+int
+main (int argc, char **argv)
+{
+ g_autoptr (AdwApplication) app = NULL;
- return 0;
+ app = adw_application_new ("mobi.phosh.tools.NotifyServerStandalone",
+ G_APPLICATION_DEFAULT_FLAGS);
+ g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
+ return g_application_run (G_APPLICATION (app), argc, argv);
}
diff --git a/phosh/tools/quick-settings-box-standalone.c b/phosh/tools/quick-settings-box-standalone.c
index 0fc0ec835..828f70a92 100644
--- a/phosh/tools/quick-settings-box-standalone.c
+++ b/phosh/tools/quick-settings-box-standalone.c
@@ -12,6 +12,8 @@
#include "quick-settings-box.h"
#include "status-icon.h"
+#include
+
#define SPACING 12
#define COLUMNS 3
@@ -47,14 +49,10 @@ on_child_clicked (PhoshQuickSetting *child)
static void
on_child_long_pressed (PhoshQuickSetting *child)
{
- GtkWidget *dialog = gtk_message_dialog_new (NULL,
- GTK_DIALOG_MODAL,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_CLOSE,
- "You long-pressed or right-clicked on a child.");
-
- gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (GTK_WIDGET (dialog));
+ AdwDialog *dialog = adw_alert_dialog_new (NULL,
+ "You long-pressed or right-clicked on a child.");
+ adw_alert_dialog_add_responses (ADW_ALERT_DIALOG (dialog), "ok", "OK", NULL);
+ adw_dialog_present (dialog, GTK_WIDGET (child));
}
@@ -78,10 +76,7 @@ make_status_page (GtkWidget *child)
if (g_random_boolean ())
return NULL;
- image = g_object_new (GTK_TYPE_IMAGE,
- "icon-name", "face-cool-symbolic",
- "pixel-size", 16,
- NULL);
+ image = gtk_image_new_from_icon_name ("face-cool-symbolic");
gtk_widget_set_visible (image, TRUE);
g_object_set_data (G_OBJECT (child), "image", image);
@@ -90,9 +85,8 @@ make_status_page (GtkWidget *child)
gtk_widget_set_visible (GTK_WIDGET (status_page), TRUE);
if (g_random_boolean ()) {
- scrollw = gtk_scrolled_window_new (NULL, NULL);
- gtk_widget_set_visible (scrollw, TRUE);
- gtk_container_add (GTK_CONTAINER (scrollw), image);
+ scrollw = gtk_scrolled_window_new ();
+ gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (scrollw), image);
gtk_widget_set_hexpand (scrollw, TRUE);
phosh_status_page_set_content (status_page, scrollw);
} else {
@@ -133,10 +127,10 @@ static void
on_del_clicked (GtkWidget *child)
{
GtkWidget *box = g_object_get_data (G_OBJECT (child), "box");
- GtkWidget *controls_grid = g_object_get_data (G_OBJECT (child), "controls_grid");
+ GtkGrid *controls_grid = g_object_get_data (G_OBJECT (child), "controls_grid");
GtkWidget *controls_box = g_object_get_data (G_OBJECT (child), "controls_box");
- gtk_container_remove (GTK_CONTAINER (controls_grid), controls_box);
+ gtk_grid_remove (controls_grid, controls_box);
phosh_quick_settings_box_remove (PHOSH_QUICK_SETTINGS_BOX (box), PHOSH_QUICK_SETTING (child));
}
@@ -156,32 +150,19 @@ make_controls_box (GtkWidget *child, int i)
g_autofree char *label = g_strdup_printf ("%d", i);
GtkWidget *box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
GtkWidget *check = gtk_check_button_new_with_label (label);
- GtkWidget *del_img = g_object_new (GTK_TYPE_IMAGE,
- "icon-name", "user-trash-symbolic",
- "pixel-size", 16,
- NULL);
- GtkWidget *restatus_img = g_object_new (GTK_TYPE_IMAGE,
- "icon-name", "view-refresh-symbolic",
- "pixel-size", 16,
- NULL);
- GtkWidget *del_btn = g_object_new (GTK_TYPE_BUTTON, "image", del_img, NULL);
- GtkWidget *restatus_btn = g_object_new (GTK_TYPE_BUTTON, "image", restatus_img, NULL);
+ GtkWidget *del_btn = gtk_button_new_from_icon_name ("user-trash-symbolic");
+ GtkWidget *restatus_btn = gtk_button_new_from_icon_name ("view-refresh-symbolic");
g_object_bind_property (check, "active", child, "visible", G_BINDING_SYNC_CREATE);
g_signal_connect_object (del_btn, "clicked", G_CALLBACK (on_del_clicked), child,
G_CONNECT_SWAPPED);
g_signal_connect_object (restatus_btn, "clicked", G_CALLBACK (on_restatus_clicked), child,
G_CONNECT_SWAPPED);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE);
-
- gtk_container_add (GTK_CONTAINER (box), check);
- gtk_container_add (GTK_CONTAINER (box), del_btn);
- gtk_container_add (GTK_CONTAINER (box), restatus_btn);
+ gtk_check_button_set_active (GTK_CHECK_BUTTON (check), TRUE);
- gtk_widget_set_visible (box, TRUE);
- gtk_widget_set_visible (check, TRUE);
- gtk_widget_set_visible (del_btn, TRUE);
- gtk_widget_set_visible (restatus_btn, TRUE);
+ gtk_box_append (GTK_BOX (box), check);
+ gtk_box_append (GTK_BOX (box), del_btn);
+ gtk_box_append (GTK_BOX (box), restatus_btn);
return box;
}
@@ -227,24 +208,14 @@ make_ui (void)
g_object_bind_property (spacing_spin, "value", box, "spacing", G_BINDING_SYNC_CREATE);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (spacing_spin), SPACING);
- gtk_widget_set_visible (root_box, TRUE);
- gtk_widget_set_visible (box, TRUE);
- gtk_widget_set_visible (controls_grid, TRUE);
- gtk_widget_set_visible (add_btn, TRUE);
- gtk_widget_set_visible (status_toggle, TRUE);
- gtk_widget_set_visible (max_columns_lbl, TRUE);
- gtk_widget_set_visible (max_columns_spin, TRUE);
- gtk_widget_set_visible (spacing_lbl, TRUE);
- gtk_widget_set_visible (spacing_spin, TRUE);
-
- gtk_container_add (GTK_CONTAINER (root_box), box);
- gtk_container_add (GTK_CONTAINER (root_box), controls_grid);
- gtk_container_add (GTK_CONTAINER (root_box), add_btn);
- gtk_container_add (GTK_CONTAINER (root_box), status_toggle);
- gtk_container_add (GTK_CONTAINER (root_box), max_columns_lbl);
- gtk_container_add (GTK_CONTAINER (root_box), max_columns_spin);
- gtk_container_add (GTK_CONTAINER (root_box), spacing_lbl);
- gtk_container_add (GTK_CONTAINER (root_box), spacing_spin);
+ gtk_box_append (GTK_BOX (root_box), box);
+ gtk_box_append (GTK_BOX (root_box), controls_grid);
+ gtk_box_append (GTK_BOX (root_box), add_btn);
+ gtk_box_append (GTK_BOX (root_box), status_toggle);
+ gtk_box_append (GTK_BOX (root_box), max_columns_lbl);
+ gtk_box_append (GTK_BOX (root_box), max_columns_spin);
+ gtk_box_append (GTK_BOX (root_box), spacing_lbl);
+ gtk_box_append (GTK_BOX (root_box), spacing_spin);
return root_box;
}
@@ -253,46 +224,50 @@ make_ui (void)
static void
css_setup (void)
{
- g_autoptr (GtkCssProvider) provider = NULL;
- g_autoptr (GFile) file = NULL;
- g_autoptr (GError) error = NULL;
+ GtkCssProvider *provider;
+ GFile *file;
provider = gtk_css_provider_new ();
file = g_file_new_for_uri ("resource:///mobi/phosh/stylesheet/adwaita-dark.css");
- if (!gtk_css_provider_load_from_file (provider, file, &error)) {
- g_warning ("Failed to load CSS file: %s", error->message);
- return;
- }
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ gtk_css_provider_load_from_file (provider, file);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (file);
+
+ g_object_set (adw_style_manager_get_default (),
+ "color-scheme", ADW_COLOR_SCHEME_FORCE_DARK,
+ NULL);
}
-int
-main (int argc, char *argv[])
+static void
+on_activate (AdwApplication *app)
{
- GtkWidget *win;
+ GtkWindow *window;
GtkWidget *box;
- gtk_init (&argc, &argv);
-
css_setup ();
- g_object_set (gtk_settings_get_default (),
- "gtk-application-prefer-dark-theme", TRUE,
- NULL);
+ window = g_object_new (GTK_TYPE_APPLICATION_WINDOW,
+ "application", app,
+ "title", "QuickSettings Box",
+ NULL);
+ box = make_ui ();
+ gtk_window_set_child (window, box);
- win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title (GTK_WINDOW (win), "Quick Settings Box");
- gtk_widget_set_visible (win, TRUE);
- g_signal_connect (win, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
+ gtk_window_present (window);
+}
- box = make_ui ();
- gtk_container_add (GTK_CONTAINER (win), box);
- gtk_main ();
+int
+main (int argc, char *argv[])
+{
+ g_autoptr (AdwApplication) app = NULL;
- return 0;
+ app = adw_application_new ("mobi.phosh.tools.QuickSettingsBoxStandalone",
+ G_APPLICATION_DEFAULT_FLAGS);
+ g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
+ return g_application_run (G_APPLICATION (app), argc, argv);
}
diff --git a/phosh/tools/widget-box-standalone.c b/phosh/tools/widget-box-standalone.c
index 45a80d9d7..3ea715323 100644
--- a/phosh/tools/widget-box-standalone.c
+++ b/phosh/tools/widget-box-standalone.c
@@ -12,34 +12,12 @@
#include "phosh-config.h"
-#include "gtkfilterlistmodel.h"
-
-#include
+#include
#include
#include
-static void
-css_setup (void)
-{
- g_autoptr (GtkCssProvider) provider = NULL;
- g_autoptr (GFile) file = NULL;
- g_autoptr (GError) error = NULL;
-
- provider = gtk_css_provider_new ();
- file = g_file_new_for_uri ("resource:///mobi/phosh/stylesheet/adwaita-dark.css");
-
- if (!gtk_css_provider_load_from_file (provider, file, &error)) {
- g_warning ("Failed to load CSS file: %s", error->message);
- return;
- }
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
-}
-
-
static GStrv
get_plugin_dirs (GStrv plugins)
{
@@ -55,41 +33,60 @@ get_plugin_dirs (GStrv plugins)
}
-int
-main (int argc, char *argv[])
+static void
+css_setup (void)
{
- GtkWidget *win;
- GtkWidget *box;
- g_auto (GStrv) plugins = g_strsplit (PLUGINS, " ", -1);
- g_auto (GStrv) plugin_dirs = NULL;
+ GtkCssProvider *provider;
+ GFile *file;
- gtk_init (&argc, &argv);
- hdy_init ();
-
- css_setup ();
+ provider = gtk_css_provider_new ();
+ file = g_file_new_for_uri ("resource:///mobi/phosh/stylesheet/adwaita-dark.css");
- /* Needed by the widget box */
- g_type_ensure (GTK_TYPE_FILTER_LIST_MODEL);
+ gtk_css_provider_load_from_file (provider, file);
+ gtk_style_context_add_provider_for_display (gdk_display_get_default (),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (file);
- g_object_set (gtk_settings_get_default (),
- "gtk-application-prefer-dark-theme", TRUE,
+ g_object_set (adw_style_manager_get_default (),
+ "color-scheme", ADW_COLOR_SCHEME_FORCE_DARK,
NULL);
+}
- win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title (GTK_WINDOW (win), "Lockscreen widget box");
- gtk_window_set_default_size (GTK_WINDOW (win), 360, 720);
- g_signal_connect (win, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
- gtk_widget_set_visible (win, TRUE);
+static void
+on_activate (AdwApplication *app)
+{
+ GtkWindow *window;
+ g_auto (GStrv) plugins = g_strsplit (PLUGINS, " ", -1);
+ g_auto (GStrv) plugin_dirs = NULL;
+ PhoshWidgetBox *box;
+
+ css_setup ();
+
+ window = g_object_new (GTK_TYPE_APPLICATION_WINDOW,
+ "application", app,
+ "title", "Lockscreen Widget Box",
+ "default-width", 360,
+ "default-height", 720,
+ NULL);
plugin_dirs = get_plugin_dirs (plugins);
box = g_object_new (PHOSH_TYPE_WIDGET_BOX, "plugin-dirs", plugin_dirs, NULL);
- phosh_widget_box_set_plugins (PHOSH_WIDGET_BOX (box), plugins);
- gtk_widget_set_visible (box, TRUE);
+ phosh_widget_box_set_plugins (box, plugins);
+ gtk_window_set_child (window, GTK_WIDGET (box));
+
+ gtk_window_present (window);
+}
- gtk_container_add (GTK_CONTAINER (win), box);
- gtk_main ();
+int
+main (int argc, char *argv[])
+{
+ g_autoptr (AdwApplication) app = NULL;
- return 0;
+ app = adw_application_new ("mobi.phosh.tools.WidgetBoxStandalone",
+ G_APPLICATION_DEFAULT_FLAGS);
+ g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL);
+ return g_application_run (G_APPLICATION (app), argc, argv);
}