~sircmpwn/wio

Enforce minial window size for new_view() v1 PROPOSED

Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/wio/%3C20190615023218.13490-1-leonhenrik.plickat%40stud.uni-goettingen.de%3E/mbox | git am -3
Learn more about email & git

[PATCH] Enforce minial window size for new_view() Export this patch

Leon Plickat
The minimal window size of 100x100 is already enforced for reshaping
views. Also enforcing it for spawning new views makes sense, so users
will not accidentaly spawn views to small to interact with.
---
 input.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/input.c b/input.c
index b4cee19..50c16ba 100644
--- a/input.c
+++ b/input.c
@@ -242,6 +242,12 @@ static void new_view(struct wio_server *server) {
 	view->box.y = y1;
 	view->box.width = x2 - x1;
 	view->box.height = y2 - y1;
+	if (view->box.width < 100){
+		view->box.width = 100;
+	}
+	if (view->box.height < 100){
+		view->box.height = 100;
+	}
 	int fd[2];
 	if (pipe(fd) != 0) {
 		wlr_log(WLR_ERROR, "Unable to create pipe for fork");
-- 
2.22.0
View this thread in the archives