diff --git a/plugins/pip/SelectionArea.vala b/plugins/pip/SelectionArea.vala index 246defe7e..df3740788 100644 --- a/plugins/pip/SelectionArea.vala +++ b/plugins/pip/SelectionArea.vala @@ -23,8 +23,8 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor { public Gala.WindowManager wm { get; construct; } private Gala.ModalProxy? modal_proxy; - private Gdk.Point start_point; - private Gdk.Point end_point; + private Graphene.Point start_point; + private Graphene.Point end_point; private bool dragging = false; private bool clicked = false; @@ -130,10 +130,10 @@ public class Gala.Plugins.PIP.SelectionArea : CanvasActor { } private void get_selection_rectangle (out int x, out int y, out int width, out int height) { - x = int.min (start_point.x, end_point.x); - y = int.min (start_point.y, end_point.y); - width = (start_point.x - end_point.x).abs (); - height = (start_point.y - end_point.y).abs (); + x = (int) float.min (start_point.x, end_point.x); + y = (int) float.min (start_point.y, end_point.y); + width = (int) (start_point.x - end_point.x).abs (); + height = (int) (start_point.y - end_point.y).abs (); } protected override void draw (Cairo.Context ctx, int width, int height) { diff --git a/src/Widgets/MultitaskingView/WindowCloneContainer.vala b/src/Widgets/MultitaskingView/WindowCloneContainer.vala index 8adac200a..2f23d06da 100644 --- a/src/Widgets/MultitaskingView/WindowCloneContainer.vala +++ b/src/Widgets/MultitaskingView/WindowCloneContainer.vala @@ -383,7 +383,7 @@ public class Gala.WindowCloneContainer : ActorTarget { // https://projects.kde.org/projects/kde/kde-workspace/repository/revisions/master/entry/kwin/effects/presentwindows/presentwindows.cpp // some math utilities - private static int squared_distance (Gdk.Point a, Gdk.Point b) { + private static float squared_distance (Graphene.Point a, Graphene.Point b) { var k1 = b.x - a.x; var k2 = b.y - a.y; @@ -394,7 +394,7 @@ public class Gala.WindowCloneContainer : ActorTarget { return {rect.x + dx1, rect.y + dy1, rect.width + (-dx1 + dx2), rect.height + (-dy1 + dy2)}; } - private static Gdk.Point rect_center (Mtk.Rectangle rect) { + private static Graphene.Point rect_center (Mtk.Rectangle rect) { return {rect.x + rect.width / 2, rect.y + rect.height / 2}; } @@ -419,7 +419,7 @@ public class Gala.WindowCloneContainer : ActorTarget { taken_slots.resize (rows * columns); // precalculate all slot centers - Gdk.Point[] slot_centers = {}; + Graphene.Point[] slot_centers = {}; slot_centers.resize (rows * columns); for (int x = 0; x < columns; x++) { for (int y = 0; y < rows; y++) { @@ -437,7 +437,7 @@ public class Gala.WindowCloneContainer : ActorTarget { var rect = window.rect; var slot_candidate = -1; - var slot_candidate_distance = int.MAX; + var slot_candidate_distance = float.MAX; var pos = rect_center (rect); // all slots @@ -510,8 +510,8 @@ public class Gala.WindowCloneContainer : ActorTarget { if (scale > 1.0) { scale = 1.0f; target = { - rect_center (target).x - (int) Math.floorf (rect.width * scale) / 2, - rect_center (target).y - (int) Math.floorf (rect.height * scale) / 2, + (int) (rect_center (target).x - Math.floorf (rect.width * scale) / 2), + (int) (rect_center (target).y - Math.floorf (rect.height * scale) / 2), (int) Math.floorf (scale * rect.width), (int) Math.floorf (scale * rect.height) };