rio icon indicating copy to clipboard operation
rio copied to clipboard

"confirm-before-quit" doesn't work

Open LearnWebGitHub opened this issue 1 year ago • 13 comments

Rio would exit immediately without confirming even there's command running I've tried it on weston, i3 and sway

LearnWebGitHub avatar Aug 19 '24 17:08 LearnWebGitHub

I'm on i3 as well and I'm not sure how you expect Rio to confirm for exit since the default window kill command ($mod+Shift+q) simply sends the kill signal to the application. I'm guessing it is the equivalent of kill -9 $(pgrep rio).

Even though Rio can catch this signal, it might not be actionable since the application is already killed. Maybe it is supposed to act upon "window close" signal which is also not actionable on i3 (tried it with xdotool windowclose).

I'm not sure how this feature is expected to work (or how does it work on other platforms) so maybe @raphamorim can enlighten us about it.

orhun avatar Aug 23 '24 06:08 orhun

I think I broke this feature when went from 0.0.x to 0.1.0 tbh. Back in the old versions would appear a screen in the last window or every time triggered close button/shortcut in the window.

the screen would ask, press enter to confirm

raphamorim avatar Aug 23 '24 06:08 raphamorim

OK, thanks for the answer!

LearnWebGitHub avatar Aug 23 '24 08:08 LearnWebGitHub

let's keep this open, I will give it a shot fixing it

orhun avatar Aug 23 '24 08:08 orhun

0.0.38 still works, the 0.1.8 is broken though

image

raphamorim avatar Aug 23 '24 08:08 raphamorim

I still don't get that page on i3 even with the suggested version. Like I said, it is probably because i3 simply kills the window instead of closing it due to the fact that there is no "close button". It is a tiling window manager afterall.

Either way, I will find a way to trigger that screen and potentially fix it for other desktop environments.

orhun avatar Aug 23 '24 15:08 orhun

I also tried the native "Rio way" of closing it via following custom key binding:

[bindings]
keys = [
  { key = "home", action = "Quit" },
]

Am I supposed to get a confirmation screen for this command as well? What is the difference between quit and exit?

orhun avatar Aug 23 '24 15:08 orhun

Quit is triggered by key bindings, on macos would be Command + Q and in that case would confirm-before-quit.

Exit is when rio just shuts down and it can happen for many reasons, like kill the process even.

raphamorim avatar Aug 23 '24 17:08 raphamorim

Unfortunately I can't trigger it on i3 even with the older versions which makes me further believe that it is not actually possible...

orhun avatar Aug 25 '24 20:08 orhun

When I was using GNOME Terminal, I can trigger this on i3 (mod+shift+q). So I think it's possible although I have absolutely no idea how to implement it.

LearnWebGitHub avatar Aug 27 '24 05:08 LearnWebGitHub

I just installed on macOS and noticed neither confirm to quit, nor remapping Cmd-Q to "none" work:

keys = [
   { key = "q", with = "super", action = "none" }
]

It's definitely possible because iTerm 2 has a confirm on quit, as does Firefox.

jessejoe avatar Aug 27 '24 14:08 jessejoe

yes, it is possible, it used to work entirelly on macos at least but is broken now 😢 will take a look on it this week as well

raphamorim avatar Aug 27 '24 14:08 raphamorim

I made the proper fix for MacOS on 0.1.16 (using native resources)

image

I plan to iterate fixes for Windows/Linux next versions

raphamorim avatar Sep 24 '24 12:09 raphamorim

Nice! Looking forward to the next version.

LearnWebGitHub avatar Oct 07 '24 13:10 LearnWebGitHub

Should be fixed on main right now, asked some peeps to test windows and linux they reported it's working now.

Please lemme know if doesn't then i can reopen

raphamorim avatar Nov 08 '24 09:11 raphamorim