summarylogtreecommitdiffstats
path: root/0003-Fix-new-window-always-top-left-when-screen-not-full.patch
blob: 18ad8129db5e9b433ef3b1326eb7046876ff7e3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From 68c37fbcd533ff2307c82f3b48bb090d9bbbd433 Mon Sep 17 00:00:00 2001
From: jjacky <i.am.jack.mail@gmail.com>
Date: Mon, 6 May 2013 11:00:51 +0200
Subject: [PATCH 3/3] Fix new window always top-left when screen not full

Totally forgot to account for the case where the screen isn't actually fully
"used" already, because I always have a couple app fullscreen.

Also, this actually was a memory leak.

Signed-off-by: Olivier Brunel <jjk@jjacky.com>
---
 src/placement.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/placement.c b/src/placement.c
index 14969ec..a595f67 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -776,6 +776,7 @@ smartPlacement (Client * c, int full_x, int full_y, int full_w, int full_h)
         if (!region_hole)
             break;
 
+has_hole:
         cairo_region_destroy (region_monitor);
         cairo_region_destroy (region_used);
 
@@ -861,6 +862,9 @@ smartPlacement (Client * c, int full_x, int full_y, int full_w, int full_h)
         return;
     }
 
+    if (region_hole)
+        goto has_hole;
+
     cairo_region_destroy (region_monitor);
     cairo_region_destroy (region_used);
 
-- 
2.3.3