]> git.mdlowis.com Git - proto/labwc.git/commitdiff
Simplify desktop_view_at()
authorJohan Malm <jgm323@gmail.com>
Fri, 24 Sep 2021 21:04:47 +0000 (22:04 +0100)
committerJohan Malm <jgm323@gmail.com>
Fri, 24 Sep 2021 21:04:47 +0000 (22:04 +0100)
src/desktop.c

index 5c229f4feeaff6ca11b28a0ff8d0e262afd19e33..c7e153b39960e5222bc9dae889bbe48b636b841c 100644 (file)
@@ -308,12 +308,18 @@ desktop_view_at(struct server *server, double lx, double ly,
        if (!output) {
                return NULL;
        }
-       if ((*surface = layer_surface_at(&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY],
-                                        lx, ly, sx, sy))) {
+
+       *surface = layer_surface_at(
+                       &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY],
+                       lx, ly, sx, sy);
+       if (surface)
                return NULL;
        }
-       if ((*surface = layer_surface_at(&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP],
-                                        lx, ly, sx, sy))) {
+
+       *surface = layer_surface_at(
+                       &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP],
+                       lx, ly, sx, sy);
+       if (surface)
                return NULL;
        }
 
@@ -333,14 +339,4 @@ desktop_view_at(struct server *server, double lx, double ly,
                        return view;
                }
        }
-
-       if ((*surface = layer_surface_at(&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM],
-                                        lx, ly, sx, sy))) {
-               return NULL;
-       }
-       if ((*surface = layer_surface_at(&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND],
-                                        lx, ly, sx, sy))) {
-               return NULL;
-       }
-       return NULL;
 }