From: Michael D. Lowis Date: Tue, 2 May 2017 17:13:51 +0000 (-0400) Subject: Fixed shutdown behavior X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=09d206d4c27dad337db7c5f0205bd07ad56b23b8;p=projs%2Ftide.git Fixed shutdown behavior --- diff --git a/TODO.md b/TODO.md index 409b33e..320bc0e 100644 --- a/TODO.md +++ b/TODO.md @@ -14,7 +14,6 @@ Up Next: Straight-up Bugs: -* Window manager will close window without regard to modified status * fix crash on saving read-only file * fix crash on save to file that can't be created * tab inserts dont coalesce like one would expect diff --git a/inc/win.h b/inc/win.h index 9e02cb0..2272e56 100644 --- a/inc/win.h +++ b/inc/win.h @@ -50,6 +50,7 @@ void win_setscroll(double offset, double visible); /* These functions must be implemented by any appliation that wishes to use this module */ +void onshutdown(void); void onupdate(void); void onlayout(void); void onscroll(double percent); diff --git a/lib/win.c b/lib/win.c index a4b52d9..0a5d0ed 100644 --- a/lib/win.c +++ b/lib/win.c @@ -17,7 +17,6 @@ static WinRegion getregion(size_t x, size_t y); static void onredraw(int height, int width); static void oninput(int mods, Rune key); static void onmouse(MouseAct act, MouseBtn btn, int x, int y); -static void onshutdown(void); static void onwheelup(WinRegion id, size_t count, size_t row, size_t col); static void onwheeldn(WinRegion id, size_t count, size_t row, size_t col); @@ -323,10 +322,6 @@ static void onmouse(MouseAct act, MouseBtn btn, int x, int y) { } } -static void onshutdown(void) { - x11_deinit(); -} - static void onwheelup(WinRegion id, size_t count, size_t row, size_t col) { view_scroll(win_view(id), -ScrollLines); } diff --git a/term.c b/term.c index 9c67faf..88ff7ae 100644 --- a/term.c +++ b/term.c @@ -27,6 +27,10 @@ void onupdate(void) { void onlayout(void) { } +void onshutdown(void) { + x11_deinit(); +} + #ifndef TEST int main(int argc, char** argv) { win_window("term"); diff --git a/xedit.c b/xedit.c index 7186c98..e349f47 100644 --- a/xedit.c +++ b/xedit.c @@ -556,6 +556,10 @@ void onlayout(void) { win_setscroll(scroll_off, scroll_vis); } +void onshutdown(void) { + quit(); +} + #ifndef TEST int main(int argc, char** argv) { /* setup the shell */ diff --git a/xpick.c b/xpick.c index 0439319..5f4b23b 100644 --- a/xpick.c +++ b/xpick.c @@ -162,6 +162,10 @@ void onlayout(void) { win_setscroll(0.0, 1.0); } +void onshutdown(void) { + x11_deinit(); +} + /* Main Routine *****************************************************************************/ static void backspace(void) {