[mutter] wayland/surface-role: Make geometry scale API return int
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland/surface-role: Make geometry scale API return int
- Date: Tue, 14 Jun 2022 14:27:39 +0000 (UTC)
commit 71ea01f54c2f2cd3bf4dcbb818a488c133cc6dfe
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Sun Jun 12 14:06:10 2022 +0200
wayland/surface-role: Make geometry scale API return int
Geometry scale are always ints, callers always assumed they were ints,
but they were doubles. Make them ints.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2460>
src/wayland/meta-wayland-actor-surface.c | 2 +-
src/wayland/meta-wayland-actor-surface.h | 4 ++--
src/wayland/meta-wayland-dnd-surface.c | 4 ++--
src/wayland/meta-wayland-shell-surface.c | 4 ++--
src/wayland/meta-wayland-subsurface.c | 2 +-
src/wayland/meta-xwayland-surface.c | 2 +-
6 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/wayland/meta-wayland-actor-surface.c b/src/wayland/meta-wayland-actor-surface.c
index b6d26fdc11..697fff53d0 100644
--- a/src/wayland/meta-wayland-actor-surface.c
+++ b/src/wayland/meta-wayland-actor-surface.c
@@ -157,7 +157,7 @@ meta_wayland_actor_surface_emit_frame_callbacks (MetaWaylandActorSurface *actor_
}
}
-double
+int
meta_wayland_actor_surface_get_geometry_scale (MetaWaylandActorSurface *actor_surface)
{
MetaWaylandActorSurfaceClass *actor_surface_class =
diff --git a/src/wayland/meta-wayland-actor-surface.h b/src/wayland/meta-wayland-actor-surface.h
index bd0cca2753..c248adf95e 100644
--- a/src/wayland/meta-wayland-actor-surface.h
+++ b/src/wayland/meta-wayland-actor-surface.h
@@ -33,12 +33,12 @@ struct _MetaWaylandActorSurfaceClass
{
MetaWaylandSurfaceRoleClass parent_class;
- double (* get_geometry_scale) (MetaWaylandActorSurface *actor_surface);
+ int (* get_geometry_scale) (MetaWaylandActorSurface *actor_surface);
void (* sync_actor_state) (MetaWaylandActorSurface *actor_surface);
};
void meta_wayland_actor_surface_sync_actor_state (MetaWaylandActorSurface *actor_surface);
-double meta_wayland_actor_surface_get_geometry_scale (MetaWaylandActorSurface *actor_surface);
+int meta_wayland_actor_surface_get_geometry_scale (MetaWaylandActorSurface *actor_surface);
META_EXPORT_TEST
MetaSurfaceActor * meta_wayland_actor_surface_get_actor (MetaWaylandActorSurface *actor_surface);
diff --git a/src/wayland/meta-wayland-dnd-surface.c b/src/wayland/meta-wayland-dnd-surface.c
index 047de6e2b3..bdd0e168b2 100644
--- a/src/wayland/meta-wayland-dnd-surface.c
+++ b/src/wayland/meta-wayland-dnd-surface.c
@@ -84,7 +84,7 @@ dnd_surface_find_logical_monitor (MetaWaylandActorSurface *actor_surface)
point.x, point.y);
}
-static double
+static int
dnd_subsurface_get_geometry_scale (MetaWaylandActorSurface *actor_surface)
{
if (meta_is_stage_views_scaled ())
@@ -96,7 +96,7 @@ dnd_subsurface_get_geometry_scale (MetaWaylandActorSurface *actor_surface)
MetaLogicalMonitor *logical_monitor;
logical_monitor = dnd_surface_find_logical_monitor (actor_surface);
- return meta_logical_monitor_get_scale (logical_monitor);
+ return (int) roundf (meta_logical_monitor_get_scale (logical_monitor));
}
}
diff --git a/src/wayland/meta-wayland-shell-surface.c b/src/wayland/meta-wayland-shell-surface.c
index 5e052e0000..f503fd5bb2 100644
--- a/src/wayland/meta-wayland-shell-surface.c
+++ b/src/wayland/meta-wayland-shell-surface.c
@@ -234,7 +234,7 @@ meta_wayland_shell_surface_surface_apply_state (MetaWaylandSurfaceRole *surface
MetaWaylandSurfaceRoleClass *surface_role_class;
MetaWindow *window;
MetaWaylandBuffer *buffer;
- double geometry_scale;
+ int geometry_scale;
surface_role_class =
META_WAYLAND_SURFACE_ROLE_CLASS (meta_wayland_shell_surface_parent_class);
@@ -285,7 +285,7 @@ meta_wayland_shell_surface_notify_subsurface_state_changed (MetaWaylandSurfaceRo
meta_window_actor_wayland_rebuild_surface_tree (window_actor);
}
-static double
+static int
meta_wayland_shell_surface_get_geometry_scale (MetaWaylandActorSurface *actor_surface)
{
MetaWaylandSurfaceRole *surface_role =
diff --git a/src/wayland/meta-wayland-subsurface.c b/src/wayland/meta-wayland-subsurface.c
index 1e9b655289..bc30bc7794 100644
--- a/src/wayland/meta-wayland-subsurface.c
+++ b/src/wayland/meta-wayland-subsurface.c
@@ -227,7 +227,7 @@ meta_wayland_subsurface_notify_subsurface_state_changed (MetaWaylandSurfaceRole
return meta_wayland_surface_notify_subsurface_state_changed (parent);
}
-static double
+static int
meta_wayland_subsurface_get_geometry_scale (MetaWaylandActorSurface *actor_surface)
{
MetaWaylandSurfaceRole *surface_role =
diff --git a/src/wayland/meta-xwayland-surface.c b/src/wayland/meta-xwayland-surface.c
index d0325e957c..54db84470f 100644
--- a/src/wayland/meta-xwayland-surface.c
+++ b/src/wayland/meta-xwayland-surface.c
@@ -184,7 +184,7 @@ meta_xwayland_surface_get_window (MetaWaylandSurfaceRole *surface_role)
return xwayland_surface->window;
}
-static double
+static int
meta_xwayland_surface_get_geometry_scale (MetaWaylandActorSurface *actor_surface)
{
return 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]