From d99765f43d36af5edf60277f5043eb7ae9c97088 Mon Sep 17 00:00:00 2001 From: Bruno Ramos <brunoramos.lu@gmail.com> Date: Mon, 2 Jan 2012 23:20:09 +0100 Subject: [PATCH] Fix crash with some WM (bug #8080). --- lib/screenshooter-capture.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/screenshooter-capture.c b/lib/screenshooter-capture.c index 830d4600..52f7b5cc 100644 --- a/lib/screenshooter-capture.c +++ b/lib/screenshooter-capture.c @@ -381,6 +381,18 @@ static GdkPixbuf rec_height += rectangle.y; } + if (rec_x < 0) + { + rec_width = rec_width + rec_x; + rec_x = 0; + } + + if (rec_y < 0) + { + rec_height = rec_height + rec_y; + rec_y = 0; + } + if (x_orig + rec_x + rec_width > gdk_screen_width ()) rec_width = gdk_screen_width () - x_orig - rec_x; -- GitLab