summarylogtreecommitdiffstats
path: root/0003-Fix-new-window-always-top-left-when-screen-not-full.patch
blob: 9463772907a2378ef08ddc5bc38fcb8e57cdfe71 (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 84944aa000ddfc656c60005e868e815493628ee3 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 7264a845..dc6b0fae 100644
--- a/src/placement.c
+++ b/src/placement.c
@@ -767,6 +767,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);
 
@@ -852,6 +853,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.15.1