summaryrefslogtreecommitdiff
path: root/gdk/wayland
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-06-29 15:08:17 +0000
committerMatthias Clasen <mclasen@redhat.com>2018-06-29 15:08:17 +0000
commit9c3de5141232edffaec81f4afa754ff7c186d49a (patch)
treea7c2d35d3f7a5dad7f3f3e2af4c83bc07bc9aae9 /gdk/wayland
parentd9dcfffce3048957ddf040585935434229c39991 (diff)
parentdfd1372a9be2aa8bab778658cca361ead201cf7c (diff)
downloadgtk+-9c3de5141232edffaec81f4afa754ff7c186d49a.tar.gz
Merge branch 'wip/cursor-output-scale-changes' into 'master'
wayland: Update cursor surface scale when output scale changes See merge request GNOME/gtk!224
Diffstat (limited to 'gdk/wayland')
-rw-r--r--gdk/wayland/gdkdevice-wayland.c6
-rw-r--r--gdk/wayland/gdkdisplay-wayland.c12
-rw-r--r--gdk/wayland/gdkseat-wayland.h2
3 files changed, 20 insertions, 0 deletions
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 9c9b79b563..64ab005aed 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -4516,6 +4516,12 @@ pointer_surface_update_scale (GdkDevice *device)
gdk_wayland_device_update_surface_cursor (device);
}
+void
+gdk_wayland_seat_update_cursor_scale (GdkWaylandSeat *seat)
+{
+ pointer_surface_update_scale (seat->master_pointer);
+}
+
static void
pointer_surface_enter (void *data,
struct wl_surface *wl_surface,
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 6d00960adf..712112b565 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -38,6 +38,7 @@
#include "gdkdisplay.h"
#include "gdkdisplay-wayland.h"
#include "gdkmonitor-wayland.h"
+#include "gdkseat-wayland.h"
#include "gdkinternals.h"
#include "gdkdeviceprivate.h"
#include "gdkkeysprivate.h"
@@ -1883,9 +1884,20 @@ transform_to_string (int transform)
static void
update_scale (GdkDisplay *display)
{
+ GList *seats;
+ GList *l;
+
g_list_foreach (gdk_wayland_display_get_toplevel_surfaces (display),
(GFunc)gdk_wayland_surface_update_scale,
NULL);
+ seats = gdk_display_list_seats (display);
+ for (l = seats; l; l = l->next)
+ {
+ GdkSeat *seat = l->data;
+
+ gdk_wayland_seat_update_cursor_scale (GDK_WAYLAND_SEAT (seat));
+ }
+ g_list_free (seats);
}
static void
diff --git a/gdk/wayland/gdkseat-wayland.h b/gdk/wayland/gdkseat-wayland.h
index 52c73e22ee..eccc792817 100644
--- a/gdk/wayland/gdkseat-wayland.h
+++ b/gdk/wayland/gdkseat-wayland.h
@@ -41,4 +41,6 @@ struct _GdkWaylandSeatClass
GType gdk_wayland_seat_get_type (void) G_GNUC_CONST;
+void gdk_wayland_seat_update_cursor_scale (GdkWaylandSeat *seat);
+
#endif /* __GDK_WAYLAND_SEAT_H__ */