1
0
Fork 0

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:
Jonas Ådahl 2024-06-30 23:46:27 +02:00
parent a212f823e7
commit c4f1396570

View file

@ -1849,7 +1849,7 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
g_list_free (combined_outputs);
g_list_free (combined_crtcs);
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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 (&properties_builder));
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
#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_ERROR_ACCESS_DENIED,
"The requested configuration is based on stale information");
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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_ERROR_ACCESS_DENIED,
"Monitor configuration via D-Bus is disabled");
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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_ERROR_INVALID_ARGS,
"Can't set layout mode");
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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_ERROR_ACCESS_DENIED,
"Invalid layout mode specified");
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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_list_free_full (logical_monitor_configs,
(GDestroyNotify) meta_logical_monitor_config_free);
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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);
g_error_free (error);
g_object_unref (config);
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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);
g_error_free (error);
g_object_unref (config);
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
if (method != META_MONITORS_CONFIG_METHOD_VERIFY)
@ -2793,7 +2793,7 @@ meta_monitor_manager_handle_apply_monitors_config (MetaDBusDisplayConfig *skelet
"%s", error->message);
g_error_free (error);
g_object_unref (config);
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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);
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
#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_ERROR_ACCESS_DENIED,
"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);
@ -2859,7 +2859,7 @@ meta_monitor_manager_handle_change_backlight (MetaDBusDisplayConfig *skeleton,
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_INVALID_ARGS,
"Invalid output id");
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
output = g_list_nth_data (combined_outputs, output_index);
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_ERROR_INVALID_ARGS,
"Invalid backlight value");
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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_ERROR_INVALID_ARGS,
"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);
@ -2889,7 +2889,7 @@ meta_monitor_manager_handle_change_backlight (MetaDBusDisplayConfig *skeleton,
meta_dbus_display_config_complete_change_backlight (skeleton,
invocation,
new_backlight);
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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_ERROR_ACCESS_DENIED,
"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);
@ -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_ERROR_INVALID_ARGS,
"Invalid crtc id");
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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 (blue_bytes);
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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_ERROR_ACCESS_DENIED,
"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);
@ -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_ERROR_INVALID_ARGS,
"Invalid crtc id");
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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 (blue_bytes);
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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_ERROR_ACCESS_DENIED,
"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);
@ -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_ERROR_INVALID_ARGS,
"Invalid output id");
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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_ERROR_INVALID_ARGS,
"Unexpected color transform matrix variant length");
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
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);
meta_dbus_display_config_complete_set_output_ctm (skeleton, invocation);
return TRUE;
return G_DBUS_METHOD_INVOCATION_HANDLED;
}
static void