From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id A2B1938582B6 for ; Mon, 18 Dec 2023 19:28:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A2B1938582B6 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A2B1938582B6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702927702; cv=none; b=YdxlD4pqVVA+dyQNqQ6oWa5SpbZb7m1SJqR8sna6HXPWI4D7exQdOkltMwbyg3qV+r3Ye46/ANFsNomk9XF37lHmK/zqkvht3hBTJ861H7NI2Zsa8z6wfUmRKvzt0EA7EMYn9NlZ9YIVXiomJ+y3Nll0wTcp9hH1y72JLJR4cG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702927702; c=relaxed/simple; bh=fXp+0s34KoFJcSnxGM0uAXGZpjwEgJ+QDzc13C/7jv0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=QFt1c50bfRD9gM6c67l2uK6bZQBnY/1IJCc2fpFNBckZOTfpJrVEhuheqTQTu5V8I3Fd5DVZia2Vg0nKq/1pmVwwF+PiruDZ+qWf/O6GvNSw7FyCOIHqshOmt0V3jMoy2B9c4tgZlvpJPvUg5Wdt3+UJfeyfX+796kRPw9u6DHE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702927700; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Xvz42mLgwIoxqvdKuMl8wc5hxceQ4SEuoZ72dl2bpP0=; b=RiD671gzwGcq4WMP01gMhJe0+/sH6jSMizIOm/WUfWakl1WSwB7odvzmCQZhtqF30MTB1A dZCBbEeXAZNw4jS8n5P/N/GWih+GRKTlHuGw7AFl5/49kAhEJg/U6xUJXHzCV7CTW+2G7d JznOc4nHue3IE7kBwabznG/eF0BmB8w= Received: from mail-lf1-f69.google.com (mail-lf1-f69.google.com [209.85.167.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-656-fkFhrKWCMN2BOXaRSJcxlQ-1; Mon, 18 Dec 2023 14:28:18 -0500 X-MC-Unique: fkFhrKWCMN2BOXaRSJcxlQ-1 Received: by mail-lf1-f69.google.com with SMTP id 2adb3069b0e04-50e413b579eso155341e87.3 for ; Mon, 18 Dec 2023 11:28:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702927696; x=1703532496; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Xvz42mLgwIoxqvdKuMl8wc5hxceQ4SEuoZ72dl2bpP0=; b=aGUlWvCulFRrZIL5FtiguAXS+v7vQnoto9zS16uNt722jb4v7b4q6NP7/SxQ3WmH9A ujUR2DNrxOLlXnAl4cbb15xJc7EuOr+Q+nUjmpgVd8csk1lqIN7AEn8T/F2OZ3/3q4zf 8QbumjYaqLv7b7vXOZgoHsCib7bRHhYIO2Dlj4uR0EmTRErcrpCWXi016sq9ipGcxXir tQKMj4LRF8l6SDAoarL57y/p7Rz26oEnotTNltaON/ieiDiCmJ8Y/P87btwMYf1h0Xa2 FBBXMlV7NjOTabR/LSdTjXT+xQLVYXc9x3ngw2XM9wFROLunQpJFC9DdL8HKr4cW5JRD zRSg== X-Gm-Message-State: AOJu0YzqA0gOI0S3XwBlEonAcS5AKlJbB+ERpCatqKrLHWRiBVS8GjcH 4dyLB9lKyfKjJ8uIVFpTci2YEfu4NBl/XW/QU5uIbF5en/WbMESPo4bWDKeR5unFV40e4lmmwO2 gFqg8TSoktUKmbHySGWtQWRcSM8Rvcg== X-Received: by 2002:ac2:4150:0:b0:50e:404e:1260 with SMTP id c16-20020ac24150000000b0050e404e1260mr175703lfi.169.1702927696798; Mon, 18 Dec 2023 11:28:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IEocj6+cUB4pKVovrpEg1+B3LF8qXN0mxu/ndTtbNqn+bGyfJ20D7G5IRM8m29Rdqv1Mfndfg== X-Received: by 2002:ac2:4150:0:b0:50e:404e:1260 with SMTP id c16-20020ac24150000000b0050e404e1260mr175699lfi.169.1702927696433; Mon, 18 Dec 2023 11:28:16 -0800 (PST) Received: from localhost (92.40.184.47.threembb.co.uk. [92.40.184.47]) by smtp.gmail.com with ESMTPSA id b16-20020a170906835000b00a23536c2d72sm1900122ejy.46.2023.12.18.11.28.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 11:28:16 -0800 (PST) From: Andrew Burgess To: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 06/14] Move scrollok call in register window In-Reply-To: <20231217-tui-regs-cleanup-v1-6-67bd0ea1e8be@tromey.com> References: <20231217-tui-regs-cleanup-v1-0-67bd0ea1e8be@tromey.com> <20231217-tui-regs-cleanup-v1-6-67bd0ea1e8be@tromey.com> Date: Mon, 18 Dec 2023 19:28:14 +0000 Message-ID: <874jgf1fap.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Tom Tromey writes: > The register window calls scrollok each time a register is written to > the window. However, we only need to call this once, at the start of > display. (We could actually call it just once when the window is > made, but that would involve making another method virtual Did you consider overriding make_window in the tui_data_window class? Like this: void tui_data_window::make_window () { tui_win_info::make_window (); /* In case the regs window is not boxed, we'll write the last char in the last line here, causing a scroll, so prevent that. */ if (this->handle != nullptr) scrollok (this->handle.get (), FALSE); } Thanks, Andrew > or adding a > new member -- both which I think are worse than this approach.) > --- > gdb/tui/tui-regs.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c > index 9108e460d6f..0ad23e93778 100644 > --- a/gdb/tui/tui-regs.c > +++ b/gdb/tui/tui-regs.c > @@ -237,6 +237,10 @@ tui_data_window::update_register_data (const reggroup *group, > void > tui_data_window::display_registers_from (int start_element_no) > { > + /* In case the regs window is not boxed, we'll write the last char in the > + last line here, causing a scroll, so prevent that. */ > + scrollok (handle.get (), FALSE); > + > int max_len = 0; > for (auto &&data_item_win : m_regs_content) > { > @@ -449,10 +453,6 @@ tui_data_window::check_register_values (frame_info_ptr frame) > void > tui_register_info::rerender (WINDOW *handle, int field_width) > { > - /* In case the regs window is not boxed, we'll write the last char in the > - last line here, causing a scroll, so prevent that. */ > - scrollok (handle, FALSE); > - > if (highlight) > /* We ignore the return value, casting it to void in order to avoid > a compiler warning. The warning itself was introduced by a patch > > -- > 2.43.0