summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--applets/wncklet/Makefile.am2
-rw-r--r--applets/wncklet/wayland-backend.c5
-rw-r--r--applets/wncklet/window-list.c4
-rw-r--r--applets/wncklet/window-list.ui20
-rwxr-xr-xautogen.sh1
-rw-r--r--mate-panel/libmate-panel-applet-private/panel-applet-container.c228
7 files changed, 129 insertions, 133 deletions
diff --git a/.travis.yml b/.travis.yml
index 7b5f69dd..a296aedb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -72,4 +72,4 @@ env:
- DISTRO="archlinux:latest"
- DISTRO="debian:testing"
- DISTRO="fedora:latest"
- - DISTRO="ubuntu:devel"
+ - DISTRO="ubuntu:rolling"
diff --git a/applets/wncklet/Makefile.am b/applets/wncklet/Makefile.am
index 38dfaca5..ed442671 100644
--- a/applets/wncklet/Makefile.am
+++ b/applets/wncklet/Makefile.am
@@ -1,3 +1,5 @@
+AUTOMAKE_OPTIONS = subdir-objects
+
AM_CPPFLAGS = \
$(LIBMATE_PANEL_APPLET_CFLAGS) \
$(WNCKLET_CFLAGS) \
diff --git a/applets/wncklet/wayland-backend.c b/applets/wncklet/wayland-backend.c
index 658eb6d3..a6f50a77 100644
--- a/applets/wncklet/wayland-backend.c
+++ b/applets/wncklet/wayland-backend.c
@@ -55,7 +55,6 @@ static struct wl_registry *wl_registry_global = NULL;
static uint32_t foreign_toplevel_manager_global_id = 0;
static uint32_t foreign_toplevel_manager_global_version = 0;
-static TasklistManager *tasklist_manager_new ();
static ToplevelTask *toplevel_task_new (TasklistManager *tasklist, struct zwlr_foreign_toplevel_handle_v1 *handle);
static void
@@ -92,7 +91,7 @@ static const struct wl_registry_listener wl_registry_listener = {
};
static void
-wayland_tasklist_init_if_needed ()
+wayland_tasklist_init_if_needed (void)
{
if (has_initialized)
return;
@@ -165,7 +164,7 @@ tasklist_manager_disconnected_from_widget (TasklistManager *tasklist)
}
static TasklistManager *
-tasklist_manager_new ()
+tasklist_manager_new (void)
{
if (!foreign_toplevel_manager_global_id)
return NULL;
diff --git a/applets/wncklet/window-list.c b/applets/wncklet/window-list.c
index dd18fc72..6038400e 100644
--- a/applets/wncklet/window-list.c
+++ b/applets/wncklet/window-list.c
@@ -73,6 +73,7 @@ typedef struct {
/* Properties: */
GtkWidget* properties_dialog;
+ GtkWidget* wayland_info_label;
GtkWidget* show_current_radio;
GtkWidget* show_all_radio;
#ifdef HAVE_WINDOW_PREVIEWS
@@ -959,6 +960,8 @@ static void setup_sensitivity(TasklistData* tasklist, GtkBuilder* builder, const
#ifdef HAVE_WAYLAND
static void setup_dialog_wayland(TasklistData* tasklist)
{
+ gtk_widget_show(tasklist->wayland_info_label);
+
gtk_widget_set_sensitive(tasklist->window_list_content_box, FALSE);
gtk_widget_set_sensitive(tasklist->window_grouping_box, FALSE);
gtk_widget_set_sensitive(tasklist->minimized_windows_box, FALSE);
@@ -976,6 +979,7 @@ static void setup_dialog(GtkBuilder* builder, TasklistData* tasklist)
GtkAdjustment *adjustment;
#endif /* HAVE_WINDOW_PREVIEWS */
+ tasklist->wayland_info_label = WID("wayland_info_label");
tasklist->show_current_radio = WID("show_current_radio");
tasklist->show_all_radio = WID("show_all_radio");
diff --git a/applets/wncklet/window-list.ui b/applets/wncklet/window-list.ui
index 2161d427..765b5b68 100644
--- a/applets/wncklet/window-list.ui
+++ b/applets/wncklet/window-list.ui
@@ -77,6 +77,22 @@
<property name="orientation">vertical</property>
<property name="spacing">18</property>
<child>
+ <object class="GtkLabel" id="wayland_info_label">
+ <property name="visible">False</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Some options not available on Wayland</property>
+ <property name="xalign">0</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkBox" id="window_list_content_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -154,7 +170,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
@@ -270,7 +286,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
diff --git a/autogen.sh b/autogen.sh
index 7ab25df9..007b0ba9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -18,7 +18,6 @@ which mate-autogen || {
}
REQUIRED_AUTOMAKE_VERSION=1.9
-USE_MATE2_MACROS=1
USE_COMMON_DOC_BUILD=yes
. mate-autogen
diff --git a/mate-panel/libmate-panel-applet-private/panel-applet-container.c b/mate-panel/libmate-panel-applet-private/panel-applet-container.c
index 9354b999..9a4945a0 100644
--- a/mate-panel/libmate-panel-applet-private/panel-applet-container.c
+++ b/mate-panel/libmate-panel-applet-private/panel-applet-container.c
@@ -352,23 +352,20 @@ on_proxy_appeared (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
- GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data);
+ GTask *task = G_TASK (user_data);
MatePanelAppletContainer *container;
GDBusProxy *proxy;
GError *error = NULL;
proxy = g_dbus_proxy_new_finish (res, &error);
if (!proxy) {
- g_simple_async_result_set_from_error (result, error);
- g_error_free (error);
- g_simple_async_result_complete (result);
- g_object_unref (result);
+ g_task_return_error (task, error);
+ g_object_unref (task);
return;
}
- container = MATE_PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (result)));
-
+ container = MATE_PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (task)));
container->priv->applet_proxy = proxy;
g_signal_connect (container->priv->applet_proxy, "g-signal",
G_CALLBACK (mate_panel_applet_container_child_signal),
@@ -383,8 +380,8 @@ on_proxy_appeared (GObject *source_object,
(GDBusSignalCallback) on_property_changed,
container, NULL);
- g_simple_async_result_complete (result);
- g_object_unref (result);
+ g_task_return_boolean (task,TRUE);
+ g_object_unref (task);
panel_applet_container_setup (container);
@@ -406,7 +403,7 @@ get_applet_cb (GObject *source_object,
gpointer user_data)
{
GDBusConnection *connection = G_DBUS_CONNECTION (source_object);
- GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data);
+ GTask *task = G_TASK (user_data);
MatePanelAppletContainer *container;
GVariant *retvals;
const gchar *applet_path;
@@ -414,15 +411,13 @@ get_applet_cb (GObject *source_object,
retvals = g_dbus_connection_call_finish (connection, res, &error);
if (!retvals) {
- g_simple_async_result_set_from_error (result, error);
- g_error_free (error);
- g_simple_async_result_complete (result);
- g_object_unref (result);
+ g_task_return_error (task, error);
+ g_object_unref (task);
return;
}
- container = MATE_PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (result)));
+ container = MATE_PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (task)));
g_variant_get (retvals,
"(&obuu)",
&applet_path,
@@ -438,7 +433,7 @@ get_applet_cb (GObject *source_object,
MATE_PANEL_APPLET_INTERFACE,
NULL,
(GAsyncReadyCallback) on_proxy_appeared,
- result);
+ task);
g_variant_unref (retvals);
@@ -447,7 +442,6 @@ get_applet_cb (GObject *source_object,
}
typedef struct {
- GSimpleAsyncResult *result;
gchar *factory_id;
GVariant *parameters;
GCancellable *cancellable;
@@ -467,12 +461,14 @@ static void
on_factory_appeared (GDBusConnection *connection,
const gchar *name,
const gchar *name_owner,
- AppletFactoryData *data)
+ GTask *task)
{
MatePanelAppletContainer *container;
gchar *object_path;
+ AppletFactoryData *data;
- container = MATE_PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (data->result)));
+ data = g_task_get_task_data (task);
+ container = MATE_PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (task)));
container->priv->bus_name = g_strdup (name_owner);
object_path = g_strdup_printf (MATE_PANEL_APPLET_FACTORY_OBJECT_PATH, data->factory_id);
g_dbus_connection_call (connection,
@@ -486,7 +482,7 @@ on_factory_appeared (GDBusConnection *connection,
-1,
data->cancellable,
get_applet_cb,
- data->result);
+ task);
g_free (object_path);
}
@@ -499,27 +495,25 @@ mate_panel_applet_container_get_applet (MatePanelAppletContainer *container,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GSimpleAsyncResult *result;
+ GTask *task;
AppletFactoryData *data;
gint screen_number;
gchar *bus_name;
gchar *factory_id;
gchar *applet_id;
- result = g_simple_async_result_new (G_OBJECT (container),
- callback,
- user_data,
- mate_panel_applet_container_get_applet);
-
+ task = g_task_new (G_OBJECT (container),
+ cancellable,
+ callback,
+ user_data);
+ g_task_set_source_tag (task,mate_panel_applet_container_get_applet);
applet_id = g_strrstr (iid, "::");
- if (!applet_id) {
- g_simple_async_result_set_error (result,
- MATE_PANEL_APPLET_CONTAINER_ERROR,
- MATE_PANEL_APPLET_CONTAINER_INVALID_APPLET,
- "Invalid applet iid: %s", iid);
- g_simple_async_result_complete (result);
- g_object_unref (result);
-
+ if (!applet_id) {
+ g_task_return_new_error (task,
+ MATE_PANEL_APPLET_CONTAINER_ERROR,
+ MATE_PANEL_APPLET_CONTAINER_INVALID_APPLET,
+ "Invalid applet iid: %s", iid);
+ g_object_unref (task);
return;
}
@@ -538,11 +532,10 @@ mate_panel_applet_container_get_applet (MatePanelAppletContainer *container,
}
data = g_new (AppletFactoryData, 1);
- data->result = result;
data->factory_id = factory_id;
data->parameters = g_variant_new ("(si*)", applet_id, screen_number, props);
data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
-
+ g_task_set_task_data (task,data,(GDestroyNotify) applet_factory_data_free);
bus_name = g_strdup_printf (MATE_PANEL_APPLET_BUS_NAME, factory_id);
container->priv->iid = g_strdup (iid);
@@ -552,8 +545,8 @@ mate_panel_applet_container_get_applet (MatePanelAppletContainer *container,
G_BUS_NAME_WATCHER_FLAGS_AUTO_START,
(GBusNameAppearedCallback) on_factory_appeared,
NULL,
- data,
- (GDestroyNotify) applet_factory_data_free);
+ task,
+ NULL);
g_free (bus_name);
}
@@ -581,11 +574,9 @@ mate_panel_applet_container_add_finish (MatePanelAppletContainer *container,
GAsyncResult *result,
GError **error)
{
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
-
- g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == mate_panel_applet_container_get_applet);
-
- return !g_simple_async_result_propagate_error (simple, error);
+ g_return_val_if_fail (g_task_is_valid (result, container), FALSE);
+ g_warn_if_fail (g_task_get_source_tag (G_TASK (result)) == mate_panel_applet_container_get_applet);
+ return g_task_propagate_boolean (G_TASK (result), error);
}
/* Child Properties */
@@ -595,7 +586,7 @@ set_applet_property_cb (GObject *source_object,
gpointer user_data)
{
GDBusConnection *connection = G_DBUS_CONNECTION (source_object);
- GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data);
+ GTask *task = G_TASK (user_data);
MatePanelAppletContainer *container;
GVariant *retvals;
GError *error = NULL;
@@ -604,16 +595,16 @@ set_applet_property_cb (GObject *source_object,
if (!retvals) {
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Error setting property: %s\n", error->message);
- g_simple_async_result_set_from_error (result, error);
- g_error_free (error);
+ g_task_return_error (task, error);
+ return;
} else {
g_variant_unref (retvals);
}
- container = MATE_PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (result)));
- g_hash_table_remove (container->priv->pending_ops, result);
- g_simple_async_result_complete (result);
- g_object_unref (result);
+ container = MATE_PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (task)));
+ g_hash_table_remove (container->priv->pending_ops, task);
+ g_task_return_boolean (task,TRUE);
+ g_object_unref (task);
/* g_async_result_get_source_object returns new ref */
g_object_unref (container);
@@ -629,32 +620,33 @@ mate_panel_applet_container_child_set (MatePanelAppletContainer *container,
{
GDBusProxy *proxy = container->priv->applet_proxy;
const AppletPropertyInfo *info;
- GSimpleAsyncResult *result;
-
+ GTask *task;
if (!proxy)
return NULL;
info = mate_panel_applet_container_child_property_get_info (property_name);
if (!info) {
- g_simple_async_report_error_in_idle (G_OBJECT (container),
- callback, user_data,
- MATE_PANEL_APPLET_CONTAINER_ERROR,
- MATE_PANEL_APPLET_CONTAINER_INVALID_CHILD_PROPERTY,
- "%s: Applet has no child property named `%s'",
- G_STRLOC, property_name);
+ g_task_report_new_error (G_OBJECT (container),
+ callback, user_data,
+ NULL,
+ MATE_PANEL_APPLET_CONTAINER_ERROR,
+ MATE_PANEL_APPLET_CONTAINER_INVALID_CHILD_PROPERTY,
+ "%s: Applet has no child property named `%s'",
+ G_STRLOC, property_name);
return NULL;
}
- result = g_simple_async_result_new (G_OBJECT (container),
- callback,
- user_data,
- mate_panel_applet_container_child_set);
+ task = g_task_new (G_OBJECT (container),
+ cancellable,
+ callback,
+ user_data);
+ g_task_set_source_tag (task,mate_panel_applet_container_child_set);
if (cancellable)
g_object_ref (cancellable);
else
cancellable = g_cancellable_new ();
- g_hash_table_insert (container->priv->pending_ops, result, cancellable);
+ g_hash_table_insert (container->priv->pending_ops, task, cancellable);
g_dbus_connection_call (g_dbus_proxy_get_connection (proxy),
g_dbus_proxy_get_name (proxy),
@@ -669,9 +661,9 @@ mate_panel_applet_container_child_set (MatePanelAppletContainer *container,
G_DBUS_CALL_FLAGS_NO_AUTO_START,
-1, cancellable,
set_applet_property_cb,
- result);
+ task);
- return result;
+ return task;
}
gboolean
@@ -679,11 +671,9 @@ mate_panel_applet_container_child_set_finish (MatePanelAppletContainer *containe
GAsyncResult *result,
GError **error)
{
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
-
- g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == mate_panel_applet_container_child_set);
-
- return !g_simple_async_result_propagate_error (simple, error);
+ g_return_val_if_fail (g_task_is_valid (result, container), FALSE);
+ g_warn_if_fail (g_task_get_source_tag (G_TASK (result)) == mate_panel_applet_container_child_set);
+ return g_task_propagate_boolean (G_TASK (result), error);
}
static void
@@ -692,34 +682,30 @@ get_applet_property_cb (GObject *source_object,
gpointer user_data)
{
GDBusConnection *connection = G_DBUS_CONNECTION (source_object);
- GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data);
+ GTask *task = G_TASK (user_data);
MatePanelAppletContainer *container;
GVariant *retvals;
+ GVariant *value, *item;
GError *error = NULL;
retvals = g_dbus_connection_call_finish (connection, res, &error);
if (!retvals) {
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Error getting property: %s\n", error->message);
- g_simple_async_result_set_from_error (result, error);
- g_error_free (error);
- } else {
- GVariant *value, *item;
-
- item = g_variant_get_child_value (retvals, 0);
- value = g_variant_get_variant (item);
- g_variant_unref (item);
- g_simple_async_result_set_op_res_gpointer (result, value,
- (GDestroyNotify) g_variant_unref);
- g_variant_unref (retvals);
+ g_task_return_error (task, error);
+ return;
}
- container = MATE_PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (result)));
- g_hash_table_remove (container->priv->pending_ops, result);
- g_simple_async_result_complete (result);
- g_object_unref (result);
+ item = g_variant_get_child_value (retvals, 0);
+ value = g_variant_get_variant (item);
+ g_variant_unref (item);
+ g_variant_unref (retvals);
+
+ container = MATE_PANEL_APPLET_CONTAINER (g_async_result_get_source_object (G_ASYNC_RESULT (task)));
+ g_hash_table_remove (container->priv->pending_ops, task);
+ g_task_return_pointer (task,value,(GDestroyNotify) g_variant_unref);
+ g_object_unref (task);
- /* g_async_result_get_source_object returns new ref */
g_object_unref (container);
}
@@ -732,31 +718,27 @@ mate_panel_applet_container_child_get (MatePanelAppletContainer *container,
{
GDBusProxy *proxy = container->priv->applet_proxy;
const AppletPropertyInfo *info;
- GSimpleAsyncResult *result;
+ GTask *task;
if (!proxy)
return NULL;
info = mate_panel_applet_container_child_property_get_info (property_name);
if (!info) {
- g_simple_async_report_error_in_idle (G_OBJECT (container),
- callback, user_data,
- MATE_PANEL_APPLET_CONTAINER_ERROR,
- MATE_PANEL_APPLET_CONTAINER_INVALID_CHILD_PROPERTY,
- "%s: Applet has no child property named `%s'",
- G_STRLOC, property_name);
+ g_warning ("mate_panel_applet_container_child_get error");
return NULL;
}
- result = g_simple_async_result_new (G_OBJECT (container),
- callback,
- user_data,
- mate_panel_applet_container_child_get);
+ task = g_task_new (G_OBJECT (container),
+ cancellable,
+ callback,
+ user_data);
+ g_task_set_source_tag (task,mate_panel_applet_container_child_get);
if (cancellable)
g_object_ref (cancellable);
else
cancellable = g_cancellable_new ();
- g_hash_table_insert (container->priv->pending_ops, result, cancellable);
+ g_hash_table_insert (container->priv->pending_ops, task, cancellable);
g_dbus_connection_call (g_dbus_proxy_get_connection (proxy),
g_dbus_proxy_get_name (proxy),
@@ -770,9 +752,9 @@ mate_panel_applet_container_child_get (MatePanelAppletContainer *container,
G_DBUS_CALL_FLAGS_NO_AUTO_START,
-1, cancellable,
get_applet_property_cb,
- result);
+ task);
- return result;
+ return task;
}
GVariant *
@@ -780,14 +762,10 @@ mate_panel_applet_container_child_get_finish (MatePanelAppletContainer *containe
GAsyncResult *result,
GError **error)
{
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
-
- g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == mate_panel_applet_container_child_get);
-
- if (g_simple_async_result_propagate_error (simple, error))
- return NULL;
-
- return g_variant_ref (g_simple_async_result_get_op_res_gpointer (simple));
+ g_return_val_if_fail (g_task_is_valid (result, container), NULL);
+ g_warn_if_fail (g_task_get_source_tag (G_TASK (result)) == mate_panel_applet_container_child_get);
+
+ return g_variant_ref (g_task_propagate_pointer (G_TASK (result), error));
}
static void
@@ -796,20 +774,20 @@ child_popup_menu_cb (GObject *source_object,
gpointer user_data)
{
GDBusConnection *connection = G_DBUS_CONNECTION (source_object);
- GSimpleAsyncResult *result = G_SIMPLE_ASYNC_RESULT (user_data);
+ GTask *task = G_TASK (user_data);
GVariant *retvals;
GError *error = NULL;
retvals = g_dbus_connection_call_finish (connection, res, &error);
if (!retvals) {
- g_simple_async_result_set_from_error (result, error);
- g_error_free (error);
+ g_task_return_error (task, error);
+ return;
} else {
g_variant_unref (retvals);
+ g_task_return_boolean (task,TRUE);
}
- g_simple_async_result_complete (result);
- g_object_unref (result);
+ g_object_unref (task);
}
void
@@ -820,16 +798,16 @@ mate_panel_applet_container_child_popup_menu (MatePanelAppletContainer *containe
GAsyncReadyCallback callback,
gpointer user_data)
{
- GSimpleAsyncResult *result;
+ GTask *task;
GDBusProxy *proxy = container->priv->applet_proxy;
if (!proxy)
return;
-
- result = g_simple_async_result_new (G_OBJECT (container),
- callback,
- user_data,
- mate_panel_applet_container_child_popup_menu);
+ task = g_task_new (G_OBJECT (container),
+ cancellable,
+ callback,
+ user_data);
+ g_task_set_source_tag (task,mate_panel_applet_container_child_popup_menu);
g_dbus_connection_call (g_dbus_proxy_get_connection (proxy),
g_dbus_proxy_get_name (proxy),
@@ -841,7 +819,7 @@ mate_panel_applet_container_child_popup_menu (MatePanelAppletContainer *containe
G_DBUS_CALL_FLAGS_NO_AUTO_START,
-1, cancellable,
child_popup_menu_cb,
- result);
+ task);
}
gboolean
@@ -849,11 +827,9 @@ mate_panel_applet_container_child_popup_menu_finish (MatePanelAppletContainer *c
GAsyncResult *result,
GError **error)
{
- GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
-
- g_warn_if_fail (g_simple_async_result_get_source_tag (simple) == mate_panel_applet_container_child_popup_menu);
-
- return !g_simple_async_result_propagate_error (simple, error);
+ g_return_val_if_fail (g_task_is_valid (result, container), FALSE);
+ g_warn_if_fail (g_task_get_source_tag (G_TASK (result)) == mate_panel_applet_container_child_popup_menu);
+ return g_task_propagate_boolean (G_TASK (result), error);
}
void