monitor-manager: Use explicit method invocation return value
Using G_DBUSMETHOD_INVOCATION_HANDLED is clearer than TRUE in what it means. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3861>
This commit is contained in:
parent
a212f823e7
commit
c4f1396570
@ -1849,7 +1849,7 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_list_free (combined_outputs);
|
g_list_free (combined_outputs);
|
||||||
g_list_free (combined_crtcs);
|
g_list_free (combined_crtcs);
|
||||||
|
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -2182,7 +2182,7 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_variant_builder_end (&logical_monitors_builder),
|
g_variant_builder_end (&logical_monitors_builder),
|
||||||
g_variant_builder_end (&properties_builder));
|
g_variant_builder_end (&properties_builder));
|
||||||
|
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef MODE_FORMAT
|
#undef MODE_FORMAT
|
||||||
@ -2672,7 +2672,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_ACCESS_DENIED,
|
G_DBUS_ERROR_ACCESS_DENIED,
|
||||||
"The requested configuration is based on stale information");
|
"The requested configuration is based on stale information");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
config_store =
|
config_store =
|
||||||
@ -2684,7 +2684,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_ACCESS_DENIED,
|
G_DBUS_ERROR_ACCESS_DENIED,
|
||||||
"Monitor configuration via D-Bus is disabled");
|
"Monitor configuration via D-Bus is disabled");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
capabilities = meta_monitor_manager_get_capabilities (manager);
|
capabilities = meta_monitor_manager_get_capabilities (manager);
|
||||||
@ -2709,7 +2709,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_INVALID_ARGS,
|
G_DBUS_ERROR_INVALID_ARGS,
|
||||||
"Can't set layout mode");
|
"Can't set layout mode");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_valid_layout_mode (layout_mode))
|
if (!is_valid_layout_mode (layout_mode))
|
||||||
@ -2717,7 +2717,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_ACCESS_DENIED,
|
G_DBUS_ERROR_ACCESS_DENIED,
|
||||||
"Invalid layout mode specified");
|
"Invalid layout mode specified");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_variant_iter_init (&logical_monitor_configs_iter,
|
g_variant_iter_init (&logical_monitor_configs_iter,
|
||||||
@ -2746,7 +2746,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet
|
|||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
g_list_free_full (logical_monitor_configs,
|
g_list_free_full (logical_monitor_configs,
|
||||||
(GDestroyNotify) meta_logical_monitor_config_free);
|
(GDestroyNotify) meta_logical_monitor_config_free);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
logical_monitor_configs = g_list_append (logical_monitor_configs,
|
logical_monitor_configs = g_list_append (logical_monitor_configs,
|
||||||
@ -2764,7 +2764,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet
|
|||||||
"%s", error->message);
|
"%s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
g_object_unref (config);
|
g_object_unref (config);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!meta_monitor_manager_is_config_applicable (manager, config, &error))
|
if (!meta_monitor_manager_is_config_applicable (manager, config, &error))
|
||||||
@ -2774,7 +2774,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet
|
|||||||
"%s", error->message);
|
"%s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
g_object_unref (config);
|
g_object_unref (config);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (method != META_MONITORS_CONFIG_METHOD_VERIFY)
|
if (method != META_MONITORS_CONFIG_METHOD_VERIFY)
|
||||||
@ -2793,7 +2793,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet
|
|||||||
"%s", error->message);
|
"%s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
g_object_unref (config);
|
g_object_unref (config);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (method == META_MONITORS_CONFIG_METHOD_PERSISTENT)
|
if (method == META_MONITORS_CONFIG_METHOD_PERSISTENT)
|
||||||
@ -2801,7 +2801,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet
|
|||||||
|
|
||||||
meta_dbus_display_config_complete_apply_monitors_config (skeleton, invocation);
|
meta_dbus_display_config_complete_apply_monitors_config (skeleton, invocation);
|
||||||
|
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef MONITOR_MODE_SPEC_FORMAT
|
#undef MONITOR_MODE_SPEC_FORMAT
|
||||||
@ -2848,7 +2848,7 @@ meta_monitor_manager_handle_change_backlight (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_ACCESS_DENIED,
|
G_DBUS_ERROR_ACCESS_DENIED,
|
||||||
"The requested configuration is based on stale information");
|
"The requested configuration is based on stale information");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
combined_outputs = combine_gpu_lists (manager, meta_gpu_get_outputs);
|
combined_outputs = combine_gpu_lists (manager, meta_gpu_get_outputs);
|
||||||
@ -2859,7 +2859,7 @@ meta_monitor_manager_handle_change_backlight (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_INVALID_ARGS,
|
G_DBUS_ERROR_INVALID_ARGS,
|
||||||
"Invalid output id");
|
"Invalid output id");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
output = g_list_nth_data (combined_outputs, output_index);
|
output = g_list_nth_data (combined_outputs, output_index);
|
||||||
g_list_free (combined_outputs);
|
g_list_free (combined_outputs);
|
||||||
@ -2869,7 +2869,7 @@ meta_monitor_manager_handle_change_backlight (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_INVALID_ARGS,
|
G_DBUS_ERROR_INVALID_ARGS,
|
||||||
"Invalid backlight value");
|
"Invalid backlight value");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
output_info = meta_output_get_info (output);
|
output_info = meta_output_get_info (output);
|
||||||
@ -2880,7 +2880,7 @@ meta_monitor_manager_handle_change_backlight (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_INVALID_ARGS,
|
G_DBUS_ERROR_INVALID_ARGS,
|
||||||
"Output does not support changing backlight");
|
"Output does not support changing backlight");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
META_MONITOR_MANAGER_GET_CLASS (manager)->change_backlight (manager, output, value);
|
META_MONITOR_MANAGER_GET_CLASS (manager)->change_backlight (manager, output, value);
|
||||||
@ -2889,7 +2889,7 @@ meta_monitor_manager_handle_change_backlight (MetaDBusDisplayConfig *skeleton,
|
|||||||
meta_dbus_display_config_complete_change_backlight (skeleton,
|
meta_dbus_display_config_complete_change_backlight (skeleton,
|
||||||
invocation,
|
invocation,
|
||||||
new_backlight);
|
new_backlight);
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -2910,7 +2910,7 @@ meta_monitor_manager_handle_get_crtc_gamma (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_ACCESS_DENIED,
|
G_DBUS_ERROR_ACCESS_DENIED,
|
||||||
"The requested configuration is based on stale information");
|
"The requested configuration is based on stale information");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
combined_crtcs = combine_gpu_lists (manager, meta_gpu_get_crtcs);
|
combined_crtcs = combine_gpu_lists (manager, meta_gpu_get_crtcs);
|
||||||
@ -2920,7 +2920,7 @@ meta_monitor_manager_handle_get_crtc_gamma (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_INVALID_ARGS,
|
G_DBUS_ERROR_INVALID_ARGS,
|
||||||
"Invalid crtc id");
|
"Invalid crtc id");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
crtc = g_list_nth_data (combined_crtcs, crtc_id);
|
crtc = g_list_nth_data (combined_crtcs, crtc_id);
|
||||||
@ -2946,7 +2946,7 @@ meta_monitor_manager_handle_get_crtc_gamma (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_bytes_unref (green_bytes);
|
g_bytes_unref (green_bytes);
|
||||||
g_bytes_unref (blue_bytes);
|
g_bytes_unref (blue_bytes);
|
||||||
|
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -2970,7 +2970,7 @@ meta_monitor_manager_handle_set_crtc_gamma (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_ACCESS_DENIED,
|
G_DBUS_ERROR_ACCESS_DENIED,
|
||||||
"The requested configuration is based on stale information");
|
"The requested configuration is based on stale information");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
combined_crtcs = combine_gpu_lists (manager, meta_gpu_get_crtcs);
|
combined_crtcs = combine_gpu_lists (manager, meta_gpu_get_crtcs);
|
||||||
@ -2981,7 +2981,7 @@ meta_monitor_manager_handle_set_crtc_gamma (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_INVALID_ARGS,
|
G_DBUS_ERROR_INVALID_ARGS,
|
||||||
"Invalid crtc id");
|
"Invalid crtc id");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
crtc = g_list_nth_data (combined_crtcs, crtc_id);
|
crtc = g_list_nth_data (combined_crtcs, crtc_id);
|
||||||
@ -3003,7 +3003,7 @@ meta_monitor_manager_handle_set_crtc_gamma (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_bytes_unref (green_bytes);
|
g_bytes_unref (green_bytes);
|
||||||
g_bytes_unref (blue_bytes);
|
g_bytes_unref (blue_bytes);
|
||||||
|
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -3025,7 +3025,7 @@ meta_monitor_manager_handle_set_output_ctm (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_ACCESS_DENIED,
|
G_DBUS_ERROR_ACCESS_DENIED,
|
||||||
"The requested configuration is based on stale information");
|
"The requested configuration is based on stale information");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
combined_outputs = combine_gpu_lists (manager, meta_gpu_get_outputs);
|
combined_outputs = combine_gpu_lists (manager, meta_gpu_get_outputs);
|
||||||
@ -3036,7 +3036,7 @@ meta_monitor_manager_handle_set_output_ctm (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_INVALID_ARGS,
|
G_DBUS_ERROR_INVALID_ARGS,
|
||||||
"Invalid output id");
|
"Invalid output id");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
output = g_list_nth_data (combined_outputs, output_id);
|
output = g_list_nth_data (combined_outputs, output_id);
|
||||||
@ -3047,7 +3047,7 @@ meta_monitor_manager_handle_set_output_ctm (MetaDBusDisplayConfig *skeleton,
|
|||||||
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
|
||||||
G_DBUS_ERROR_INVALID_ARGS,
|
G_DBUS_ERROR_INVALID_ARGS,
|
||||||
"Unexpected color transform matrix variant length");
|
"Unexpected color transform matrix variant length");
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 9; i++)
|
for (i = 0; i < 9; i++)
|
||||||
@ -3062,7 +3062,7 @@ meta_monitor_manager_handle_set_output_ctm (MetaDBusDisplayConfig *skeleton,
|
|||||||
klass->set_output_ctm (output, &ctm);
|
klass->set_output_ctm (output, &ctm);
|
||||||
meta_dbus_display_config_complete_set_output_ctm (skeleton, invocation);
|
meta_dbus_display_config_complete_set_output_ctm (skeleton, invocation);
|
||||||
|
|
||||||
return TRUE;
|
return G_DBUS_METHOD_INVOCATION_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user