From patchwork Sun Mar 31 12:48:05 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 2368381 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 0EF453FD40 for ; Sun, 31 Mar 2013 12:44:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755170Ab3CaMoi (ORCPT ); Sun, 31 Mar 2013 08:44:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29023 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753833Ab3CaMoh (ORCPT ); Sun, 31 Mar 2013 08:44:37 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2VCiaVx017902 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 31 Mar 2013 08:44:37 -0400 Received: from shalem.localdomain.com (vpn1-6-33.ams2.redhat.com [10.36.6.33]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2VCiYEK025942; Sun, 31 Mar 2013 08:44:35 -0400 From: Hans de Goede To: hverkuil@xs4all.nl Cc: Linux Media Mailing List , Hans de Goede Subject: [PATCH 2/2] xawtv: Limit minimum window size to minimum capture resolution Date: Sun, 31 Mar 2013 14:48:05 +0200 Message-Id: <1364734085-4227-2-git-send-email-hdegoede@redhat.com> In-Reply-To: <1364734085-4227-1-git-send-email-hdegoede@redhat.com> References: <1364734085-4227-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Signed-off-by: Hans de Goede --- x11/xawtv.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/x11/xawtv.c b/x11/xawtv.c index bade35a..9c578da 100644 --- a/x11/xawtv.c +++ b/x11/xawtv.c @@ -1636,7 +1636,7 @@ create_launchwin(void) int main(int argc, char *argv[]) { - int i; + int i, min_width, min_height; unsigned long freq; hello_world("xawtv"); @@ -1784,11 +1784,16 @@ main(int argc, char *argv[]) XSetWMProtocols(XtDisplay(app_shell), XtWindow(app_shell), &WM_DELETE_WINDOW, 1); + drv->get_min_size(h_drv, &min_width, &min_height); + min_width = ((min_width + (WIDTH_INC - 1)) / WIDTH_INC) * WIDTH_INC; + min_height = ((min_height + (HEIGHT_INC - 1)) / HEIGHT_INC) * HEIGHT_INC; + if (debug) + fprintf(stderr,"main: window min size %dx%d\n", min_width, min_height); XtVaSetValues(app_shell, XtNwidthInc, WIDTH_INC, XtNheightInc, HEIGHT_INC, - XtNminWidth, WIDTH_INC, - XtNminHeight, HEIGHT_INC, + XtNminWidth, min_width, + XtNminHeight, min_height, NULL); if (f_drv & CAN_TUNE) XtVaSetValues(chan_shell,