compositor: remove the weston_config field in weston_compositor
The config can now be retrieved with a new function defined in weston.h, wet_get_config(weston_compositor*). Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
committed by
Pekka Paalanen
parent
fba27fbef2
commit
d52f3b775b
+2
-1
@@ -31,6 +31,7 @@
|
||||
#include "compositor.h"
|
||||
#include "cms-helper.h"
|
||||
#include "shared/helpers.h"
|
||||
#include "weston.h"
|
||||
|
||||
struct cms_static {
|
||||
struct weston_compositor *ec;
|
||||
@@ -49,7 +50,7 @@ cms_output_created(struct cms_static *cms, struct weston_output *o)
|
||||
|
||||
if (o->name == NULL)
|
||||
return;
|
||||
s = weston_config_get_section(cms->ec->config,
|
||||
s = weston_config_get_section(wet_get_config(cms->ec),
|
||||
"output", "name", o->name);
|
||||
if (s == NULL)
|
||||
return;
|
||||
|
||||
@@ -726,7 +726,6 @@ struct weston_compositor {
|
||||
|
||||
struct wl_display *wl_display;
|
||||
struct weston_shell_interface shell_interface;
|
||||
struct weston_config *config;
|
||||
|
||||
/* surface signals */
|
||||
struct wl_signal create_surface_signal;
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "compositor.h"
|
||||
#include "libinput-device.h"
|
||||
#include "shared/helpers.h"
|
||||
#include "weston.h"
|
||||
|
||||
void
|
||||
evdev_led_update(struct evdev_device *device, enum weston_led weston_leds)
|
||||
@@ -528,10 +529,11 @@ configure_device(struct evdev_device *device)
|
||||
{
|
||||
struct weston_compositor *compositor = device->seat->compositor;
|
||||
struct weston_config_section *s;
|
||||
struct weston_config *config = wet_get_config(compositor);
|
||||
int enable_tap;
|
||||
int enable_tap_default;
|
||||
|
||||
s = weston_config_get_section(compositor->config,
|
||||
s = weston_config_get_section(config,
|
||||
"libinput", NULL, NULL);
|
||||
|
||||
if (libinput_device_config_tap_get_finger_count(device->device) > 0) {
|
||||
|
||||
+7
-2
@@ -331,6 +331,12 @@ log_uname(void)
|
||||
usys.version, usys.machine);
|
||||
}
|
||||
|
||||
WL_EXPORT struct weston_config *
|
||||
wet_get_config(struct weston_compositor *compositor)
|
||||
{
|
||||
return weston_compositor_get_user_data(compositor);
|
||||
}
|
||||
|
||||
static const char xdg_error_message[] =
|
||||
"fatal: environment variable XDG_RUNTIME_DIR is not set.\n";
|
||||
|
||||
@@ -831,7 +837,7 @@ drm_configure_output(struct weston_compositor *c,
|
||||
const char *name,
|
||||
struct weston_drm_backend_output_config *config)
|
||||
{
|
||||
struct weston_config *wc = weston_compositor_get_user_data(c);
|
||||
struct weston_config *wc = wet_get_config(c);
|
||||
struct weston_config_section *section;
|
||||
char *s;
|
||||
int scale;
|
||||
@@ -1496,7 +1502,6 @@ int main(int argc, char *argv[])
|
||||
goto out;
|
||||
}
|
||||
|
||||
ec->config = config;
|
||||
if (weston_compositor_init_config(ec, config) < 0)
|
||||
goto out;
|
||||
|
||||
|
||||
+2
-1
@@ -1026,11 +1026,12 @@ handle_seat_created(struct wl_listener *listener, void *data)
|
||||
static void
|
||||
text_backend_configuration(struct text_backend *text_backend)
|
||||
{
|
||||
struct weston_config *config = wet_get_config(text_backend->compositor);
|
||||
struct weston_config_section *section;
|
||||
char *client;
|
||||
int ret;
|
||||
|
||||
section = weston_config_get_section(text_backend->compositor->config,
|
||||
section = weston_config_get_section(config,
|
||||
"input-method", NULL, NULL);
|
||||
ret = asprintf(&client, "%s/weston-keyboard",
|
||||
weston_config_get_libexec_dir());
|
||||
|
||||
@@ -57,6 +57,9 @@ weston_client_start(struct weston_compositor *compositor, const char *path);
|
||||
void
|
||||
weston_watch_process(struct weston_process *process);
|
||||
|
||||
struct weston_config *
|
||||
wet_get_config(struct weston_compositor *compositor);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user