aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonin Décimo <antonin.decimo@gmail.com>2019-08-09 15:29:33 +0200
committerDrew DeVault <sir@cmpwn.com>2019-08-12 09:37:21 +0900
commit0695324de7efc2bd3070de162e230327b2d15441 (patch)
tree54013f3b1505e275556803cb3bc9d2dd9fca5bd6
parent8f3d73e3a30e88f293e8f588455486c696328942 (diff)
xdg_shell: remove variable self-assignment
-rw-r--r--types/xdg_shell/wlr_xdg_positioner.c8
-rw-r--r--types/xdg_shell_v6/wlr_xdg_positioner_v6.c8
2 files changed, 4 insertions, 12 deletions
diff --git a/types/xdg_shell/wlr_xdg_positioner.c b/types/xdg_shell/wlr_xdg_positioner.c
index 6f902f92..95d5dbd3 100644
--- a/types/xdg_shell/wlr_xdg_positioner.c
+++ b/types/xdg_shell/wlr_xdg_positioner.c
@@ -222,20 +222,16 @@ struct wlr_box wlr_xdg_positioner_get_geometry(
if (positioner_gravity_has_edge(positioner->gravity,
XDG_POSITIONER_GRAVITY_TOP)) {
geometry.y -= geometry.height;
- } else if (positioner_gravity_has_edge(positioner->gravity,
+ } else if (!positioner_gravity_has_edge(positioner->gravity,
XDG_POSITIONER_GRAVITY_BOTTOM)) {
- geometry.y = geometry.y;
- } else {
geometry.y -= geometry.height / 2;
}
if (positioner_gravity_has_edge(positioner->gravity,
XDG_POSITIONER_GRAVITY_LEFT)) {
geometry.x -= geometry.width;
- } else if (positioner_gravity_has_edge(positioner->gravity,
+ } else if (!positioner_gravity_has_edge(positioner->gravity,
XDG_POSITIONER_GRAVITY_RIGHT)) {
- geometry.x = geometry.x;
- } else {
geometry.x -= geometry.width / 2;
}
diff --git a/types/xdg_shell_v6/wlr_xdg_positioner_v6.c b/types/xdg_shell_v6/wlr_xdg_positioner_v6.c
index 837f9290..eda19f30 100644
--- a/types/xdg_shell_v6/wlr_xdg_positioner_v6.c
+++ b/types/xdg_shell_v6/wlr_xdg_positioner_v6.c
@@ -154,17 +154,13 @@ struct wlr_box wlr_xdg_positioner_v6_get_geometry(
if (positioner->gravity & ZXDG_POSITIONER_V6_GRAVITY_TOP) {
geometry.y -= geometry.height;
- } else if (positioner->gravity & ZXDG_POSITIONER_V6_GRAVITY_BOTTOM) {
- geometry.y = geometry.y;
- } else {
+ } else if (!(positioner->gravity & ZXDG_POSITIONER_V6_GRAVITY_BOTTOM)) {
geometry.y -= geometry.height / 2;
}
if (positioner->gravity & ZXDG_POSITIONER_V6_GRAVITY_LEFT) {
geometry.x -= geometry.width;
- } else if (positioner->gravity & ZXDG_POSITIONER_V6_GRAVITY_RIGHT) {
- geometry.x = geometry.x;
- } else {
+ } else if (!(positioner->gravity & ZXDG_POSITIONER_V6_GRAVITY_RIGHT)) {
geometry.x -= geometry.width / 2;
}