Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • mvaldina/weston
  • ant8me/weston
  • JaredHu/weston
  • drawat/weston
  • bnieuwenhuizen/weston
  • Robyn.marie/weston
  • dwrobel/weston
  • yjheo/weston
  • dos/weston
  • longjunyu2/weston
  • soerenmeier/weston
  • igor.torrente/weston
  • luckyziv/weston
  • qyliss/weston
  • tantan/weston
  • wengxt/weston
  • mroussin/weston
  • n3rdopolis/weston
  • xiangxuy/weston
  • RAOF/weston
  • afrantzis/weston
  • lujin/weston
  • jayjona42/weston
  • ascent/weston
  • inzamam.15/weston
  • bbara93/weston
  • adoan/weston
  • Vivalavina/weston
  • iason.paraskevopoulos/weston
  • phnaharris/weston
  • mforney/weston
  • linkmauve/weston
  • xexaxo/weston
  • rajendraprasadkj/weston
  • xeechou/weston
  • learning/weston
  • agners/weston
  • ianr/weston
  • eucan/weston
  • heemin.lee/weston
  • nniro/weston
  • PaulKocialkowski/weston
  • NaveenKumar/weston
  • msisov/weston
  • ollieparanoid/weston
  • pH5/weston
  • dbaker/weston
  • gtristan/weston
  • khosokawa/weston
  • lubosz/weston
  • Fahien/weston
  • m.tretter/weston
  • valpackett/weston
  • marimeireles/weston
  • afd/weston
  • lk1025/weston
  • marler8997/weston
  • jianglei121381/weston
  • flakylawww/weston
  • ayaka/weston
  • bbeckett/weston
  • rdp.effort/weston
  • Ganjing0224/weston
  • jcline/weston
  • bl4ckb0ne/weston
  • Bastian-Krause/weston
  • fifi899173/weston
  • jpewhacker/weston
  • yuanye100/weston
  • t-8ch/weston
  • HarshaMM/weston
  • david.turner/weston
  • wismill/weston
  • rsmith/weston
  • rohanjulka19/weston
  • shadeslayer/weston
  • sjoerd/weston
  • barry.song/weston
  • petervdperk/weston
  • renjiayuan1314/weston
  • HeYong/weston
  • bluesirhl/weston
  • macpijan/weston
  • andreinonea/weston
  • vanfanel/weston
  • mstoeckl/weston
  • chewi/weston
  • shierote/weston
  • tmaillart1/weston
  • jh-hsd/weston
  • bgjdarm/weston
  • anurup_m/weston
  • lucaweiss/weston
  • dima/weston
  • marysaka/weston
  • daissi/weston
  • vnguyentrong/weston
  • enocknyaega/weston
  • kang-sooyeon/weston
  • tpetazzoni/weston
  • mihlenfeldt/weston
  • rgallaispou/weston
  • chienpv/weston
  • kraj/weston
  • stolk/weston
  • Emantor/weston
  • kusma/weston
  • bmkimg/weston
  • 9531718244loco/weston
  • Ts/weston
  • kennylevinsen/weston
  • eyelash/weston
  • Igortorrente/weston
  • pleasurefish/weston
  • ahe/weston
  • ekurzinger/weston
  • pochu/weston
  • saavedra.pablo/weston
  • borneoa/weston
  • JimmyOhn/weston
  • ShivakumarVH/weston
  • Cwiiis/weston
  • romangg/weston
  • zubzub/weston
  • askebm/weston
  • ewtoombs/weston
  • wolf._.lael666/weston
  • dr3020187/weston
  • kxing/weston_hpd
  • filip-hejsek/weston
  • xndcn/weston
  • therealkenc/weston
  • C0rn3j/weston
  • tmaillart/weston
  • leandrohrb/weston
  • snow/weston
  • marex/weston
  • bnlrnz/weston
  • zhourunsheng2008/weston
  • zhouliang/weston
  • isinyaaa/weston
  • JeffyCN/weston
  • tzimmermann/weston
  • christian-rauch/weston
  • krh/weston
  • Rigo-V/weston
  • archiesix/weston
  • cwjo/weston
  • hedone21/weston
  • liyi42/weston
  • uniontechWu/weston
  • justdoGIT/weston
  • ajax/weston
  • pmenzel/weston
  • mominurisiamm887/weston
  • denix0/weston
  • ivyl/weston
  • fallahmahid.mahdi/weston
  • Alvarito050506/weston
  • obbardc/weston
  • joantolo/weston
  • zumbi/weston
  • doubleagent3276/weston
  • leoli/weston
  • dude/weston
  • cardenasvitealejandro/weston
  • ljia5/weston
  • Trigger.Huang/weston
  • swick/weston
  • Wladmis/weston
  • vyivel/weston
  • orbitcowboy/weston
  • AIDEA775/weston
  • maos20008/weston
  • mvicomoya/weston
  • bbrezillon/weston
  • wujiansun/weston
  • Benjamin_Loison/weston
  • rhelmot/weston
  • rgonzalez/weston
  • ekapllaj/weston
  • Shugyousha/weston
  • carbn/weston
  • derekf/weston
  • gyeyoung976/weston
  • dhobsong/weston
  • jeri.li/weston
  • mtey/weston
  • etom/weston
  • azeps/weston
  • champagneg/weston
  • makepost/weston
  • trem/weston
  • hwentland/weston
  • Ambyjkl/weston
  • YDinhVan/weston
  • pixellon/weston
  • daniels/weston
  • OctopusET/weston
  • emersion/weston
  • gilvbp/weston
  • yadneshk/weston
  • mvlad/weston
  • wayland/weston
  • phreer/weston
  • diegonieto/weston
  • vliaskov/weston
  • Vivek/weston
  • sami/weston
  • creiter/weston
  • luigi.santivetti/weston
  • aknautiyal/weston
  • martinetd/weston
  • 5HT/weston
  • yayowd/qimm
  • khangtb/weston
  • Laplac2/weston
  • pritbisw/weston
  • molinari/weston
  • vvavrychuk/weston
  • zzyiwei/weston
  • vanvugt/weston
  • pq/weston
  • qaqsw24/weston
  • gfxstrand/weston
  • alex.kanavin/weston
  • pinchyguey45/weston
  • davidre/weston
  • bigbear1385/weston
  • zzag/weston
  • benh/weston
  • harpreetbasra1313/weston
  • phomes/weston
  • rmader/weston
  • Heartyharts/weston
  • arandomhuman/weston
  • kchibisov/weston
  • hwti/weston
  • abhinavk/weston
  • vitalyp/weston
  • pedestrianlove/weston
  • sardemff7/weston
  • Ivaniku/tayland
  • JoseExposito/weston
  • zeerd/weston
  • jadahl/weston
  • sophia/weston
  • mol/weston
  • rawoul/weston
  • maxice8/weston
  • whot/weston
  • Qingwu-Li/weston
  • lfrb/weston
  • heftig/weston
  • Calandracas/weston
  • SergioGDR/weston
  • Foreal/weston
  • ghishadow/weston
  • puhui/weston
  • dmitry.batrak1/weston
  • fanbaby6/weston
  • chiragkhurana/weston
  • amaksoft/weston
  • surban/weston
  • smit-mayani/weston
  • jwillikers/weston
  • meshki022/weston
  • pritamabiswas/weston
  • antonino/weston
  • k77951586/weston
  • ChaoGuo/weston
  • ColinKinloch/weston
  • paraaz4959/weston
  • ivan.nikolaenko/weston
  • adarshgm/weston
  • ericruei/weston
  • harishkrupo/weston
  • VKadasani/weston
  • jameshilliard/weston
  • davidedmundson/weston
  • strassek/weston
  • flto/weston
  • Kishore409/weston
  • ktullavik/weston
  • Eugeniy.Paltsev/weston
  • sameer.lattannavar/weston
  • jesstindean85/weston
  • ashie/weston
  • Zamundaaa/weston
  • jlindgren90/weston
  • LARathbone/weston
  • g0hl1n/weston
  • matth/weston
  • nicolesager7/weston
  • hitong602/weston
  • Rpegusus2233/weston
  • bentiss/weston
  • hthiery/weston
  • thewayoftherob/weston
  • ofourdan/weston
  • enunes/weston
  • tomek/weston
  • bugaevc/weston
  • eero-t/weston
304 results
Show changes
Commits on Source (151)
Showing
with 487 additions and 169 deletions
......@@ -9,3 +9,5 @@ cscope.out
TAGS
00*.patch
build/
......@@ -20,26 +20,31 @@ stages:
variables:
FDO_DISTRIBUTION_VERSION: buster
FDO_DISTRIBUTION_EXEC: 'bash .gitlab-ci/debian-install.sh'
FDO_DISTRIBUTION_TAG: '2021-03-04.1'
FDO_DISTRIBUTION_TAG: '2021-04-15.2'
container_prep:
extends:
- .debian
- .fdo.container-build@debian
timeout: 30m
stage: container_prep
.build-native:
.build-env:
extends:
- .debian
- .fdo.distribution-image@debian
timeout: 5m
stage: build
variables:
BUILDDIR: $CI_PROJECT_DIR/build-weston-$CI_JOB_NAME
PREFIX: $CI_PROJECT_DIR/prefix-weston-$CI_JOB_NAME
before_script:
- git clone --depth=1 https://gitlab.freedesktop.org/wayland/wayland-protocols
- export WAYLAND_PROTOCOLS_DIR="$(pwd)/prefix-wayland-protocols"
- export PKG_CONFIG_PATH="$WAYLAND_PROTOCOLS_DIR/share/pkgconfig:$PKG_CONFIG_PATH"
- export MAKEFLAGS="-j4"
- export MAKEFLAGS="-j${FDO_CI_CONCURRENT:-4}"
- cd wayland-protocols
- git show -s HEAD
- mkdir build
......@@ -48,23 +53,20 @@ container_prep:
- make install
- cd ../../
- export XDG_RUNTIME_DIR="$(mktemp -p $(pwd) -d xdg-runtime-XXXXXX)"
- export BUILD_ID="weston-$CI_JOB_NAME"
- export PREFIX="$(pwd)/prefix-$BUILD_ID"
- export BUILDDIR="$(pwd)/build-$BUILD_ID"
- export TESTS_RES_PATH="$BUILDDIR/tests-res.txt"
- mkdir "$BUILDDIR" "$PREFIX"
.build-native-meson:
extends: .build-native
.build-and-test:
extends: .build-env
tags:
- kvm
script:
- export PATH=~/.local/bin:$PATH
- cd "$BUILDDIR"
- meson --prefix="$PREFIX" ${MESON_OPTIONS} ..
- ninja -k0
- meson --prefix="$PREFIX" -Db_sanitize=address ${MESON_OPTIONS} ..
- ninja -k0 -j${FDO_CI_CONCURRENT:-4}
- ninja install
- virtme-run --rw --pwd --kimg /weston-virtme/bzImage --script-dir ../.gitlab-ci/virtme-scripts
- virtme-run --rw --pwd --kimg /weston-virtme/bzImage --kopt quiet --script-dir ../.gitlab-ci/virtme-scripts --qemu-opts -m 4096 -smp ${FDO_CI_CONCURRENT:-4}
- TEST_RES=$(cat $TESTS_RES_PATH)
- rm $TESTS_RES_PATH
- cp -R /weston-virtme ./
......@@ -74,55 +76,56 @@ container_prep:
name: weston-$CI_COMMIT_SHA
when: always
paths:
- build-*/*.png
- build-*/meson-logs
- build-*/weston-virtme
- prefix-*
- $BUILDDIR/*.png
- $BUILDDIR/meson-logs
- $BUILDDIR/weston-virtme
- $PREFIX
reports:
junit: build-*/meson-logs/testlog.junit.xml
junit: $BUILDDIR/meson-logs/testlog.junit.xml
.build-native-meson-no-test:
extends: .build-native
.build-no-test:
extends: .build-env
tags:
- kvm
script:
- export PATH=~/.local/bin:$PATH
- cd "$BUILDDIR"
- meson --prefix="$PREFIX" ${MESON_OPTIONS} ..
- ninja -k0
- ninja -k0 -j${FDO_CI_CONCURRENT:-4}
- ninja install
- ninja clean
artifacts:
name: weston-$CI_COMMIT_SHA
when: always
paths:
- build-*/meson-logs
- prefix-*
- $BUILDDIR/meson-logs
- $PREFIX
build-native-meson-default-options:
build-full:
variables:
MESON_OPTIONS: >
-Doptimization=0
-Db_coverage=true
-Dwerror=true
-Dtest-skip-is-failure=true
extends: .build-native-meson
-Dlauncher-libseat=true
extends: .build-and-test
after_script:
- ninja -C build-* coverage-html
- ninja -C build-* coverage-xml
- sed -i -e 's/\/build-weston-build-native-meson-default-options//' -e 's/\"..\//\"/' build-*/meson-logs/coverage.xml
- ninja -C "$BUILDDIR" coverage-html > "$BUILDDIR/meson-logs/ninja-coverage-html.txt"
- ninja -C "$BUILDDIR" coverage-xml
- sed -i -e 's/\/build-weston-build-full//' -e 's/\"..\//\"/' "$BUILDDIR/meson-logs/coverage.xml"
artifacts:
reports:
cobertura: build-*/meson-logs/coverage.xml
cobertura: $BUILDDIR/meson-logs/coverage.xml
build-docs:
variables:
MESON_OPTIONS: >
-Dwerror=true
-Ddoc=true
extends: .build-native-meson-no-test
extends: .build-no-test
build-native-meson-no-gl-renderer:
build-no-gl:
variables:
MESON_OPTIONS: >
-Dsimple-clients=damage,im,shm,touch,dmabuf-v4l
......@@ -130,17 +133,22 @@ build-native-meson-no-gl-renderer:
-Dremoting=false
-Dpipewire=false
-Dwerror=true
extends: .build-native-meson
-Dlauncher-libseat=true
extends: .build-and-test
docs-and-coverage:
stage: pages
timeout: 5m
script:
- mv prefix-weston-build-docs/share/doc/weston Documentation
- mv build-weston-build-native-meson-default-options/meson-logs/coveragereport Test_Coverage
- mv build-weston-build-full/meson-logs/coveragereport Test_Coverage
- rm Test_Coverage/gcov.css
- cp doc/style/lcov-style.css Test_Coverage/gcov.css
- cp doc/style/*.png Test_Coverage/
- rm -rf build-* prefix-*
dependencies:
- build-docs
- build-native-meson-default-options
- build-full
artifacts:
expose_as: 'Documentation preview and test coverage report'
paths:
......@@ -149,6 +157,7 @@ docs-and-coverage:
pages:
stage: pages
timeout: 5m
dependencies:
- build-docs
script:
......@@ -159,4 +168,4 @@ pages:
paths:
- public
only:
- master
- main
......@@ -162,5 +162,14 @@ ninja -C build install
cd ..
rm -rf pipewire
git clone --depth=1 --branch 0.5.0 https://git.sr.ht/~kennylevinsen/seatd
cd seatd
meson build -Dauto_features=disabled \
-Dseatd=enabled -Dlogind=enabled -Dserver=enabled \
-Dexamples=disabled -Dman-pages=disabled
ninja -C build install
cd ..
rm -rf seatd
apt-get -y --autoremove purge $LINUX_DEV_PKGS
apt-get -y --autoremove purge $MESA_DEV_PKGS
# AddressSanitizer memory leak suppressions
# Cairo internal leaks from weston-keyboard
leak:cairo_select_font_face
leak:cairo_text_extents
......@@ -8,15 +8,22 @@ chmod -R 0700 /tmp
# set environment variables to run Weston tests
export XDG_RUNTIME_DIR=/tmp/tests
export WESTON_TEST_SUITE_DRM_DEVICE=card0
export LIBSEAT_BACKEND=seatd
# ninja test depends on meson, and meson itself looks for its modules on folder
# $HOME/.local/lib/pythonX.Y/site-packages (the Python version may differ).
# virtme starts with HOME=/tmp/roothome, but as we installed meson on user root,
# meson can not find its modules. So we change the HOME env var to fix that.
export HOME=/root
export PATH=$HOME/.local/bin:$PATH
# start seatd and wait for its socket to be available before running the test
/usr/local/bin/seatd &
while ! [ -e /run/seatd.sock ]; do sleep 0.1; done
# run the tests and save the exit status
ninja test
# we give ourselves a very generous timeout multiplier due to ASan overhead
ASAN_OPTIONS=detect_leaks=0,atexit=1 meson test --timeout-multiplier 4
TEST_RES=$?
# create a file to keep the result of this script:
......
......@@ -18,7 +18,7 @@ If you have picked an issue you would like to work on, you may want to mention
in the issue tracker that you would like to pick it up. You can also discuss
it with the developers in the issue tracker, or on the
[mailing list](https://lists.freedesktop.org/mailman/listinfo/wayland-devel).
Many developers also use IRC through [Freenode](https://freenode.net)'s
Many developers also use IRC through [OFTC](https://www.oftc.net/)'s
`#wayland` channel; however you may need to wait some time for a response on
IRC, which requires keeping your client connected. If you cannot stay for a
long time (potentially some hours due to timezone differences), then you
......
......@@ -60,6 +60,7 @@ struct virtual_keyboard {
uint32_t surrounding_cursor;
struct keyboard *keyboard;
bool toplevel;
struct zwp_input_panel_surface_v1 *ips;
};
enum key_type {
......@@ -969,6 +970,7 @@ set_toplevel(struct output *output, struct virtual_keyboard *virtual_keyboard)
ZWP_INPUT_PANEL_SURFACE_V1_POSITION_CENTER_BOTTOM);
virtual_keyboard->toplevel = true;
virtual_keyboard->ips = ips;
}
static void
......@@ -1011,6 +1013,23 @@ keyboard_create(struct virtual_keyboard *virtual_keyboard)
display_output_handler);
}
static void
keyboard_destroy(struct virtual_keyboard *virtual_keyboard)
{
if (virtual_keyboard->ips)
zwp_input_panel_surface_v1_destroy(virtual_keyboard->ips);
if (virtual_keyboard->input_panel)
zwp_input_panel_v1_destroy(virtual_keyboard->input_panel);
if (virtual_keyboard->input_method)
zwp_input_method_v1_destroy(virtual_keyboard->input_method);
widget_destroy(virtual_keyboard->keyboard->widget);
window_destroy(virtual_keyboard->keyboard->window);
free(virtual_keyboard->keyboard);
}
int
main(int argc, char *argv[])
{
......@@ -1037,5 +1056,8 @@ main(int argc, char *argv[])
display_run(virtual_keyboard.display);
keyboard_destroy(&virtual_keyboard);
display_destroy(virtual_keyboard.display);
return 0;
}
......@@ -78,6 +78,7 @@ struct display {
struct weston_direct_display_v1 *direct_display;
struct zwp_linux_explicit_synchronization_v1 *explicit_sync;
uint32_t format;
bool format_supported;
uint64_t *modifiers;
int modifiers_count;
int req_dmabuf_immediate;
......@@ -997,13 +998,19 @@ dmabuf_modifiers(void *data, struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf,
uint32_t format, uint32_t modifier_hi, uint32_t modifier_lo)
{
struct display *d = data;
uint64_t modifier = ((uint64_t)modifier_hi << 32) | modifier_lo;
if (format == d->format) {
if (format != d->format) {
return;
}
d->format_supported = true;
if (modifier != DRM_FORMAT_MOD_INVALID) {
++d->modifiers_count;
d->modifiers = realloc(d->modifiers,
d->modifiers_count * sizeof(*d->modifiers));
d->modifiers[d->modifiers_count - 1] =
((uint64_t)modifier_hi << 32) | modifier_lo;
d->modifiers[d->modifiers_count - 1] = modifier;
}
}
......@@ -1380,7 +1387,7 @@ create_display(char const *drm_render_node, uint32_t format, int opts)
wl_display_roundtrip(display->display);
if (!display->modifiers_count) {
if (!display->format_supported) {
fprintf(stderr, "format 0x%"PRIX32" is not available\n",
display->format);
goto error;
......
......@@ -882,6 +882,21 @@ main(int argc, char **argv)
if (display.cursor_theme)
wl_cursor_theme_destroy(display.cursor_theme);
if (display.shm)
wl_shm_destroy(display.shm);
if (display.pointer)
wl_pointer_destroy(display.pointer);
if (display.keyboard)
wl_keyboard_destroy(display.keyboard);
if (display.touch)
wl_touch_destroy(display.touch);
if (display.seat)
wl_seat_destroy(display.seat);
if (display.wm_base)
xdg_wm_base_destroy(display.wm_base);
......
......@@ -135,6 +135,7 @@ stream_destroy(struct debug_stream *stream)
weston_debug_stream_v1_destroy(stream->obj);
wl_list_remove(&stream->link);
free(stream->desc);
free(stream->name);
free(stream);
}
......
......@@ -1375,7 +1375,8 @@ create_cursors(struct display *display)
static void
destroy_cursors(struct display *display)
{
wl_cursor_theme_destroy(display->cursor_theme);
if (display->cursor_theme)
wl_cursor_theme_destroy(display->cursor_theme);
free(display->cursors);
}
......@@ -3785,6 +3786,8 @@ input_set_pointer_image_index(struct input *input, int index)
struct wl_buffer *buffer;
struct wl_cursor *cursor;
struct wl_cursor_image *image;
struct wl_surface *prev_surface;
struct display *d = input->display;
if (!input->pointer)
return;
......@@ -3803,6 +3806,11 @@ input_set_pointer_image_index(struct input *input, int index)
if (!buffer)
return;
/* Don't re-use the previous surface, otherwise the new buffer and the
* new hotspot aren't applied atomically. */
prev_surface = input->pointer_surface;
input->pointer_surface = wl_compositor_create_surface(d->compositor);
wl_surface_attach(input->pointer_surface, buffer, 0, 0);
wl_surface_damage(input->pointer_surface, 0, 0,
image->width, image->height);
......@@ -3810,6 +3818,9 @@ input_set_pointer_image_index(struct input *input, int index)
wl_pointer_set_cursor(input->pointer, input->pointer_enter_serial,
input->pointer_surface,
image->hotspot_x, image->hotspot_y);
if (prev_surface)
wl_surface_destroy(prev_surface);
}
static const struct wl_callback_listener pointer_surface_listener;
......@@ -3914,11 +3925,11 @@ pointer_surface_frame_callback(void *data, struct wl_callback *callback,
time - input->cursor_anim_start,
&duration);
input_set_pointer_image_index(input, i);
if (cursor->image_count > 1)
schedule_pointer_image_update(input, cursor, duration,
force_frame);
input_set_pointer_image_index(input, i);
}
static void
......@@ -5732,6 +5743,8 @@ output_destroy(struct output *output)
wl_output_destroy(output->output);
wl_list_remove(&output->link);
free(output->make);
free(output->model);
free(output);
}
......@@ -5865,6 +5878,8 @@ output_get_model(struct output *output)
static void
fini_xkb(struct input *input)
{
xkb_compose_state_unref(input->xkb.compose_state);
xkb_compose_table_unref(input->xkb.compose_table);
xkb_state_unref(input->xkb.state);
xkb_keymap_unref(input->xkb.keymap);
}
......@@ -5899,8 +5914,6 @@ display_add_input(struct display *d, uint32_t id, int display_seat_version)
input);
}
input->pointer_surface = wl_compositor_create_surface(d->compositor);
toytimer_init(&input->cursor_timer, CLOCK_MONOTONIC, d,
cursor_timer_func);
......@@ -5968,7 +5981,8 @@ input_destroy(struct input *input)
fini_xkb(input);
wl_surface_destroy(input->pointer_surface);
if (input->pointer_surface)
wl_surface_destroy(input->pointer_surface);
wl_list_remove(&input->link);
wl_seat_destroy(input->seat);
......@@ -5987,6 +6001,19 @@ static const struct xdg_wm_base_listener wm_base_listener = {
xdg_wm_base_ping,
};
static void
global_destroy(struct display *disp, struct global *g)
{
if (disp->global_handler_remove) {
disp->global_handler_remove(disp, g->name, g->interface,
g->version, disp->user_data);
}
wl_list_remove(&g->link);
free(g->interface);
free(g);
}
static void
registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
const char *interface, uint32_t version)
......@@ -6060,15 +6087,7 @@ registry_handle_global_remove(void *data, struct wl_registry *registry,
if (strcmp(global->interface, "wl_output") == 0)
display_destroy_output(d, name);
/* XXX: Should destroy remaining bound globals */
if (d->global_handler_remove)
d->global_handler_remove(d, name, global->interface,
global->version, d->user_data);
wl_list_remove(&global->link);
free(global->interface);
free(global);
global_destroy(d, global);
}
}
......@@ -6236,6 +6255,12 @@ display_create(int *argc, char *argv[])
if (d == NULL)
return NULL;
wl_list_init(&d->window_list);
wl_list_init(&d->deferred_list);
wl_list_init(&d->input_list);
wl_list_init(&d->output_list);
wl_list_init(&d->global_list);
d->display = wl_display_connect(NULL);
if (d->display == NULL) {
fprintf(stderr, "failed to connect to Wayland display: %s\n",
......@@ -6257,17 +6282,13 @@ display_create(int *argc, char *argv[])
display_watch_fd(d, d->display_fd, EPOLLIN | EPOLLERR | EPOLLHUP,
&d->display_task);
wl_list_init(&d->deferred_list);
wl_list_init(&d->input_list);
wl_list_init(&d->output_list);
wl_list_init(&d->global_list);
d->registry = wl_display_get_registry(d->display);
wl_registry_add_listener(d->registry, &registry_listener, d);
if (wl_display_roundtrip(d->display) < 0) {
fprintf(stderr, "Failed to process Wayland connection: %s\n",
strerror(errno));
display_destroy(d);
return NULL;
}
......@@ -6281,8 +6302,6 @@ display_create(int *argc, char *argv[])
d->theme = theme_create();
wl_list_init(&d->window_list);
init_dummy_surface(d);
return d;
......@@ -6311,6 +6330,8 @@ display_destroy_inputs(struct display *display)
void
display_destroy(struct display *display)
{
struct global *global, *tmp;
if (!wl_list_empty(&display->window_list))
fprintf(stderr, "toytoolkit warning: %d windows exist.\n",
wl_list_length(&display->window_list));
......@@ -6318,15 +6339,21 @@ display_destroy(struct display *display)
if (!wl_list_empty(&display->deferred_list))
fprintf(stderr, "toytoolkit warning: deferred tasks exist.\n");
cairo_surface_destroy(display->dummy_surface);
free(display->dummy_surface_data);
if (display->dummy_surface)
cairo_surface_destroy(display->dummy_surface);
if (display->dummy_surface_data)
free(display->dummy_surface_data);
display_destroy_outputs(display);
display_destroy_inputs(display);
wl_list_for_each_safe(global, tmp, &display->global_list, link)
global_destroy(display, global);
xkb_context_unref(display->xkb_context);
theme_destroy(display->theme);
if (display->theme)
theme_destroy(display->theme);
destroy_cursors(display);
#ifdef HAVE_CAIRO_EGL
......@@ -6334,6 +6361,15 @@ display_destroy(struct display *display)
fini_egl(display);
#endif
if (display->relative_pointer_manager)
zwp_relative_pointer_manager_v1_destroy(display->relative_pointer_manager);
if (display->pointer_constraints)
zwp_pointer_constraints_v1_destroy(display->pointer_constraints);
if (display->viewporter)
wp_viewporter_destroy(display->viewporter);
if (display->subcompositor)
wl_subcompositor_destroy(display->subcompositor);
......@@ -6346,7 +6382,8 @@ display_destroy(struct display *display)
if (display->data_device_manager)
wl_data_device_manager_destroy(display->data_device_manager);
wl_compositor_destroy(display->compositor);
if (display->compositor)
wl_compositor_destroy(display->compositor);
wl_registry_destroy(display->registry);
close(display->epoll_fd);
......
......@@ -122,6 +122,9 @@ struct wet_compositor {
int (*simple_output_configure)(struct weston_output *output);
bool init_failed;
struct wl_list layoutput_list; /**< wet_layoutput::compositor_link */
struct wl_list child_process_list;
pid_t autolaunch_pid;
bool autolaunch_watch;
};
static FILE *weston_logfile = NULL;
......@@ -344,22 +347,34 @@ protocol_log_fn(void *user_data,
free(logstr);
}
static struct wl_list child_process_list;
static struct wet_compositor *
to_wet_compositor(struct weston_compositor *compositor)
{
return weston_compositor_get_user_data(compositor);
}
static int
sigchld_handler(int signal_number, void *data)
{
struct weston_process *p;
struct wet_compositor *wet = data;
int status;
pid_t pid;
while ((pid = waitpid(-1, &status, WNOHANG)) > 0) {
wl_list_for_each(p, &child_process_list, link) {
if (wet->autolaunch_pid != -1 && wet->autolaunch_pid == pid) {
if (wet->autolaunch_watch)
wl_display_terminate(wet->compositor->wl_display);
wet->autolaunch_pid = -1;
continue;
}
wl_list_for_each(p, &wet->child_process_list, link) {
if (p->pid == pid)
break;
}
if (&p->link == &child_process_list) {
if (&p->link == &wet->child_process_list) {
weston_log("unknown child process exited\n");
continue;
}
......@@ -454,15 +469,17 @@ weston_client_launch(struct weston_compositor *compositor,
proc->pid = pid;
proc->cleanup = cleanup;
weston_watch_process(proc);
wet_watch_process(compositor, proc);
return client;
}
WL_EXPORT void
weston_watch_process(struct weston_process *process)
wet_watch_process(struct weston_compositor *compositor,
struct weston_process *process)
{
wl_list_insert(&child_process_list, &process->link);
struct wet_compositor *wet = to_wet_compositor(compositor);
wl_list_insert(&wet->child_process_list, &process->link);
}
struct process_info {
......@@ -536,12 +553,6 @@ log_uname(void)
usys.version, usys.machine);
}
static struct wet_compositor *
to_wet_compositor(struct weston_compositor *compositor)
{
return weston_compositor_get_user_data(compositor);
}
static struct wet_output_config *
wet_init_parsed_options(struct weston_compositor *ec)
{
......@@ -582,8 +593,8 @@ static const char xdg_wrong_message[] =
static const char xdg_wrong_mode_message[] =
"warning: XDG_RUNTIME_DIR \"%s\" is not configured\n"
"correctly. Unix access mode must be 0700 (current mode is %o),\n"
"and must be owned by the user (current owner is UID %d).\n";
"correctly. Unix access mode must be 0700 (current mode is %04o),\n"
"and must be owned by the user UID %d (current owner is UID %d).\n";
static const char xdg_detail_message[] =
"Refer to your distribution on how to get it, or\n"
......@@ -610,7 +621,7 @@ verify_xdg_runtime_dir(void)
if ((s.st_mode & 0777) != 0700 || s.st_uid != getuid()) {
weston_log(xdg_wrong_mode_message,
dir, s.st_mode & 0777, s.st_uid);
dir, s.st_mode & 0777, getuid(), s.st_uid);
weston_log_continue(xdg_detail_message);
}
}
......@@ -1086,6 +1097,7 @@ weston_compositor_init_config(struct weston_compositor *ec,
struct xkb_rule_names xkb_names;
struct weston_config_section *s;
int repaint_msec;
bool color_management;
bool cal;
/* weston.ini [keyboard] */
......@@ -1125,6 +1137,13 @@ weston_compositor_init_config(struct weston_compositor *ec,
weston_log("Output repaint window is %d ms maximum.\n",
ec->repaint_msec);
weston_config_section_get_bool(s, "color-management",
&color_management, false);
if (color_management) {
if (weston_compositor_load_color_manager(ec) < 0)
return -1;
}
/* weston.ini [libinput] */
s = weston_config_get_section(config, "libinput", NULL, NULL);
weston_config_section_get_bool(s, "touchscreen_calibrator", &cal, 0);
......@@ -1282,29 +1301,6 @@ wet_output_set_transform(struct weston_output *output,
return 0;
}
static int
wet_output_set_renderer_shadow(struct weston_output *output,
struct weston_config_section *section)
{
bool use_shadow = false;
if (section) {
weston_config_section_get_bool(section,
"use-renderer-shadow",
&use_shadow, false);
}
if (use_shadow) {
if (!weston_output_set_renderer_shadow_buffer(output)) {
weston_log("Output \"%s\" does not support use-renderer-shadow.\n",
output->name);
return -1;
}
}
return 0;
}
static void
allow_content_protection(struct weston_output *output,
struct weston_config_section *section)
......@@ -1822,9 +1818,6 @@ drm_backend_output_configure(struct weston_output *output,
allow_content_protection(output, section);
if (wet_output_set_renderer_shadow(output, section) < 0)
return -1;
return 0;
}
......@@ -2635,12 +2628,6 @@ headless_backend_output_configure(struct weston_output *output)
.scale = 1,
.transform = WL_OUTPUT_TRANSFORM_NORMAL
};
struct weston_config *wc = wet_get_config(output->compositor);
struct weston_config_section *section;
section = weston_config_get_section(wc, "output", "name", output->name);
if (wet_output_set_renderer_shadow(output, section) < 0)
return -1;
return wet_configure_windowed_output_from_config(output, &defaults);
}
......@@ -3138,6 +3125,45 @@ wet_load_xwayland(struct weston_compositor *comp)
}
#endif
static int
execute_autolaunch(struct wet_compositor *wet, struct weston_config *config)
{
int ret = -1;
pid_t tmp_pid = -1;
char *autolaunch_path = NULL;
struct weston_config_section *section = NULL;
section = weston_config_get_section(config, "autolaunch", NULL, NULL);
weston_config_section_get_string(section, "path", &autolaunch_path, "");
weston_config_section_get_bool(section, "watch", &wet->autolaunch_watch, false);
if (!strlen(autolaunch_path))
goto out_ok;
if (access(autolaunch_path, X_OK) != 0) {
weston_log("Specified autolaunch path (%s) is not executable\n", autolaunch_path);
goto out;
}
tmp_pid = fork();
if (tmp_pid == -1) {
weston_log("Failed to fork autolaunch process: %s\n", strerror(errno));
goto out;
} else if (tmp_pid == 0) {
execl(autolaunch_path, autolaunch_path, NULL);
/* execl shouldn't return */
fprintf(stderr, "Failed to execute autolaunch: %s\n", strerror(errno));
_exit(1);
}
out_ok:
ret = 0;
out:
wet->autolaunch_pid = tmp_pid;
free(autolaunch_path);
return ret;
}
static void
weston_log_setup_scopes(struct weston_log_context *log_ctx,
struct weston_log_subscriber *subscriber,
......@@ -3310,9 +3336,9 @@ wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_data)
signals[2] = wl_event_loop_add_signal(loop, SIGQUIT, on_term_signal,
display);
wl_list_init(&child_process_list);
wl_list_init(&wet.child_process_list);
signals[3] = wl_event_loop_add_signal(loop, SIGCHLD, sigchld_handler,
NULL);
&wet);
if (!signals[0] || !signals[1] || !signals[2] || !signals[3])
goto out_signals;
......@@ -3471,6 +3497,9 @@ wet_main(int argc, char *argv[], const struct weston_testsuite_data *test_data)
weston_compositor_wake(wet.compositor);
if (execute_autolaunch(&wet, config) < 0)
goto out;
wl_display_run(display);
/* Allow for setting return exit code after
......@@ -3517,6 +3546,7 @@ out_display:
free(socket_name);
free(option_modules);
free(log);
free(log_scopes);
free(modules);
return ret;
......
......@@ -849,6 +849,9 @@ unbind_input_method(struct wl_resource *resource)
{
struct input_method *input_method = wl_resource_get_user_data(resource);
if (!input_method)
return;
input_method->input_method_binding = NULL;
input_method->context = NULL;
}
......@@ -896,8 +899,12 @@ input_method_notifier_destroy(struct wl_listener *listener, void *data)
if (input_method->input)
deactivate_input_method(input_method);
if (input_method->input_method_binding)
wl_resource_set_user_data(input_method->input_method_binding, NULL);
wl_global_destroy(input_method->input_method_global);
wl_list_remove(&input_method->destroy_listener.link);
input_method->seat->input_method = NULL;
free(input_method);
}
......
......@@ -56,7 +56,8 @@ struct wl_client *
weston_client_start(struct weston_compositor *compositor, const char *path);
void
weston_watch_process(struct weston_process *process);
wet_watch_process(struct weston_compositor *compositor,
struct weston_process *process);
struct weston_config *
wet_get_config(struct weston_compositor *compositor);
......
......@@ -154,7 +154,7 @@ spawn_xserver(void *user_data, const char *display, int abstract_fd, int unix_fd
wxw->wm_fd = wm[0];
wxw->process.pid = pid;
weston_watch_process(&wxw->process);
wet_watch_process(wxw->compositor, &wxw->process);
break;
case -1:
......
......@@ -894,6 +894,8 @@ workspace_destroy(struct workspace *ws)
if (ws->fsurf_back)
focus_surface_destroy(ws->fsurf_back);
weston_layer_fini(&ws->layer);
free(ws);
}
......@@ -4632,7 +4634,7 @@ switcher_binding(struct weston_keyboard *keyboard, const struct timespec *time,
switcher = malloc(sizeof *switcher);
if (!switcher)
return;
switcher->shell = shell;
switcher->current = NULL;
switcher->listener.notify = switcher_handle_view_destroy;
......@@ -4864,21 +4866,41 @@ shell_output_changed_move_layer(struct desktop_shell *shell,
}
static void
handle_output_destroy(struct wl_listener *listener, void *data)
shell_output_destroy(struct shell_output *shell_output)
{
struct shell_output *output_listener =
container_of(listener, struct shell_output, destroy_listener);
struct desktop_shell *shell = output_listener->shell;
struct desktop_shell *shell = shell_output->shell;
shell_for_each_layer(shell, shell_output_changed_move_layer, NULL);
if (output_listener->panel_surface)
wl_list_remove(&output_listener->panel_surface_listener.link);
if (output_listener->background_surface)
wl_list_remove(&output_listener->background_surface_listener.link);
wl_list_remove(&output_listener->destroy_listener.link);
wl_list_remove(&output_listener->link);
free(output_listener);
if (shell_output->fade.animation) {
weston_view_animation_destroy(shell_output->fade.animation);
shell_output->fade.animation = NULL;
}
if (shell_output->fade.view) {
/* destroys the view as well */
weston_surface_destroy(shell_output->fade.view->surface);
}
if (shell_output->fade.startup_timer)
wl_event_source_remove(shell_output->fade.startup_timer);
if (shell_output->panel_surface)
wl_list_remove(&shell_output->panel_surface_listener.link);
if (shell_output->background_surface)
wl_list_remove(&shell_output->background_surface_listener.link);
wl_list_remove(&shell_output->destroy_listener.link);
wl_list_remove(&shell_output->link);
free(shell_output);
}
static void
handle_output_destroy(struct wl_listener *listener, void *data)
{
struct shell_output *shell_output =
container_of(listener, struct shell_output, destroy_listener);
shell_output_destroy(shell_output);
}
static void
......@@ -5012,20 +5034,26 @@ shell_destroy(struct wl_listener *listener, void *data)
text_backend_destroy(shell->text_backend);
input_panel_destroy(shell);
wl_list_for_each_safe(shell_output, tmp, &shell->output_list, link) {
wl_list_remove(&shell_output->destroy_listener.link);
wl_list_remove(&shell_output->link);
free(shell_output);
}
wl_list_for_each_safe(shell_output, tmp, &shell->output_list, link)
shell_output_destroy(shell_output);
wl_list_remove(&shell->output_create_listener.link);
wl_list_remove(&shell->output_move_listener.link);
wl_list_remove(&shell->resized_listener.link);
weston_desktop_destroy(shell->desktop);
wl_array_for_each(ws, &shell->workspaces.array)
workspace_destroy(*ws);
wl_array_release(&shell->workspaces.array);
weston_layer_fini(&shell->fullscreen_layer);
weston_layer_fini(&shell->panel_layer);
weston_layer_fini(&shell->background_layer);
weston_layer_fini(&shell->lock_layer);
weston_layer_fini(&shell->input_panel_layer);
weston_layer_fini(&shell->minimized_layer);
free(shell->client);
free(shell);
}
......
......@@ -243,12 +243,6 @@ ALIASES += "endrst=\endverbatim"
ALIASES += "rststar=\verbatim embed:rst:leading-asterisk"
ALIASES += "endrststar=\endverbatim"
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding "class=itcl::class"
# will allow you to use the command class in the itcl::class meaning.
TCL_SUBST =
# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
# only. Doxygen will then generate output that is more tailored for C. For
# instance, some of the names that are used will be different. The list of all
......@@ -1086,13 +1080,6 @@ VERBATIM_HEADERS = YES
ALPHABETICAL_INDEX = YES
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
# Minimum value: 1, maximum value: 20, default value: 5.
# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
COLS_IN_ALPHA_INDEX = 5
# In case all classes in a project start with a common prefix, all classes will
# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
# can be used to specify a prefix (or a list of prefixes) that should be ignored
......@@ -2152,12 +2139,6 @@ EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of 'which perl').
# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
......@@ -2171,15 +2152,6 @@ PERL_PATH = /usr/bin/perl
CLASS_DIAGRAMS = YES
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see:
# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.
......
......@@ -85,14 +85,22 @@ multiple seats.
By default Weston will use the default seat named ``seat0``, but there's an
option to specify which seat Weston must use by passing ``--seat`` argument.
You can start Weston from a VT, assuming that there's a `logind
<https://www.freedesktop.org/wiki/Software/systemd/logind/>`_ instance running
on the machine. If that's not available, you can use the ``weston-launch``
application that can handle VT switching.
Another way of launching Weston is via ssh or a serial terminal but is
currently a pain to do. One way is to run everything as root and issue
``weston --tty 2`` while TTY 2 is active for example.
You can start Weston from a VT assuming that there's a seat manager supported by
`libseat <https://sr.ht/~kennylevinsen/seatd>`_ running, such as ``seatd`` or
`logind <https://www.freedesktop.org/wiki/Software/systemd/logind/>`_. The
backend to be used by ``libseat`` can optionally be selected with
``$LIBSEAT_BACKEND``. If ``libseat`` and ``seatd`` are both installed, but
``seatd`` is not already running, it can be started with ``sudo -- seatd -g
video``. If no seat manager supported by ``libseat`` is available, you can use
the ``weston-launch`` application that can handle VT switching.
Another way of launching Weston is via ssh or a serial terminal. The simplest
option here is to use the ``libseat`` launcher with ``seatd``. The process for
setting that up is identical to the one described above, where one just need to
ensure that ``seatd`` is running with the appropriate arguments, after which one
can just run ``weston``. Alternatively and as a last resort, one can run Weston
as root, specifying the tty to use on the command line: If TTY 2 is active, one
would run ``weston --tty 2`` as root.
Running Weston on a different seat on a stand-alone back-end
------------------------------------------------------------
......
/*
* Copyright 2021 Collabora, Ltd.
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice (including the
* next paragraph) shall be included in all copies or substantial
* portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
body {
background-color: #f2f2f2;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
"Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
"Noto Color Emoji";
}
.sourceHeading, .source, .coverFn,
.testName, .testPer, .testNum,
.coverLegendCovLo, .headerCovTableEntryLo, .coverPerLo, .coverNumLo,
.coverLegendCovMed, .headerCovTableEntryMed, .coverPerMed, .coverNumMed,
.coverLegendCovHi, .headerCovTableEntryHi, .coverPerHi, .coverNumHi,
.coverFile {
font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono",
"Consolas", "Ubuntu Mono", "Courier New", "andale mono",
"lucida console", monospace;
}
pre {
font-size: 0.7875rem;
}
.headerCovTableEntry, .testPer, .testNum, .testName,
.coverLegendCovLo, .headerCovTableEntryLo, .coverPerLo, .coverNumLo,
.coverLegendCovMed, .headerCovTableEntryMed, .coverPerMed, .coverNumMed,
.coverLegendCovHi, .headerCovTableEntryHi, .coverPerHi, .coverNumHi {
text-align: right;
white-space: nowrap;
}
.coverPerLo, .coverPerMed, .coverPerHi, .testPer {
/* font-weight: bold;*/
}
.coverNumLo, .coverNumMed, .coverNumHi, .testNum {
font-style: italic;
font-size: 90%;
padding-left: 1em;
}
.title {
font-size: 200%;
}
.tableHead {
text-align: center;
font-weight: bold;
background-color: #bfbfbf;
}
.coverFile, .coverBar, .coverFn {
background-color: #d9d9d9;
}
.headerCovTableHead {
font-weight: bold;
text-align: right;
}
.headerCovTableEntry {
background-color: #d9d9d9;
}
.coverFnLo,
.coverLegendCovLo, .headerCovTableEntryLo, .coverPerLo, .coverNumLo {
background-color: #f2dada;
}
.coverFnHi,
.coverLegendCovMed, .headerCovTableEntryMed, .coverPerMed, .coverNumMed {
background-color: #add9ad;
}
.coverLegendCovHi, .headerCovTableEntryHi, .coverPerHi, .coverNumHi {
background-color: #59b359;
}
.coverBarOutline {
border-style: solid;
border-width: 1px;
border-color: black;
padding: 0px;
}
.coverFnLo, .coverFnHi {
text-align: right;
}
.lineNum {
background-color: #d9d9d9;
}
.coverLegendCov, .lineCov, .branchCov {
background-image: url("taken.png");
background-repeat: repeat-y;
background-position: left top;
background-color: #c6ffb8;
}
.coverLegendNoCov, .lineNoCov, .branchNoCov, .branchNoExec {
background-image: url("nottaken.png");
background-repeat: repeat-y;
background-position: left top;
background-color: #ffcfbb;
}
.coverLegendCov, .coverLegendNoCov {
padding: 0em 1em 0em 1em;
}
.headerItem, .headerValue, .headerValueLeg {
white-space: nowrap;
}
.headerItem {
text-align: right;
font-weight: bold;
}
.ruler {
background-color: #d9d9d9;
}
.detail {
font-size: 80%;
}
.versionInfo {
font-size: 80%;
text-align: right;
}
doc/style/nottaken.png

149 B