summaryrefslogtreecommitdiff
path: root/sys/src/cmd/rio
diff options
context:
space:
mode:
authorJacob Moody <moody@posixcafe.org>2022-08-18 11:44:46 +0000
committerJacob Moody <moody@posixcafe.org>2022-08-18 11:44:46 +0000
commitf508dfaab17c0ec9519078db82c9d5b5f1ba76a5 (patch)
tree54554fde6aab9c55c14f5d1242096573b572a74a /sys/src/cmd/rio
parente7d03d19100fe3180906c8ce3f2cab3ba9387fe8 (diff)
rio: require a confirmation for Exit
Even accidentally killing a subrio can be annoying. So instead of only showing this on subrios, show it always but always require an additional click to actually exit.
Diffstat (limited to 'sys/src/cmd/rio')
-rw-r--r--sys/src/cmd/rio/dat.h1
-rw-r--r--sys/src/cmd/rio/data.c12
-rw-r--r--sys/src/cmd/rio/rio.c32
3 files changed, 36 insertions, 9 deletions
diff --git a/sys/src/cmd/rio/dat.h b/sys/src/cmd/rio/dat.h
index 96ad631b1..b500dad54 100644
--- a/sys/src/cmd/rio/dat.h
+++ b/sys/src/cmd/rio/dat.h
@@ -308,6 +308,7 @@ Cursor sightcursor;
Cursor whitearrow;
Cursor query;
Cursor *corners[9];
+Cursor skull;
Image *background;
Image *cols[NCOL];
diff --git a/sys/src/cmd/rio/data.c b/sys/src/cmd/rio/data.c
index 86e43c72f..d65ca55f0 100644
--- a/sys/src/cmd/rio/data.c
+++ b/sys/src/cmd/rio/data.c
@@ -82,6 +82,18 @@ Cursor tl = {
0x0e, 0x00, 0x0e, 0x00, 0x0e, 0x00, 0x00, 0x00, }
};
+Cursor skull = {
+ {-7,-7},
+ {0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xe7, 0xe7,
+ 0xff, 0xff, 0xff, 0xff, 0x3f, 0xfc, 0x1f, 0xf8,
+ 0x0f, 0xf0, 0x3f, 0xfc, 0xff, 0xff, 0xff, 0xff,
+ 0xef, 0xf7, 0xc7, 0xe3, 0x00, 0x00, 0x00, 0x00,},
+ {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x03,
+ 0xE7, 0xE7, 0x3F, 0xFC, 0x0F, 0xF0, 0x0D, 0xB0,
+ 0x07, 0xE0, 0x06, 0x60, 0x37, 0xEC, 0xE4, 0x27,
+ 0xC3, 0xC3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,}
+};
+
Cursor t = {
{-7, -8},
{0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x06, 0xc0,
diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c
index ce64baba7..9d666bf15 100644
--- a/sys/src/cmd/rio/rio.c
+++ b/sys/src/cmd/rio/rio.c
@@ -26,6 +26,7 @@ void delete(void);
void hide(void);
void unhide(int);
void newtile(int);
+void confirmexit(void);
Image* sweep(void);
Image* bandsize(Window*);
Image* drag(Window*);
@@ -124,10 +125,6 @@ threadmain(int argc, char *argv[])
Image *i;
Rectangle r;
- if(access("/dev/wctl", AEXIST) != 0){
- menu3str[Exit] = nil;
- Hidden--;
- }
initstr = nil;
kbdin = nil;
maxtab = 0;
@@ -786,11 +783,8 @@ button3menu(void)
hide();
break;
case Exit:
- if(Hidden > Exit){
- send(exitchan, nil);
- break;
- }
- /* else fall through */
+ confirmexit();
+ break;
default:
unhide(i);
break;
@@ -1061,6 +1055,26 @@ delete(void)
}
void
+confirmexit(void)
+{
+ menuing = TRUE;
+ riosetcursor(&skull);
+ while(mouse->buttons == 0)
+ readmouse(mousectl);
+ if(mouse->buttons != 4)
+ goto Nope;
+ while(mouse->buttons){
+ if(mouse->buttons != 4)
+ goto Nope;
+ readmouse(mousectl);
+ }
+ send(exitchan, nil);
+Nope:
+ riosetcursor(nil);
+ menuing = FALSE;
+}
+
+void
resize(void)
{
Window *w;