Compare commits

...

31 Commits
main ... 12.0

Author SHA1 Message Date
Marius Vlad
2886a62fb0 build: bump to version 12.0.4 for the point release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-04-23 18:00:07 +03:00
Arnaud Vrac
eadffb6f0b clients/desktop-shell: fix crash on init when panel is disabled
The same output might be inited twice on init when the shell panel is disabled,
depending on the order the weston_desktop_shell and wl_output globals are
advertised. This triggers a protocol error as only one background can be created
per output.

Since initializing the output requires the weston_desktop_shell global (to
create the background and panel on this output), the output init call is done
conditionally in two places: in the global registry handler (to handle output
hotplug) and after the initial wl_display_roundtrip call to handle the case
where the weston_desktop_shell global was notified after the outputs.

We now check the output has already been initialized correctly by checking if
the background has been created, instead of the panel which is not always
created.

Signed-off-by: Arnaud Vrac <avrac@freebox.fr>
(cherry picked from commit 59207a7c7c)
2024-04-16 13:28:50 +03:00
Arnaud Vrac
8772ed83df desktop-shell: clamp view alpha correctly
Clamping of the alpha value is not done properly since the introduction of the
weston_view_set_alpha() helper.

Signed-off-by: Arnaud Vrac <avrac@freebox.fr>
(cherry picked from commit 14e0fff19a)
2024-04-16 13:28:50 +03:00
Michael Olbrich
1f2419f0f2 ivi-shell: clear seat focus if necessary when a surface is destroyed
Otherwise shseat->focused_ivisurf can point to deleted memory.
This does not happen with the hmi-controller because it explicitly assigns a new
focused surface. But the ivi-shell should not relay on the controller here.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
(cherry picked from commit d6681cedee)
2024-04-16 13:28:50 +03:00
Tomohito Esaki
8868523297 ivi-shell-user-interface: change timing to create the launcher surface
Since hmi-controller adds surfaces to layers when creating ivi surfaces,
the launcher will appear on startup. As before, the launcher surface is
created before the background surface so that the background will appear
on startup.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
(cherry picked from commit 608e1ee86d)
2024-04-16 13:28:50 +03:00
Tomohito Esaki
c8774aaf32 hmi-controller: activate and deactivate sruface
Activate when a surface is created and change focus when an active
surface is removed. The Surface is added to layers when it is created,
because it must be added to a layer to be active.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
(cherry picked from commit 7dbb166de6)
2024-04-16 13:28:50 +03:00
Tomohito Esaki
9c63dff13d ivi-shell: activate desktop surface
The keyboard focus is active, but the desktop surface itself is not
displayed as active. Therefore, the surface should also be displayed as
active, as in kiosk-shell.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
(cherry picked from commit 0e082315d7)
2024-04-16 13:28:50 +03:00
Tomohito Esaki
6e45aa8511 ivi-shell: Properly handle seat hotplugging
Add to handle seet hotplugging so that seats are properly picked up by
ivi-shell when they are dynamically created.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
(cherry picked from commit ec3e2d2d36)
2024-04-16 13:28:50 +03:00
Wujian Sun
818d76649a libweston-desktop: Fix weston crash when lost the shsurf
The shell_surface may disappear when keyboard lost focus,
then the shsurf will be NULL.
Have an ahead check for shsurf before calling the callback
in weston_desktop_surface_foreach_child.

Fixes #811

Tested-by: Erkai Ji <erkai.ji@nxp.com>
Signed-off-by: Wujian Sun <wujian.sun_1@nxp.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
(cherry picked from commit 042d02f422)
2024-04-16 13:28:50 +03:00
Robert Mader
0d139480d3 backend-drm: Sort planes by faked zpos
Just like we already do for planes with proper zpos. Otherwise we'll
often end up choosing the primary plane instead of an overlay one
in `drm_output_find_plane_for_view()`.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
(cherry picked from commit e34e027515)
2024-04-16 13:28:50 +03:00
Robert Mader
7bde237c43 backend-drm: Don't force non-opaque overlays to primary plane
If a view is non-opaque - such as an overlay over a video - we shouldn't
force it to be on the primary plane, as that's where the underlying
content should be placed, such as the video view.

dc0de9ee already mentioned: "This check should be changed in future to
only filter for opaque views, but that's for another time."

Adding "Fixes" at this is arguably a bug fix:
Fixes: dc0de9ee (backend-drm: Move overlay vs. primary plane check earlier)
Fixes: 2538aacc (backend-drm: Construct a zpos candidate list of planes)

Signed-off-by: Robert Mader <robert.mader@collabora.com>
(cherry picked from commit 5a2509ffb1)
2024-04-15 12:54:16 +03:00
Philipp Zabel
5324ace933 libweston-desktop: Work around crash when opening popup menu
Fix a crash when right-clicking on a weston-terminal, where
weston_desktop_seat_popup_grab_add_surface() is called with
seat->popup_grab.keyboard.keyboard == NULL in case there is
no keyboard connected.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
(cherry picked from commit b72785e1f6)
2024-04-15 12:52:53 +03:00
Marius Vlad
ab1987f41e build: bump to version 12.0.3 for the point release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-11-28 11:28:05 +02:00
Aske Bækdal Møller
7e1115479b clients: keyboard: fix delete before cursor
When editing a text field in chromium deleting the surrounding text with
backspace fails with `The selection range for surrounding text is invalid`

It seems like `(start - keyboard->surrounding_text) - keyboard->surrounding_cursor` evaluates to -1.

As far as i can tell `start - keyboard->surrounding_text` evaluates to
the index in the surrounding_text char arrays that should be deleted.

Signed-off-by: Aske Bækdal Møller <aske@geanix.com>
(cherry picked from commit 33ec3898d0)
2023-11-28 11:20:33 +02:00
Derek Foreman
6f26c009c1 xwm: Fix accidental resizing of windows
If an X window has not been resized yet, and the user clicks (not drags)
on a part of the window frame that can be used to resize, the window
will resize to 512, 512.

This is likely because of the changes in ba82af938 and 2acd2c748
that change resize behaviour but missed updating saved size when the
client's initial configure occurs.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
(cherry picked from commit ceb3d3141ce082f00939ff689e22e43ff7c316b8)
2023-10-23 10:56:14 -05:00
Derek Foreman
ef39bc3db9 toy-toolkit: Fix rotations
Ever since commit 3012934 some rotations have been broken. This is because
I transposed xy and yx in the cairo_matrix_init() call.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
(cherry picked from commit f0196739ae)
2023-09-27 13:27:58 +03:00
Marius Vlad
55986c4288 build: bump to version 12.0.2 for the point release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-08-02 18:13:49 +03:00
Marius Vlad
babb476166 backend-drm/meson.build: Require at least mesa 21.1.1
We seem to be using at least mesa 21.1.1 since Weston 10, but we never
explicitly asked for it.

Fixes: #790

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
(cherry picked from commit 0713ea7ee6)
2023-08-02 16:05:14 +03:00
Marius Vlad
bfc7ce3b88 backend-drm: Make DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP inert
Until kernel mainline does merge the aysnc page flip ioctl, make the
whole bit look like it's unsupported. We can further switch it back when
it lands into the kernel.

Fixes: 9203d98f

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Simon Ser <contact@emersion.fr>
(cherry picked from commit 3e4aff6af4)
2023-08-02 15:04:43 +03:00
Philipp Zabel
2fb140918e backend-vnc: use weston_output_set_single_mode()
Use the shared helper extracted from the RDP backend to avoid leaking
modes into the output mode list on every resize.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
(cherry picked from commit 04c29e6aae)
2023-08-02 15:02:11 +03:00
Philipp Zabel
0806922cd5 backend-rdp: extract weston_output_set_single_mode()
The ensure_single_mode() helper replaces an output's single mode.
Extract it into libweston so it can be reused by the VNC backend,
and rename it to weston_output_set_single_mode().

At the same time, set the the previously missing
WL_OUTPUT_MODE_CURRENT flag on the new mode.

Fixes #758

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
(cherry picked from commit e58452d6be)
2023-08-02 15:02:02 +03:00
Derek Foreman
c88001e5a0 data-device: Don't make a weston_coord with no valid space
We already only conditionally use base.offset when an icon exists. We
should also avoid trying to create a coordinate with a NULL icon, as it
will fire an assert().

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
(cherry picked from commit 815a560dd4)
2023-08-02 15:01:30 +03:00
Leandro Ribeiro
ea821df74b tests: assert that capture info was received before trying screenshot
If the source is not supported, we won't receive the capture
information. So the capture info (size/format) will be zeroed, and we
fail while trying to create a buffer for the screenshot with size/format
zeroed.

With this patch we fail if we don't receive the capture info, what makes
the failure reason more explicit.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
(cherry picked from commit cf64fbe784)
2023-08-02 15:01:15 +03:00
Leandro Ribeiro
8b0c2e313e drm: do not pull writeback task if KMS atomic API is not supported
Since 2d70bdfdcd "drm-backend: add support
to output capture writeback source", the DRM-backend was broken for KMS
devices that do not support the atomic API. This fixes that.

We don't support writeback screenshots without atomic modeset support.
So for such devices, we never update the output capture info
(weston_output_update_capture_info()) for the writeback source.

The function that we use to pull writeback tasks
(weston_output_pull_capture_task()) asserts that the capture providers
(renderers, DRM-backend) did not forget to update the capture info
(size/format) if something changed. But as we've never updated the
capture info for such devices, it is zeroed, leading to an assert hit.

With this patch we only pull the capture task for KMS devices that
support the atomic API.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
(cherry picked from commit 3226417573)
2023-08-02 15:01:07 +03:00
Leandro Ribeiro
46c94eb315 drm: drop disable_planes being false as a condition to support writeback
In 2d70bdfdcd "drm-backend: add support to
output capture writeback source" we've ensured that disable_planes
should be false in order to support writeback capture tasks.

But this was wrong; disable_planes is transient (it is true when
there's some sort of content recording happening), and we enable/disable
that during compositor's lifetime.

This is dangerous and may result in a crash. Imagine the following
sequence:

        1. screen recording starts, disable_planes is set to true.

        2. for whatever reason the output size changes, and we end up
        not updating capture info because we think that writeback is not
        supported by the device.

        3. screen recording stops, disable_planes is set to false.

        4. user tries to take a writeback screenshot, and the
        DRM-backend will pull a writeback capture task with
        weston_output_pull_capture_task().

        5. this function has an assert to ensure that the DRM-backend
        did not forget to update the capture info, and we hit that
        assert.

With this patch we drop disable_planes being false as a condition to
support writeback. So now we keep the capture info up-to-date even when
screen recording is happening, and we gracefully fail writeback tasks.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
(cherry picked from commit 6d8e3c569c)
2023-08-02 15:00:58 +03:00
Liu, Kai1
6bfe0da0f5 xwm: WM_TRANSIENT_FOR should not point to override-redirect window
The override-redirect window will not be assigned a shell_surface
object. If it is used as a parent window, it will cause a crash
when calling the set_parent function.

The EWMH specification does not describe the behavior of an
override-redirect window as a parent window, so we should ignore
this case.

Signed-off-by: Liu, Kai1 <kai1.liu@intel.com>
(cherry picked from commit b468687dd2)
2023-08-02 14:59:44 +03:00
Pekka Paalanen
314bb81098 man: make --wait-for-debugger findable
One .TP was lost, causing --wait-for-debugger section to be merged in
the previous section. Fix it.

Fixes 5ffda17e21

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
(cherry picked from commit 406e3d2ab9)
2023-08-02 14:59:36 +03:00
Michael Olbrich
b9b56edc68 backend-wayland: fix --fullscreen
Don't forget to transfer the fullscreen setting from the config to the backend.
Without this, weston tries to resize the window with the windowed output API but
that is not registered with new_config.fullscreen == true.

This code was accidentally lost in 0a5bb7acff
("backend-wayland: Use renderer enum type for config selection"). So just
restore it.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
(cherry picked from commit 4ce6b1e498)
2023-08-02 14:59:26 +03:00
Marius Vlad
502162d55a build: bump to version 12.0.1 for the point release
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-05-25 12:11:45 +03:00
Marius Vlad
d39fc4dac0 tests/meson.build: Add missing dependency for xcb-client-helper
This fixes the following build issue:

[    6s] cc -Itests/libtest-xwayland-client.a.p -Itests -I../tests -I. -I.. -Iinclude -I../include -Iprotocol -I/usr/include/pixman-1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall
-Winvalid-pch -Wextra -Wpedantic -std=gnu99 -Wmissing-prototypes -Wno-unused-parameter -Wno-shift-negative-value -Wno-missing-field-initializers -Wno-pedantic -Wundef -fvisibility=hidden -O2
-Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -MD -MQ
tests/libtest-xwayland-client.a.p/xcb-client-helper.c.o -MF tests/libtest-xwayland-client.a.p/xcb-client-helper.c.o.d -o tests/libtest-xwayland-client.a.p/xcb-client-helper.c.o -c
../tests/xcb-client-helper.c
[    6s] ../tests/xcb-client-helper.c:39:10: fatal error: wayland-client.h: No such file or directory

Reported-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
(cherry picked from commit 9e1c2056cf)
2023-05-19 11:05:58 +03:00
Marius Vlad
e6f5e50816 libweston,shared/meson:build Add xkbcommon missing depends
This is because e619a65b09, 'libweston: move gl-borders code into
helper lib' and 6293ab1f90, 'libweston, shared: Move out
weston_shell_get_binding_modifier' moved things out of libweston, and
libweston implicitly depends on xkbcommon.

Rather than just depending on dep_xkbcommon use the deps_for_libweston_users
which includes some other dependencies as well. Had to move it out
of libweston/meson.build and include it in the main meson.build as
libweston/meson.build would have a circular dependency on
libweston/meson.build file.

This fixes the following build issue:

[    5s] FAILED: libweston/libgl-borders.a.p/gl-borders.c.o
[    5s] cc -Ilibweston/libgl-borders.a.p -Ilibweston -I../libweston -I. -I.. -Iinclude -I../include -I/usr/include/wayland -I/usr/include/pixman-1 -I/usr/include/cairo
-I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/webp -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -std=gnu99 -Wmissing-prototypes
-Wno-unused-parameter -Wno-shift-negative-value -Wno-missing-field-initializers -Wno-pedantic -Wundef -fvisibility=hidden -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3
-fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -MD -MQ libweston/libgl-borders.a.p/gl-borders.c.o -MF
libweston/libgl-borders.a.p/gl-borders.c.o.d -o libweston/libgl-borders.a.p/gl-borders.c.o -c ../libweston/gl-borders.c
[    5s] In file included from ../libweston/renderer-gl/gl-renderer.h:32,
[    5s]                  from ../libweston/gl-borders.h:28,
[    5s]                  from ../libweston/gl-borders.c:31:
[    5s] ../include/libweston/libweston.h:39:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory

[    4s] FAILED: shared/libshared.a.p/config-parser.c.o
[    4s] cc -Ishared/libshared.a.p -Ishared -I../shared -I. -I.. -Iinclude -I../include -I/usr/include/wayland -I/usr/include/pixman-1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall
-Winvalid-pch -Wextra -Wpedantic -std=gnu99 -Wmissing-prototypes -Wno-unused-parameter -Wno-shift-negative-value -Wno-missing-field-initializers -Wno-pedantic -Wundef -fvisibility=hidden -O2
-Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -MD -MQ
shared/libshared.a.p/config-parser.c.o -MF shared/libshared.a.p/config-parser.c.o.d -o shared/libshared.a.p/config-parser.c.o -c ../shared/config-parser.c
[    4s] In file included from ../shared/config-parser.c:44:
[    4s] ../include/libweston/libweston.h:39:10: fatal error: xkbcommon/xkbcommon.h: No such file or directory

Reported-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
(cherry picked from commit e1c4133836)
2023-05-19 11:05:54 +03:00
31 changed files with 410 additions and 182 deletions

View File

@ -1586,7 +1586,7 @@ int main(int argc, char *argv[])
if (desktop.want_panel)
weston_desktop_shell_set_panel_position(desktop.shell, desktop.panel_position);
wl_list_for_each(output, &desktop.outputs, link)
if (!output->panel)
if (!output->background)
output_init(output, &desktop);
grab_surface_create(&desktop);

View File

@ -1287,6 +1287,11 @@ int main(int argc, char **argv)
wlCtx_WorkSpaceBackGround.cmm = &wlCtxCommon;
/* create desktop widgets */
create_launchers(&wlCtxCommon, &hmi_setting->launcher_list);
create_workspace_background(&wlCtx_WorkSpaceBackGround,
&hmi_setting->workspace_background);
for (i = 0; i < hmi_setting->screen_num; i++) {
wlCtx_BackGround[i].cmm = &wlCtxCommon;
create_background(&wlCtx_BackGround[i],
@ -1312,11 +1317,6 @@ int main(int argc, char **argv)
create_button(&wlCtx_Button_4, hmi_setting->random.id,
hmi_setting->random.filePath, 3);
create_workspace_background(&wlCtx_WorkSpaceBackGround,
&hmi_setting->workspace_background);
create_launchers(&wlCtxCommon, &hmi_setting->launcher_list);
create_home_button(&wlCtx_HomeButton, hmi_setting->home.id,
hmi_setting->home.filePath);

View File

@ -506,7 +506,7 @@ delete_before_cursor(struct virtual_keyboard *keyboard)
end = keyboard->surrounding_text + keyboard->surrounding_cursor;
zwp_input_method_context_v1_delete_surrounding_text(keyboard->context,
(start - keyboard->surrounding_text) - keyboard->surrounding_cursor,
start - keyboard->surrounding_text,
end - start);
zwp_input_method_context_v1_commit_string(keyboard->context,
keyboard->serial,

View File

@ -1661,7 +1661,7 @@ widget_cairo_update_transform(struct widget *widget, cairo_t *cr)
surface->allocation.width,
surface->allocation.height,
surface->buffer_scale);
cairo_matrix_init(&m, matrix.d[0], matrix.d[4], matrix.d[1],
cairo_matrix_init(&m, matrix.d[0], matrix.d[1], matrix.d[4],
matrix.d[5], matrix.d[12], matrix.d[13]);
cairo_transform(cr, &m);
}

View File

@ -3459,11 +3459,7 @@ surface_opacity_binding(struct weston_pointer *pointer,
return;
shsurf->view->alpha -= event->value * step;
if (shsurf->view->alpha > 1.0)
shsurf->view->alpha = 1.0;
if (shsurf->view->alpha < step)
shsurf->view->alpha = step;
shsurf->view->alpha = CLIP(shsurf->view->alpha, step, 1.0);
weston_view_geometry_dirty(shsurf->view);
weston_surface_damage(surface);

View File

@ -583,9 +583,25 @@ set_notification_remove_surface(struct wl_listener *listener, void *data)
struct hmi_controller *hmi_ctrl =
wl_container_of(listener, hmi_ctrl,
surface_removed);
(void)data;
struct ivi_layout_surface *ivisurf = data;
switch_mode(hmi_ctrl, hmi_ctrl->layout_mode);
/* set focus */
if (hmi_ctrl->interface->surface_is_active(ivisurf)) {
struct ivi_layout_surface **pp_surface = NULL;
int32_t surface_length = 0;
int32_t i;
hmi_ctrl->interface->get_surfaces(&surface_length, &pp_surface);
for (i = 0; i < surface_length; i++) {
if (pp_surface[i] != ivisurf) {
hmi_ctrl->interface->surface_activate(pp_surface[i]);
break;
}
}
}
}
static void
@ -643,6 +659,9 @@ set_notification_configure_surface(struct wl_listener *listener, void *data)
ivisurfs = NULL;
}
hmi_ctrl->interface->layer_add_surface(application_layer, ivisurf);
hmi_ctrl->interface->surface_activate(ivisurf);
switch_mode(hmi_ctrl, hmi_ctrl->layout_mode);
}
@ -678,7 +697,9 @@ set_notification_configure_desktop_surface(struct wl_listener *listener, void *d
0, surface->width, surface->height);
}
hmi_ctrl->interface->surface_activate(ivisurf);
hmi_ctrl->interface->commit_changes();
switch_mode(hmi_ctrl, hmi_ctrl->layout_mode);
}

View File

@ -330,6 +330,18 @@ struct ivi_layout_interface {
int32_t (*surface_set_id)(struct ivi_layout_surface *ivisurf,
uint32_t id_surface);
/**
* \brief activate ivi_layout_surface
*
* The surface must be added to a layer before it can be activated.
*/
void (*surface_activate)(struct ivi_layout_surface *ivisurf);
/**
* \brief check if ivi_layout_surface is active
*/
bool (*surface_is_active)(struct ivi_layout_surface *ivisurf);
/**
* layer controller interface
*/

View File

@ -55,6 +55,8 @@ struct ivi_layout_surface {
struct weston_surface *surface;
struct weston_desktop_surface *weston_desktop_surface;
int focus_count;
struct ivi_layout_view *ivi_view;
struct ivi_layout_surface_properties prop;

View File

@ -76,6 +76,11 @@ void
ivi_layout_surface_configure(struct ivi_layout_surface *ivisurf,
int32_t width, int32_t height);
void
ivi_layout_surface_activate_with_seat(struct ivi_layout_surface *ivisurf,
struct weston_seat *seat,
uint32_t activate_flags);
struct ivi_layout_surface*
ivi_layout_surface_create(struct weston_surface *wl_surface,
uint32_t id_surface);

View File

@ -1785,6 +1785,67 @@ ivi_layout_surface_set_id(struct ivi_layout_surface *ivisurf,
return IVI_SUCCEEDED;
}
static void
deactivate_current_surface(struct weston_seat *seat)
{
struct ivi_layout_surface *ivisurf =
shell_get_focused_ivi_layout_surface(seat);
struct weston_desktop_surface *desktop_surface;
if (!ivisurf)
return;
shell_set_focused_ivi_layout_surface(NULL, seat);
desktop_surface = ivisurf->weston_desktop_surface;
if (--ivisurf->focus_count == 0 && desktop_surface)
weston_desktop_surface_set_activated(desktop_surface, false);
}
static void
surface_activate(struct ivi_layout_surface *ivisurf, struct weston_seat *seat)
{
struct weston_desktop_surface *dsurf = ivisurf->weston_desktop_surface;
deactivate_current_surface(seat);
shell_set_focused_ivi_layout_surface(ivisurf, seat);
if (ivisurf->focus_count++ == 0 && dsurf)
weston_desktop_surface_set_activated(dsurf, true);
}
static void
ivi_layout_surface_activate(struct ivi_layout_surface *ivisurf)
{
struct weston_seat *seat;
assert(ivisurf->ivi_view);
wl_list_for_each(seat, &ivisurf->surface->compositor->seat_list, link) {
weston_view_activate_input(ivisurf->ivi_view->view, seat,
WESTON_ACTIVATE_FLAG_NONE);
surface_activate(ivisurf, seat);
}
}
static bool
ivi_layout_surface_is_active(struct ivi_layout_surface *ivisurf)
{
assert(ivisurf);
return (ivisurf->focus_count > 0);
}
void
ivi_layout_surface_activate_with_seat(struct ivi_layout_surface *ivisurf,
struct weston_seat *seat,
uint32_t activate_flags)
{
weston_view_activate_input(ivisurf->ivi_view->view,
seat, activate_flags);
surface_activate(ivisurf, seat);
}
static void
ivi_layout_surface_set_transition(struct ivi_layout_surface *ivisurf,
enum ivi_layout_transition_type type,
@ -2132,6 +2193,8 @@ static struct ivi_layout_interface ivi_layout_interface = {
.surface_set_transition = ivi_layout_surface_set_transition,
.surface_set_transition_duration = ivi_layout_surface_set_transition_duration,
.surface_set_id = ivi_layout_surface_set_id,
.surface_activate = ivi_layout_surface_activate,
.surface_is_active = ivi_layout_surface_is_active,
/**
* layer controller interfaces

View File

@ -95,6 +95,14 @@ struct ivi_input_panel_surface
struct wl_list link;
};
struct ivi_shell_seat {
struct weston_seat *seat;
struct wl_listener seat_destroy_listener;
struct ivi_layout_surface *focused_ivisurf;
struct wl_list link; /** ivi_shell::seat_list */
};
/*
* Implementation of ivi_surface
*/
@ -128,6 +136,43 @@ shell_get_ivi_layout_surface(struct weston_surface *surface)
return shsurf->layout_surface;
}
static void
ivi_shell_seat_handle_destroy(struct wl_listener *listener, void *data);
static struct ivi_shell_seat *
get_ivi_shell_seat(struct weston_seat *seat)
{
struct wl_listener *listener;
if (!seat)
return NULL;
listener = wl_signal_get(&seat->destroy_signal,
ivi_shell_seat_handle_destroy);
if (!listener)
return NULL;
return container_of(listener, struct ivi_shell_seat,
seat_destroy_listener);
}
struct ivi_layout_surface *
shell_get_focused_ivi_layout_surface(struct weston_seat *seat)
{
struct ivi_shell_seat *shseat = get_ivi_shell_seat(seat);
return shseat->focused_ivisurf;
}
void
shell_set_focused_ivi_layout_surface(struct ivi_layout_surface *ivisurf,
struct weston_seat *seat)
{
struct ivi_shell_seat *shseat = get_ivi_shell_seat(seat);
shseat->focused_ivisurf = ivisurf;
}
void
shell_surface_send_configure(struct weston_surface *surface,
int32_t width, int32_t height)
@ -175,12 +220,19 @@ ivi_shell_surface_get_label(struct weston_surface *surface,
static void
layout_surface_cleanup(struct ivi_shell_surface *ivisurf)
{
struct weston_seat *seat;
assert(ivisurf->layout_surface != NULL);
/* destroy weston_surface destroy signal. */
if (!ivisurf->layout_surface->weston_desktop_surface)
wl_list_remove(&ivisurf->surface_destroy_listener.link);
wl_list_for_each(seat, &ivisurf->surface->compositor->seat_list, link) {
struct ivi_shell_seat *shseat = get_ivi_shell_seat(seat);
if (shseat->focused_ivisurf == ivisurf->layout_surface)
shseat->focused_ivisurf = NULL;
}
ivi_layout_surface_destroy(ivisurf->layout_surface);
ivisurf->layout_surface = NULL;
@ -357,6 +409,44 @@ bind_ivi_application(struct wl_client *client,
shell, NULL);
}
/*
* ivi_shell_seat
*/
static void
ivi_shell_seat_destroy(struct ivi_shell_seat *shseat)
{
wl_list_remove(&shseat->seat_destroy_listener.link);
wl_list_remove(&shseat->link);
free(shseat);
}
static void
ivi_shell_seat_handle_destroy(struct wl_listener *listener, void *data)
{
struct ivi_shell_seat *shseat = container_of(listener,
struct ivi_shell_seat,
seat_destroy_listener);
ivi_shell_seat_destroy(shseat);
}
static struct ivi_shell_seat *
ivi_shell_seat_create(struct ivi_shell *shell, struct weston_seat *seat)
{
struct ivi_shell_seat *shseat;
shseat = xzalloc(sizeof *shseat);
shseat->seat = seat;
shseat->seat_destroy_listener.notify = ivi_shell_seat_handle_destroy;
wl_signal_add(&seat->destroy_signal, &shseat->seat_destroy_listener);
wl_list_insert(&shell->seat_list, &shseat->link);
return shseat;
}
void
input_panel_destroy(struct ivi_shell *shell);
@ -369,11 +459,13 @@ shell_destroy(struct wl_listener *listener, void *data)
struct ivi_shell *shell =
container_of(listener, struct ivi_shell, destroy_listener);
struct ivi_shell_surface *ivisurf, *next;
struct ivi_shell_seat *shseat, *shseat_next;
ivi_layout_ivi_shell_destroy();
wl_list_remove(&shell->destroy_listener.link);
wl_list_remove(&shell->wake_listener.link);
wl_list_remove(&shell->seat_created_listener.link);
if (shell->text_backend) {
text_backend_destroy(shell->text_backend);
@ -387,6 +479,9 @@ shell_destroy(struct wl_listener *listener, void *data)
free(ivisurf);
}
wl_list_for_each_safe(shseat, shseat_next, &shell->seat_list, link)
ivi_shell_seat_destroy(shseat);
ivi_layout_fini();
weston_desktop_destroy(shell->desktop);
@ -473,9 +568,8 @@ activate_binding(struct weston_seat *seat,
return;
}
/* FIXME: need to activate the surface like
kiosk_shell_surface_activate() */
weston_view_activate_input(focus_view, seat, flags);
ivi_layout_surface_activate_with_seat(ivisurf->layout_surface, seat,
flags);
}
static void
@ -706,6 +800,16 @@ static const struct weston_desktop_api shell_desktop_api = {
.set_xwayland_position = desktop_surface_set_xwayland_position,
};
static void
ivi_shell_handle_seat_created(struct wl_listener *listener, void *data)
{
struct weston_seat *seat = data;
struct ivi_shell *shell =
container_of(listener, struct ivi_shell, seat_created_listener);
ivi_shell_seat_create(shell, seat);
}
/*
* end of libweston-desktop
*/
@ -1042,6 +1146,7 @@ wet_shell_init(struct weston_compositor *compositor,
int *argc, char *argv[])
{
struct ivi_shell *shell;
struct weston_seat *seat;
shell = xzalloc(sizeof *shell);
@ -1066,6 +1171,13 @@ wet_shell_init(struct weston_compositor *compositor,
shell, bind_ivi_application) == NULL)
goto err_desktop;
wl_list_init(&shell->seat_list);
wl_list_for_each(seat, &compositor->seat_list, link)
ivi_shell_seat_create(shell, seat);
shell->seat_created_listener.notify = ivi_shell_handle_seat_created;
wl_signal_add(&compositor->seat_created_signal,
&shell->seat_created_listener);
ivi_layout_init(compositor, shell);
screenshooter_create(compositor);

View File

@ -39,6 +39,7 @@ struct ivi_shell
struct wl_listener show_input_panel_listener;
struct wl_listener hide_input_panel_listener;
struct wl_listener update_input_panel_listener;
struct wl_listener seat_created_listener;
struct weston_compositor *compositor;
@ -52,6 +53,8 @@ struct ivi_shell
struct wl_resource *binding;
struct wl_list surfaces;
} input_panel;
struct wl_list seat_list;
};
void
@ -63,6 +66,13 @@ struct ivi_layout_surface;
struct ivi_layout_surface *
shell_get_ivi_layout_surface(struct weston_surface *surface);
struct ivi_layout_surface *
shell_get_focused_ivi_layout_surface(struct weston_seat *seat);
void
shell_set_focused_ivi_layout_surface(struct ivi_layout_surface *ivisurface,
struct weston_seat *seat);
void
shell_ensure_text_input(struct ivi_shell *shell);
bool

View File

@ -75,56 +75,78 @@ static void
drm_backend_create_faked_zpos(struct drm_device *device)
{
struct drm_backend *b = device->backend;
struct drm_plane *plane;
struct drm_plane *plane, *tmp;
struct wl_list tmp_list;
uint64_t zpos = 0ULL;
uint64_t zpos_min_primary;
uint64_t zpos_min_overlay;
uint64_t zpos_min_cursor;
zpos_min_primary = zpos;
/* if the property is there, bail out sooner */
wl_list_for_each(plane, &device->plane_list, link) {
/* if the property is there, bail out sooner */
if (plane->props[WDRM_PLANE_ZPOS].prop_id != 0)
return;
if (plane->type != WDRM_PLANE_TYPE_PRIMARY)
continue;
zpos++;
}
zpos_min_overlay = zpos;
wl_list_for_each(plane, &device->plane_list, link) {
if (plane->type != WDRM_PLANE_TYPE_OVERLAY)
continue;
zpos++;
}
zpos_min_cursor = zpos;
wl_list_for_each(plane, &device->plane_list, link) {
if (plane->type != WDRM_PLANE_TYPE_CURSOR)
continue;
zpos++;
}
drm_debug(b, "[drm-backend] zpos property not found. "
"Using invented immutable zpos values:\n");
/* assume that invented zpos values are immutable */
wl_list_for_each(plane, &device->plane_list, link) {
if (plane->type == WDRM_PLANE_TYPE_PRIMARY) {
plane->zpos_min = zpos_min_primary;
plane->zpos_max = zpos_min_primary;
} else if (plane->type == WDRM_PLANE_TYPE_OVERLAY) {
plane->zpos_min = zpos_min_overlay;
plane->zpos_max = zpos_min_overlay;
} else if (plane->type == WDRM_PLANE_TYPE_CURSOR) {
plane->zpos_min = zpos_min_cursor;
plane->zpos_max = zpos_min_cursor;
}
wl_list_init(&tmp_list);
wl_list_insert_list(&tmp_list, &device->plane_list);
wl_list_init(&device->plane_list);
zpos_min_primary = zpos;
wl_list_for_each_safe(plane, tmp, &tmp_list, link) {
if (plane->type != WDRM_PLANE_TYPE_PRIMARY)
continue;
plane->zpos_min = zpos_min_primary;
plane->zpos_max = zpos_min_primary;
wl_list_remove(&plane->link);
wl_list_insert(&device->plane_list, &plane->link);
zpos++;
drm_debug(b, "\t[plane] %s plane %d, zpos_min %"PRIu64", "
"zpos_max %"PRIu64"\n",
drm_output_get_plane_type_name(plane),
plane->plane_id, plane->zpos_min, plane->zpos_max);
}
zpos_min_overlay = zpos;
wl_list_for_each_safe(plane, tmp, &tmp_list, link) {
if (plane->type != WDRM_PLANE_TYPE_OVERLAY)
continue;
plane->zpos_min = zpos_min_overlay;
plane->zpos_max = zpos_min_overlay;
wl_list_remove(&plane->link);
wl_list_insert(&device->plane_list, &plane->link);
zpos++;
drm_debug(b, "\t[plane] %s plane %d, zpos_min %"PRIu64", "
"zpos_max %"PRIu64"\n",
drm_output_get_plane_type_name(plane),
plane->plane_id, plane->zpos_min, plane->zpos_max);
}
zpos_min_cursor = zpos;
wl_list_for_each_safe(plane, tmp, &tmp_list, link) {
if (plane->type != WDRM_PLANE_TYPE_CURSOR)
continue;
plane->zpos_min = zpos_min_cursor;
plane->zpos_max = zpos_min_cursor;
wl_list_remove(&plane->link);
wl_list_insert(&device->plane_list, &plane->link);
zpos++;
drm_debug(b, "\t[plane] %s plane %d, zpos_min %"PRIu64", "
"zpos_max %"PRIu64"\n",
drm_output_get_plane_type_name(plane),
plane->plane_id, plane->zpos_min, plane->zpos_max);
}
assert(wl_list_empty(&tmp_list));
}
static int
@ -553,13 +575,19 @@ drm_output_pick_writeback_capture_task(struct drm_output *output)
int32_t height = output->base.current_mode->height;
uint32_t format = output->format->format;
assert(output->device->atomic_modeset);
ct = weston_output_pull_capture_task(&output->base,
WESTON_OUTPUT_CAPTURE_SOURCE_WRITEBACK,
width, height, pixel_format_get_info(format));
if (!ct)
return;
assert(output->device->atomic_modeset);
if (output->base.disable_planes > 0) {
msg = "drm: KMS planes usage is disabled for now, so " \
"writeback capture tasks are rejected";
goto err;
}
wb = drm_output_find_compatible_writeback(output);
if (!wb) {
@ -636,7 +664,8 @@ drm_output_repaint(struct weston_output *output_base, pixman_region32_t *damage)
if (drm_output_ensure_hdr_output_metadata_blob(output) < 0)
goto err;
drm_output_pick_writeback_capture_task(output);
if (device->atomic_modeset)
drm_output_pick_writeback_capture_task(output);
drm_output_render(state, damage);
scanout_state = drm_output_state_get_plane(state,
@ -948,7 +977,7 @@ drm_output_apply_mode(struct drm_output *output)
}
}
if (device->atomic_modeset && !output->base.disable_planes)
if (device->atomic_modeset)
weston_output_update_capture_info(&output->base,
WESTON_OUTPUT_CAPTURE_SOURCE_WRITEBACK,
output->base.current_mode->width,
@ -2138,7 +2167,7 @@ drm_output_enable(struct weston_output *base)
output->base.switch_mode = drm_output_switch_mode;
output->base.set_gamma = drm_output_set_gamma;
if (device->atomic_modeset && !base->disable_planes)
if (device->atomic_modeset)
weston_output_update_capture_info(base, WESTON_OUTPUT_CAPTURE_SOURCE_WRITEBACK,
base->current_mode->width,
base->current_mode->height,

View File

@ -42,10 +42,6 @@
#include "pixel-formats.h"
#include "presentation-time-server-protocol.h"
#ifndef DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP
#define DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP 0x15
#endif
struct drm_property_enum_info plane_type_enums[] = {
[WDRM_PLANE_TYPE_PRIMARY] = {
.name = "Primary",
@ -1851,10 +1847,19 @@ init_kms_caps(struct drm_device *device)
drmSetClientCap(device->drm.fd, DRM_CLIENT_CAP_WRITEBACK_CONNECTORS, 1);
#if 0
/* FIXME: DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP isn't merged into mainline so
* we can't really use it at this point. Until then, make it so we
* don't support it. After it gets merged, we can flip this back such
* that we don't need to revert the entire tearing work, and we can
* still get it all back, when the capability is actually available in
* the kernel. */
ret = drmGetCap(device->drm.fd, DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP, &cap);
if (ret != 0)
cap = 0;
device->tearing_supported = cap;
#endif
device->tearing_supported = 0;
weston_log("DRM: does not support async page flipping\n");
/*
* KMS support for hardware planes cannot properly synchronize

View File

@ -58,7 +58,7 @@ deps_drm = [
]
if get_option('renderer-gl')
dep_gbm = dependency('gbm', required: false)
dep_gbm = dependency('gbm', required: false, version: '>= 21.1.1')
if not dep_gbm.found()
error('drm-backend with GL renderer requires gbm which was not found. Or, you can use \'-Drenderer-gl=false\'.')
endif

View File

@ -566,6 +566,7 @@ drm_output_find_plane_for_view(struct drm_output_state *state,
/* if the view covers the whole output, put it in the
* scanout plane, not overlay */
if (view_matches_entire_output &&
weston_view_is_opaque(ev, &ev->transform.boundingbox) &&
!scanout_has_view_assigned)
continue;
break;

View File

@ -338,72 +338,19 @@ finish_frame_handler(void *data)
return 1;
}
static struct weston_mode *
rdp_insert_new_mode(struct weston_output *output, int width, int height, int rate)
{
struct weston_mode *ret;
ret = xzalloc(sizeof *ret);
ret->width = width;
ret->height = height;
ret->refresh = rate;
ret->flags = WL_OUTPUT_MODE_PREFERRED;
wl_list_insert(&output->mode_list, &ret->link);
return ret;
}
/* It doesn't make sense for RDP to have more than one mode, so
* we make sure that we have only one.
*/
static struct weston_mode *
ensure_single_mode(struct weston_output *output, struct weston_mode *target)
{
struct rdp_output *rdpOutput = to_rdp_output(output);
struct rdp_backend *b = rdpOutput->backend;
struct weston_mode *iter, *local = NULL, *new_mode;
wl_list_for_each(iter, &output->mode_list, link) {
assert(!local);
if ((iter->width == target->width) &&
(iter->height == target->height) &&
(iter->refresh == target->refresh)) {
return iter;
} else {
local = iter;
}
}
/* Make sure we create the new one before freeing the old one
* because some mode switch code uses pointer comparisons! If
* we freed the old mode first, malloc could theoretically give
* us back the same pointer.
*/
new_mode = rdp_insert_new_mode(output,
target->width, target->height,
b->rdp_monitor_refresh_rate);
if (local) {
wl_list_remove(&local->link);
free(local);
}
return new_mode;
}
static void
rdp_output_set_mode(struct weston_output *base, struct weston_mode *mode)
{
struct rdp_output *rdpOutput = container_of(base, struct rdp_output, base);
struct rdp_backend *b = rdpOutput->backend;
struct weston_mode *cur;
struct weston_output *output = base;
struct rdp_peers_item *rdpPeer;
rdpSettings *settings;
struct weston_renderbuffer *new_renderbuffer;
mode->refresh = b->rdp_monitor_refresh_rate;
cur = ensure_single_mode(base, mode);
weston_output_set_single_mode(base, mode);
base->current_mode = cur;
base->native_mode = cur;
if (base->enabled) {
const struct pixman_renderer_interface *pixman;
const struct pixel_format_info *pfmt;

View File

@ -947,56 +947,15 @@ vnc_output_assign_planes(struct weston_output *base)
vnc_output_update_cursor(output);
}
static struct weston_mode *
vnc_insert_new_mode(struct weston_output *output, int width, int height,
int rate)
{
struct weston_mode *mode;
mode = xzalloc(sizeof *mode);
mode->width = width;
mode->height = height;
mode->refresh = rate;
wl_list_insert(&output->mode_list, &mode->link);
return mode;
}
static struct weston_mode *
vnc_ensure_matching_mode(struct vnc_output *output,
struct weston_mode *target)
{
struct vnc_backend *backend = output->backend;
struct weston_mode *local;
wl_list_for_each(local, &output->base.mode_list, link) {
if ((local->width == target->width) &&
(local->height == target->height))
return local;
}
return vnc_insert_new_mode(&output->base, target->width, target->height,
backend->vnc_monitor_refresh_rate);
}
static int
vnc_switch_mode(struct weston_output *base, struct weston_mode *target_mode)
{
struct vnc_output *output = to_vnc_output(base);
struct weston_mode *local_mode;
struct weston_size fb_size;
assert(output);
local_mode = vnc_ensure_matching_mode(output, target_mode);
if (local_mode == base->current_mode)
return 0;
base->current_mode->flags &= ~WL_OUTPUT_MODE_CURRENT;
base->current_mode = base->native_mode = local_mode;
base->current_mode->flags |= WL_OUTPUT_MODE_CURRENT;
weston_output_set_single_mode(base, target_mode);
fb_size.width = target_mode->width;
fb_size.height = target_mode->height;
@ -1015,7 +974,6 @@ vnc_output_set_size(struct weston_output *base, int width, int height)
{
struct vnc_output *output = to_vnc_output(base);
struct vnc_backend *backend = output->backend;
struct weston_mode *current_mode;
struct weston_mode init_mode;
/* We can only be called once. */
@ -1027,10 +985,7 @@ vnc_output_set_size(struct weston_output *base, int width, int height)
init_mode.height = height;
init_mode.refresh = backend->vnc_monitor_refresh_rate;
current_mode = vnc_ensure_matching_mode(output, &init_mode);
current_mode->flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
output->base.current_mode = output->base.native_mode = current_mode;
weston_output_set_single_mode(base, &init_mode);
output->base.start_repaint_loop = vnc_output_start_repaint_loop;
output->base.repaint = vnc_output_repaint;

View File

@ -2897,6 +2897,8 @@ wayland_backend_create(struct weston_compositor *compositor,
create_cursor(b, new_config);
b->fullscreen = new_config->fullscreen;
b->formats_count = ARRAY_LENGTH(wayland_formats);
b->formats = pixel_format_get_array(wayland_formats, b->formats_count);

View File

@ -7045,6 +7045,45 @@ weston_output_get_color_characteristics(struct weston_output *output)
return &output->color_characteristics;
}
WL_EXPORT void
weston_output_set_single_mode(struct weston_output *output,
struct weston_mode *target)
{
struct weston_mode *iter, *local = NULL, *mode;
wl_list_for_each(iter, &output->mode_list, link) {
assert(!local);
if ((iter->width == target->width) &&
(iter->height == target->height) &&
(iter->refresh == target->refresh)) {
mode = iter;
goto out;
} else {
local = iter;
}
}
/* Make sure we create the new one before freeing the old one
* because some mode switch code uses pointer comparisons! If
* we freed the old mode first, malloc could theoretically give
* us back the same pointer.
*/
mode = xzalloc(sizeof *mode);
mode->width = target->width;
mode->height = target->height;
mode->refresh = target->refresh;
mode->flags = WL_OUTPUT_MODE_CURRENT | WL_OUTPUT_MODE_PREFERRED;
wl_list_insert(&output->mode_list, &mode->link);
out:
output->current_mode = mode;
output->native_mode = mode;
if (local) {
wl_list_remove(&local->link);
free(local);
}
}
/** Initializes a weston_output object with enough data so
** an output can be configured.
*

View File

@ -972,6 +972,7 @@ weston_pointer_start_drag(struct weston_pointer *pointer,
icon->committed_private = drag;
weston_surface_set_label_func(icon,
pointer_drag_surface_get_label);
drag->base.offset = weston_coord_surface(0, 0, icon);
} else {
drag->base.icon = NULL;
}
@ -990,7 +991,6 @@ weston_pointer_start_drag(struct weston_pointer *pointer,
if (keyboard)
weston_keyboard_start_grab(keyboard, &drag->base.keyboard_grab);
drag->base.offset = weston_coord_surface(0, 0, icon);
return 0;
}
@ -1036,6 +1036,7 @@ weston_touch_start_drag(struct weston_touch *touch,
icon->committed_private = drag;
weston_surface_set_label_func(icon,
touch_drag_surface_get_label);
drag->base.offset = weston_coord_surface(0, 0, icon);
} else {
drag->base.icon = NULL;
}
@ -1055,7 +1056,6 @@ weston_touch_start_drag(struct weston_touch *touch,
drag_grab_touch_focus(drag);
drag->base.offset = weston_coord_surface(0, 0, icon);
return 0;
}

View File

@ -538,6 +538,9 @@ weston_desktop_seat_popup_grab_add_surface(struct weston_desktop_seat *seat,
wl_list_insert(&seat->popup_grab.surfaces, link);
if (!seat->popup_grab.keyboard.keyboard)
return;
desktop_surface =
weston_desktop_seat_popup_grab_get_topmost_surface(seat);
surface = weston_desktop_surface_get_surface(desktop_surface);
@ -558,6 +561,9 @@ weston_desktop_seat_popup_grab_remove_surface(struct weston_desktop_seat *seat,
struct weston_desktop_surface *desktop_surface;
struct weston_surface *surface;
if (!seat->popup_grab.keyboard.keyboard)
return;
desktop_surface =
weston_desktop_seat_popup_grab_get_topmost_surface(seat);
surface = weston_desktop_surface_get_surface(desktop_surface);

View File

@ -888,6 +888,8 @@ weston_desktop_surface_foreach_child(struct weston_desktop_surface *surface,
{
struct weston_desktop_surface *child;
wl_list_for_each(child, &surface->children_list, children_link)
callback(child, user_data);
wl_list_for_each(child, &surface->children_list, children_link) {
if (weston_desktop_surface_get_user_data(child))
callback(child, user_data);
}
}

View File

@ -260,6 +260,10 @@ weston_output_disable_planes_incr(struct weston_output *output);
void
weston_output_disable_planes_decr(struct weston_output *output);
void
weston_output_set_single_mode(struct weston_output *output,
struct weston_mode *target);
/* weston_plane */
void

View File

@ -112,11 +112,6 @@ lib_weston = shared_library(
dependencies: deps_libweston
)
deps_for_libweston_users = [
dep_wayland_server,
dep_pixman,
dep_xkbcommon,
]
# For external users, like Weston.
dep_libweston_public = declare_dependency(
@ -255,6 +250,7 @@ lib_gl_borders = static_library(
dependencies: [
dep_lib_cairo_shared,
dep_egl, # for gl-renderer.h
deps_for_libweston_users,
],
build_by_default: false,
install: false

View File

@ -207,6 +207,7 @@ with this value in the environment for all child processes to allow them to
connect to the right server automatically.
.BR \-\-version
Print the program version.
.TP
\fB\-\-wait-for-debugger\fR
Raises SIGSTOP before initializing the compositor. This allows the user to
attach with a debugger and continue execution by sending SIGCONT. This is

View File

@ -1,6 +1,6 @@
project('weston',
'c',
version: '12.0.0',
version: '12.0.4',
default_options: [
'warning_level=3',
'c_std=gnu99',
@ -153,6 +153,13 @@ prog_python = import('python').find_installation('python3')
files_xxd_py = files('tools/xxd.py')
cmd_xxd = [ prog_python, files_xxd_py, '@INPUT@', '@OUTPUT@' ]
deps_for_libweston_users = [
dep_wayland_server,
dep_pixman,
dep_xkbcommon,
]
subdir('include')
subdir('protocol')
subdir('shared')

View File

@ -7,7 +7,8 @@ srcs_libshared = [
'process-util.c',
'hash.c',
]
deps_libshared = [dep_wayland_client, dep_wayland_server, dep_pixman]
deps_libshared = [dep_wayland_client, dep_wayland_server,
dep_pixman, deps_for_libweston_users]
lib_libshared = static_library(
'shared',

View File

@ -323,7 +323,8 @@ if get_option('xwayland')
include_directories: common_inc,
dependencies: [
dep_pixman, dep_xcb_xwayland,
xcb_dep, xcb_cursor_dep
xcb_dep, xcb_cursor_dep,
dep_wayland_client,
],
install: false,
)

View File

@ -1705,6 +1705,9 @@ client_capture_output(struct client *client,
client_roundtrip(client);
assert(capt.width != 0 && capt.height != 0 && capt.drm_format != 0 &&
"capture source not available");
buf = create_shm_buffer(client,
capt.width, capt.height, capt.drm_format);

View File

@ -215,6 +215,12 @@ static void
xserver_map_shell_surface(struct weston_wm_window *window,
struct weston_surface *surface);
static inline bool
weston_wm_window_is_maximized(struct weston_wm_window *window)
{
return window->maximized_horz && window->maximized_vert;
}
static bool
wm_debug_is_enabled(struct weston_wm *wm)
{
@ -822,10 +828,16 @@ weston_wm_handle_configure_request(struct weston_wm *wm, xcb_generic_event_t *ev
return;
}
if (configure_request->value_mask & XCB_CONFIG_WINDOW_WIDTH)
if (configure_request->value_mask & XCB_CONFIG_WINDOW_WIDTH) {
window->width = configure_request->width;
if (configure_request->value_mask & XCB_CONFIG_WINDOW_HEIGHT)
if (!weston_wm_window_is_maximized(window))
window->saved_width = window->width;
}
if (configure_request->value_mask & XCB_CONFIG_WINDOW_HEIGHT) {
window->height = configure_request->height;
if (!weston_wm_window_is_maximized(window))
window->saved_height = window->height;
}
if (window->frame) {
weston_wm_window_set_allow_commits(window, false);
@ -1871,12 +1883,6 @@ weston_wm_window_set_toplevel(struct weston_wm_window *window)
weston_wm_window_configure(window);
}
static inline bool
weston_wm_window_is_maximized(struct weston_wm_window *window)
{
return window->maximized_horz && window->maximized_vert;
}
static void
weston_wm_window_handle_state(struct weston_wm_window *window,
xcb_client_message_event_t *client_message)
@ -3272,7 +3278,9 @@ xserver_map_shell_surface(struct weston_wm_window *window,
} else if (window->override_redirect) {
xwayland_interface->set_xwayland(window->shsurf,
window->x, window->y);
} else if (window->transient_for && window->transient_for->surface) {
} else if (window->transient_for &&
!window->transient_for->override_redirect &&
window->transient_for->surface) {
parent = window->transient_for;
if (weston_wm_window_type_inactive(window)) {
xwayland_interface->set_transient(window->shsurf,