diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 84572bf8..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,56 +0,0 @@ -version: 2.0 - -shared: &shared - - steps: - - - checkout - - - run: - name: Prepare environment - command: apt-get update - - - run: - name: Build project - command: mint-build -i - - - run: - name: Prepare packages - command: | - if [ -z $CI_PULL_REQUEST ]; then - mkdir /packages - mv /root/*.deb /packages/ - git log > /packages/git.log - cd / - tar zcvf packages.tar.gz packages - fi - - - run: - name: Deploy packages to Github - command: | - if [ -z $CI_PULL_REQUEST ]; then - wget https://github.com/tcnksm/ghr/releases/download/v0.5.4/ghr_v0.5.4_linux_amd64.zip - apt-get install --yes unzip - unzip ghr_v0.5.4_linux_amd64.zip - TAG="master".$CIRCLE_JOB - ./ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME -replace $TAG /packages.tar.gz - ./ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME -recreate -b "Latest unstable packages" $TAG /packages.tar.gz - fi - -jobs: - "mint21": - <<: *shared - docker: - - image: linuxmintd/mint21-amd64 - - "lmde5": - <<: *shared - docker: - - image: linuxmintd/lmde5-amd64 - -workflows: - version: 2 - build: - jobs: - - "mint21" - - "lmde5" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..c921e866 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,20 @@ +name: Build + +on: + push: + branches: + - master + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + build: + uses: linuxmint/github-actions/.github/workflows/do-builds.yml@master + with: + commit_id: master + ############################## Comma separated list - like 'linuxmint/xapp, linuxmint/cinnamon-desktop' + dependencies: + ############################## + diff --git a/README.md b/README.md index 2a632ee2..3213f9ba 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![build](https://github.com/linuxmint/xapp/actions/workflows/build.yml/badge.svg) + This project gathers the components which are common to multiple GTK desktop environments (Cinnamon, MATE and Xfce) and required to implement cross-DE solutions. # libxapp diff --git a/libxapp/xapp-status-icon.c b/libxapp/xapp-status-icon.c index a469ef40..9f55dd80 100644 --- a/libxapp/xapp-status-icon.c +++ b/libxapp/xapp-status-icon.c @@ -780,13 +780,27 @@ on_name_lost (GDBusConnection *connection, const gchar *name, gpointer user_data) { - XAppStatusIcon *self = XAPP_STATUS_ICON (user_data); - g_warning ("XAppStatusIcon: lost or could not acquire presence on dbus. Refreshing."); - self->priv->fail_counter++; + GList *instances = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (obj_server)); + GList *l; - refresh_icon (self); + for (l = instances; l != NULL; l = l->next) + { + GObject *instance = G_OBJECT (l->data); + XAppStatusIcon *icon = XAPP_STATUS_ICON (g_object_get_data (instance, "xapp-status-icon-instance")); + + if (icon == NULL) + { + g_warning ("on_name_lost: Could not retrieve xapp-status-icon-instance data: %s", name); + continue; + } + + icon->priv->fail_counter++; + refresh_icon (icon); + } + + g_list_free_full (instances, g_object_unref); } static void @@ -816,15 +830,31 @@ on_name_acquired (GDBusConnection *connection, const gchar *name, gpointer user_data) { - XAppStatusIcon *self = XAPP_STATUS_ICON (user_data); - process_icon_state = XAPP_STATUS_ICON_STATE_NATIVE; - sync_skeleton (self); + GList *instances = g_dbus_object_manager_get_objects (G_DBUS_OBJECT_MANAGER (obj_server)); + GList *l; - DEBUG ("Name acquired on dbus, state is now: %s", - state_to_str (process_icon_state)); - g_signal_emit (self, signals[STATE_CHANGED], 0, process_icon_state); + for (l = instances; l != NULL; l = l->next) + { + GObject *instance = G_OBJECT (l->data); + XAppStatusIcon *icon = XAPP_STATUS_ICON (g_object_get_data (instance, "xapp-status-icon-instance")); + + if (icon == NULL) + { + g_warning ("on_name_aquired: Could not retrieve xapp-status-icon-instance data: %s", name); + continue; + } + + sync_skeleton (icon); + + DEBUG ("Name acquired on dbus, state is now: %s", + state_to_str (process_icon_state)); + + g_signal_emit (icon, signals[STATE_CHANGED], 0, process_icon_state); + } + + g_list_free_full (instances, g_object_unref); } typedef struct @@ -890,6 +920,8 @@ export_icon_interface (XAppStatusIcon *self) xapp_object_skeleton_set_status_icon_interface (self->priv->object_skeleton, self->priv->interface_skeleton); + g_object_set_data (G_OBJECT (self->priv->object_skeleton), "xapp-status-icon-instance", self); + g_dbus_object_manager_server_export_uniquely (obj_server, G_DBUS_OBJECT_SKELETON (self->priv->object_skeleton)); @@ -942,7 +974,7 @@ connect_with_status_applet (XAppStatusIcon *self) G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE, on_name_acquired, on_name_lost, - self, + NULL, NULL); } @@ -1298,7 +1330,9 @@ remove_icon_path_from_bus (XAppStatusIcon *self) DEBUG ("Removing interface at path '%s'", path); + g_object_set_data (G_OBJECT (self->priv->object_skeleton), "xapp-status-icon-instance", NULL); g_dbus_object_manager_server_unexport (obj_server, path); + self->priv->interface_skeleton = NULL; self->priv->object_skeleton = NULL; diff --git a/pygobject/meson.build b/pygobject/meson.build index 049b5653..da219f76 100644 --- a/pygobject/meson.build +++ b/pygobject/meson.build @@ -4,10 +4,11 @@ pygobject = dependency('pygobject-3.0', ) override_dir = get_option('py-overrides-dir') -exec = find_program(['python3', 'python']) if override_dir == '' - r = run_command(exec, '-c', 'import gi;print(gi._overridesdir)') + exec = find_program(['python3', 'python']) + + r = run_command(exec, '-c', 'import gi;print(gi._overridesdir)', check: false) if r.returncode() != 0 error('Error getting the GObject Introspection override directory: ' + r.stderr()) @@ -16,6 +17,8 @@ if override_dir == '' override_dir = r.stdout().strip() endif +message('PyGObject overrides dir: ' + override_dir) + install_data(['XApp.py'], install_dir: override_dir, ) diff --git a/xapp-sn-watcher/sn-item.c b/xapp-sn-watcher/sn-item.c index dc7adf85..5631ce2b 100644 --- a/xapp-sn-watcher/sn-item.c +++ b/xapp-sn-watcher/sn-item.c @@ -733,12 +733,12 @@ get_all_properties_callback (GObject *source_object, GVariantIter *iter = NULL; const gchar *name; GVariant *value; - properties = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, &error); if (error != NULL) { - if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && + !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD)) { g_critical ("Could not get properties for %s: %s\n", g_dbus_proxy_get_name (item->sn_item_proxy), @@ -894,7 +894,10 @@ get_all_properties_callback (GObject *source_object, if (g_strcmp0 (name, "Id") == 0) { new_props->id = null_or_string_from_variant (value); - new_props->update_id = TRUE; + if (g_strcmp0 (new_props->id, item->current_props->id) != 0) + { + new_props->update_id = TRUE; + } } } @@ -920,8 +923,7 @@ get_all_properties_callback (GObject *source_object, { update_icon (item, new_props); } - - if (new_props->update_id || new_props->update_status) + if ((new_props->update_id || new_props->update_status) && !new_props->update_tooltip) { assign_sortable_name (item, new_props->id); }