From: Helmut Eller <eller.helmut@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: "Gerd Möllmann" <gerd.moellmann@gmail.com>,
fejfighter@gmail.com, spacibba@aol.com, avityazev@disroot.org,
emacs-devel@gnu.org
Subject: Re: MPS and pgtk
Date: Thu, 27 Jun 2024 21:07:40 +0200 [thread overview]
Message-ID: <87h6de6w77.fsf@gmail.com> (raw)
In-Reply-To: <86bk3m7w3e.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 27 Jun 2024 09:12:21 +0300")
[-- Attachment #1: Type: text/plain, Size: 301 bytes --]
On Thu, Jun 27 2024, Eli Zaretskii wrote:
> Jeff's assignment is on file, so no copyright issues here.
>
> I installed the change on the branch.
Here's another one that is needed to avoid crashes when pressing the
scrollbar. The other patch is for the tty version; it has nothing to do
with pgtk.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Make-tty_list-a-root.patch --]
[-- Type: text/x-diff, Size: 2059 bytes --]
From 840e28c742a9fed9e18769703ff609d7dae2c6ee Mon Sep 17 00:00:00 2001
From: Helmut Eller <eller.helmut@gmail.com>
Date: Thu, 27 Jun 2024 16:27:45 +0200
Subject: [PATCH 1/2] Make tty_list a root
* src/igc.c (scan_tty_list, root_create_tty_list): New.
(make_igc): Make tty_list an exact root.
---
src/igc.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/src/igc.c b/src/igc.c
index 6a924a654f6..c960dde3c05 100644
--- a/src/igc.c
+++ b/src/igc.c
@@ -48,6 +48,7 @@
#include "thread.h"
#include "treesit.h"
#include "puresize.h"
+#include "termchar.h"
#ifdef HAVE_WINDOW_SYSTEM
#include TERM_HEADER
#endif /* HAVE_WINDOW_SYSTEM */
@@ -1236,6 +1237,24 @@ scan_ptr_exact (mps_ss_t ss, void *start, void *end, void *closure)
return MPS_RES_OK;
}
+static mps_res_t
+scan_tty_list (mps_ss_t ss, void *start, void *end, void *closure)
+{
+ igc_assert (start == &tty_list);
+ igc_assert (end == (&tty_list) + 1);
+ MPS_SCAN_BEGIN (ss)
+ {
+ for (struct tty_display_info *tty = tty_list; tty; tty = tty->next)
+ {
+ IGC_FIX12_RAW (ss, &tty->terminal);
+ IGC_FIX12_OBJ (ss, &tty->top_frame);
+ IGC_FIX12_RAW (ss, &tty->previous_frame);
+ }
+ }
+ MPS_SCAN_END (ss);
+ return MPS_RES_OK;
+}
+
/***********************************************************************
Default pad, fwd, ...
***********************************************************************/
@@ -2275,6 +2294,13 @@ root_create_terminal_list (struct igc *gc)
root_create_ambig (gc, start, end, "terminal-list");
}
+static void
+root_create_tty_list (struct igc *gc)
+{
+ root_create_exact (gc, &tty_list, (&tty_list) + 1,
+ scan_tty_list, "tty-list");
+}
+
static void
root_create_main_thread (struct igc *gc)
{
@@ -3952,6 +3978,7 @@ make_igc (void)
root_create_staticvec (gc);
root_create_lispsym (gc);
root_create_terminal_list (gc);
+ root_create_tty_list (gc);
root_create_main_thread (gc);
root_create_exact_ptr (gc, ¤t_thread);
root_create_exact_ptr (gc, &all_threads);
--
2.39.2
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Fix-scrollbars-for-pgtk.patch --]
[-- Type: text/x-diff, Size: 1337 bytes --]
From ae8052a7838217bf45e1cd916b0ec8452c4623ca Mon Sep 17 00:00:00 2001
From: Helmut Eller <eller.helmut@gmail.com>
Date: Thu, 27 Jun 2024 20:50:08 +0200
Subject: [PATCH 2/2] Fix scrollbars for pgtk
* src/pgtkterm.c (xg_scroll_callback, xg_end_scroll_callback)[HAVE_MPS]:
Load the scroll-bar from the cell.
---
src/pgtkterm.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 7279f5d863b..7ec0969a14b 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -3953,7 +3953,12 @@ xg_scroll_callback (GtkRange * range,
GtkScrollType scroll, gdouble value, gpointer user_data)
{
int whole = 0, portion = 0;
+#ifdef HAVE_MPS
+ struct scroll_bar **bar_cell = user_data;
+ struct scroll_bar *bar = *bar_cell;
+#else
struct scroll_bar *bar = user_data;
+#endif
enum scroll_bar_part part = scroll_bar_nowhere;
GtkAdjustment *adj = GTK_ADJUSTMENT (gtk_range_get_adjustment (range));
@@ -4019,7 +4024,12 @@ xg_scroll_callback (GtkRange * range,
xg_end_scroll_callback (GtkWidget *widget,
GdkEventButton *event, gpointer user_data)
{
+#ifdef HAVE_MPS
+ struct scroll_bar **bar_cell = user_data;
+ struct scroll_bar *bar = *bar_cell;
+#else
struct scroll_bar *bar = user_data;
+#endif
bar->dragging = -1;
if (WINDOWP (window_being_scrolled))
{
--
2.39.2
next prev parent reply other threads:[~2024-06-27 19:07 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-26 12:56 MPS and pgtk Aleksandr Vityazev
2024-06-26 16:38 ` Gerd Möllmann
2024-06-26 22:38 ` Ergus
2024-06-27 0:26 ` Fejfighter
2024-06-27 3:59 ` Gerd Möllmann
2024-06-27 6:12 ` Eli Zaretskii
2024-06-27 19:07 ` Helmut Eller [this message]
2024-06-27 19:23 ` Gerd Möllmann
2024-06-28 3:13 ` Gerd Möllmann
2024-06-27 3:57 ` Gerd Möllmann
2024-06-27 6:08 ` Eli Zaretskii
2024-06-27 5:40 ` Eli Zaretskii
2024-06-27 6:09 ` Po Lu
2024-06-27 10:19 ` Arsen Arsenović
2024-06-27 10:36 ` Eli Zaretskii
2024-07-06 0:32 ` Konstantin Kharlamov
2024-06-27 12:26 ` Po Lu
2024-07-05 21:41 ` Björn Bidar
[not found] ` <871q47freu.fsf@>
2024-07-06 2:01 ` Daniel Colascione
2024-07-07 3:11 ` Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h6de6w77.fsf@gmail.com \
--to=eller.helmut@gmail.com \
--cc=avityazev@disroot.org \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=fejfighter@gmail.com \
--cc=gerd.moellmann@gmail.com \
--cc=spacibba@aol.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).