9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Stuart Morrow <morrow.stuart@gmail.com>
To: 9front@9front.org
Subject: Re: [9front] Re: speaking of screenlock
Date: Fri, 16 Jul 2021 10:07:02 +0100	[thread overview]
Message-ID: <CABB-WO_Oqc4a3XMrKAxYJ5TofB_Q2g=Vm3fJtCoBZwy5zXsGRw@mail.gmail.com> (raw)
In-Reply-To: <5DC2C69CF1837BEADA2CE21DC0DEBDF0@eigenstate.org>

> What makes you think they can't access
> each other's malloc'ed objects?

Because it crashes in the second call to redraw (new function, only in
the first of this thread, assuming you got that), and moreover, I can
get past the killer 'r = screen->r' using a trick:

redraw(void)
{
	int fd, dx, dy;
	static Image *i;
	static Rectangle r, unusedr, screenr;
	Point p, q;

	screen = _screen->image;	/* fullscreen */

	/* we can access screen->r the first time. */
	/* getwindow doesn't change it… fullscreen is fullscreen… */
	if(eqrect(screenr, unusedr))
		screenr = screen->r;

(and then s/screen->r/screenr/g for the rest of the function)

just to then get killed by, I guess, draw(screen, ...).

So it seems like just touching certain objects is killing me.

Regardless, the following should replace what's in current screenlock:

void
top(void*)
{
	int fd, n;
	char buf[128];

	if((fd = open("/dev/wctl", ORDWR)) < 0)
		return;

	for(;;){
		n = read(fd, buf, sizeof buf);
		if(n > 48)
			if(strstr(buf+48, "notcurrent")){
				write(fd, "current", 7); /* rio redraws border… */
				(getwindow-redraw is right here in the crashing version)
			}
	}
}

Stuart

  reply	other threads:[~2021-07-16  9:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 14:27 [9front] " Stuart Morrow
2021-07-15 21:47 ` [9front] " Stuart Morrow
2021-07-15 23:04   ` ori
2021-07-16  9:07     ` Stuart Morrow [this message]
2021-07-16 10:01       ` cinap_lenrek
2021-07-16 10:50         ` Stuart Morrow

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABB-WO_Oqc4a3XMrKAxYJ5TofB_Q2g=Vm3fJtCoBZwy5zXsGRw@mail.gmail.com' \
    --to=morrow.stuart@gmail.com \
    --cc=9front@9front.org \
    /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.
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 NNTP newsgroup(s).