diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2015-09-16 15:49:46 +0800 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2015-10-04 14:17:14 +0800 |
commit | e84f69466830e5a3c2e6f0abc6c3f2b5f5572bb9 (patch) | |
tree | c34844fc1f48f575ffcbd49ccaeebb06c91da277 | |
parent | b18542f2b6e2120b4a7bb4a961beb306c9e809f7 (diff) | |
download | mutter-e84f69466830e5a3c2e6f0abc6c3f2b5f5572bb9.tar.gz |
wayland: Don't scale XWayland pointer cursor sprites
We don't have any way of knowing what the intended size of a XWayland
cursor is supposed to be, so lets do what we do with regular XWayland
surfaces and don't scale them. The result is that cursor sprites of
HiDPI aware X11 clients will show correctly, but non-aware clients may
have tiny cursor sprites.
https://bugzilla.gnome.org/show_bug.cgi?id=755099
-rw-r--r-- | src/wayland/meta-wayland-pointer.c | 10 | ||||
-rw-r--r-- | src/wayland/meta-xwayland.c | 9 | ||||
-rw-r--r-- | src/wayland/meta-xwayland.h | 5 |
3 files changed, 21 insertions, 3 deletions
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 993b9e331..894a64dd5 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -53,6 +53,7 @@ #include "meta-wayland-private.h" #include "meta-wayland-surface.h" #include "meta-wayland-buffer.h" +#include "meta-xwayland.h" #include "meta-cursor.h" #include "meta-cursor-tracker-private.h" #include "meta-surface-actor-wayland.h" @@ -819,9 +820,12 @@ cursor_sprite_prepare_at (MetaCursorSprite *cursor_sprite, MetaScreen *screen = display->screen; const MetaMonitorInfo *monitor; - monitor = meta_screen_get_monitor_for_point (screen, x, y); - meta_cursor_sprite_set_texture_scale (cursor_sprite, - (float)monitor->scale / surface->scale); + if (!meta_xwayland_is_xwayland_surface (surface)) + { + monitor = meta_screen_get_monitor_for_point (screen, x, y); + meta_cursor_sprite_set_texture_scale (cursor_sprite, + (float)monitor->scale / surface->scale); + } meta_wayland_surface_update_outputs (surface); } diff --git a/src/wayland/meta-xwayland.c b/src/wayland/meta-xwayland.c index 179b94c8b..bf49f41dd 100644 --- a/src/wayland/meta-xwayland.c +++ b/src/wayland/meta-xwayland.c @@ -174,6 +174,15 @@ meta_xwayland_handle_wl_surface_id (MetaWindow *window, } } +gboolean +meta_xwayland_is_xwayland_surface (MetaWaylandSurface *surface) +{ + MetaWaylandCompositor *compositor = meta_wayland_compositor_get_default (); + MetaXWaylandManager *manager = &compositor->xwayland_manager; + + return wl_resource_get_client (surface->resource) == manager->client; +} + static gboolean try_display (int display, char **filename_out, diff --git a/src/wayland/meta-xwayland.h b/src/wayland/meta-xwayland.h index 5308f2957..caaf5101e 100644 --- a/src/wayland/meta-xwayland.h +++ b/src/wayland/meta-xwayland.h @@ -28,8 +28,13 @@ #include <glib.h> #include <meta/types.h> +#include "wayland/meta-wayland-types.h" + void meta_xwayland_handle_wl_surface_id (MetaWindow *window, guint32 surface_id); +gboolean +meta_xwayland_is_xwayland_surface (MetaWaylandSurface *surface); + #endif /* META_XWAYLAND_H */ |