diff options
-rw-r--r-- | backend/drm/drm.c | 6 | ||||
-rw-r--r-- | backend/wayland/output.c | 6 | ||||
-rw-r--r-- | meson.build | 2 | ||||
-rw-r--r-- | render/gles2/shaders.c | 5 | ||||
-rw-r--r-- | types/wlr_output.c | 10 | ||||
-rw-r--r-- | types/wlr_xdg_output.c | 22 |
6 files changed, 35 insertions, 16 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 30be40ea..7224cb3e 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -581,11 +581,11 @@ static bool drm_connector_set_cursor(struct wlr_output *output, wlr_log_errno(L_ERROR, "Failed to create cursor bo"); return false; } - - wlr_matrix_projection(plane->matrix, plane->surf.width, - plane->surf.height, output->transform); } + wlr_matrix_projection(plane->matrix, plane->surf.width, + plane->surf.height, output->transform); + struct wlr_box hotspot = { .x = hotspot_x, .y = hotspot_y }; wlr_box_transform(&hotspot, wlr_output_transform_invert(output->transform), plane->surf.width, plane->surf.height, &hotspot); diff --git a/backend/wayland/output.c b/backend/wayland/output.c index 109834c9..42b41508 100644 --- a/backend/wayland/output.c +++ b/backend/wayland/output.c @@ -284,8 +284,12 @@ struct wlr_output *wlr_wl_output_create(struct wlr_backend *_backend) { goto error; } + char title[32]; + if (snprintf(title, sizeof(title), "wlroots - %s", wlr_output->name)) { + zxdg_toplevel_v6_set_title(output->xdg_toplevel, title); + } + zxdg_toplevel_v6_set_app_id(output->xdg_toplevel, "wlroots"); - zxdg_toplevel_v6_set_title(output->xdg_toplevel, "wlroots"); zxdg_surface_v6_add_listener(output->xdg_surface, &xdg_surface_listener, output); zxdg_toplevel_v6_add_listener(output->xdg_toplevel, diff --git a/meson.build b/meson.build index 362de9f6..597236ca 100644 --- a/meson.build +++ b/meson.build @@ -49,7 +49,7 @@ add_project_arguments('-DWL_HIDE_DEPRECATED', language: 'c') wayland_server = dependency('wayland-server') wayland_client = dependency('wayland-client') wayland_egl = dependency('wayland-egl') -wayland_protos = dependency('wayland-protocols', version: '>=1.12') +wayland_protos = dependency('wayland-protocols', version: '>=1.14') egl = dependency('egl') glesv2 = dependency('glesv2') drm = dependency('libdrm') diff --git a/render/gles2/shaders.c b/render/gles2/shaders.c index ba3bd971..b940ee53 100644 --- a/render/gles2/shaders.c +++ b/render/gles2/shaders.c @@ -63,7 +63,8 @@ const GLchar tex_fragment_src_rgba[] = "uniform float alpha;\n" "\n" "void main() {\n" -" gl_FragColor = alpha * texture2D(tex, v_texcoord);\n" +" gl_FragColor.rgb = texture2D(tex, v_texcoord).rgb;\n" +" gl_FragColor.a = alpha * texture2D(tex, v_texcoord).a;\n" "}\n"; const GLchar tex_fragment_src_rgbx[] = @@ -73,7 +74,7 @@ const GLchar tex_fragment_src_rgbx[] = "uniform float alpha;\n" "\n" "void main() {\n" -" gl_FragColor.rgb = alpha * texture2D(tex, v_texcoord).rgb;\n" +" gl_FragColor.rgb = texture2D(tex, v_texcoord).rgb;\n" " gl_FragColor.a = alpha;\n" "}\n"; diff --git a/types/wlr_output.c b/types/wlr_output.c index 350538a7..a0f27e51 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -706,11 +706,11 @@ static bool output_cursor_attempt_hardware(struct wlr_output_cursor *cursor) { struct wlr_output_cursor *hwcur = cursor->output->hardware_cursor; if (cursor->output->impl->set_cursor && (hwcur == NULL || hwcur == cursor)) { - if (hwcur != cursor) { - assert(cursor->output->impl->move_cursor); - cursor->output->impl->move_cursor(cursor->output, - (int)cursor->x, (int)cursor->y); - } + // If the cursor was hidden or was a software cursor, the hardware + // cursor position is outdated + assert(cursor->output->impl->move_cursor); + cursor->output->impl->move_cursor(cursor->output, + (int)cursor->x, (int)cursor->y); if (cursor->output->impl->set_cursor(cursor->output, texture, scale, transform, cursor->hotspot_x, cursor->hotspot_y, true)) { cursor->output->hardware_cursor = cursor; diff --git a/types/wlr_xdg_output.c b/types/wlr_xdg_output.c index ba99cfcb..10155003 100644 --- a/types/wlr_xdg_output.c +++ b/types/wlr_xdg_output.c @@ -1,12 +1,13 @@ #include <assert.h> #include <stdlib.h> +#include <stdio.h> #include <wlr/types/wlr_output_layout.h> #include <wlr/types/wlr_output.h> #include <wlr/types/wlr_xdg_output.h> #include <wlr/util/log.h> #include "xdg-output-unstable-v1-protocol.h" -#define OUTPUT_MANAGER_VERSION 1 +#define OUTPUT_MANAGER_VERSION 2 static void output_handle_destroy(struct wl_client *client, struct wl_resource *resource) { @@ -23,11 +24,25 @@ static void output_handle_resource_destroy(struct wl_resource *resource) { static void output_send_details(struct wl_resource *resource, struct wlr_output_layout_output *layout_output) { + struct wlr_output *output = layout_output->output; zxdg_output_v1_send_logical_position(resource, layout_output->x, layout_output->y); + int width, height; wlr_output_effective_resolution(layout_output->output, &width, &height); zxdg_output_v1_send_logical_size(resource, width, height); + + uint32_t version = wl_resource_get_version(resource); + if (version >= ZXDG_OUTPUT_V1_NAME_SINCE_VERSION) { + zxdg_output_v1_send_name(resource, output->name); + } + if (version >= ZXDG_OUTPUT_V1_DESCRIPTION_SINCE_VERSION) { + char description[128]; + snprintf(description, sizeof(description), "%s %s %s (%s)", + output->make, output->model, output->serial, output->name); + zxdg_output_v1_send_description(resource, description); + } + zxdg_output_v1_send_done(resource); } @@ -173,12 +188,11 @@ struct wlr_xdg_output_manager *wlr_xdg_output_manager_create( } manager->layout = layout; manager->global = wl_global_create(display, - &zxdg_output_manager_v1_interface, - OUTPUT_MANAGER_VERSION, manager, output_manager_bind); + &zxdg_output_manager_v1_interface, OUTPUT_MANAGER_VERSION, manager, + output_manager_bind); if (!manager->global) { free(manager); return NULL; - } wl_list_init(&manager->resources); |