]> git.mdlowis.com Git - projs/tide.git/commitdiff
Fixed shutdown behavior
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 2 May 2017 17:13:51 +0000 (13:13 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 2 May 2017 17:13:51 +0000 (13:13 -0400)
TODO.md
inc/win.h
lib/win.c
term.c
xedit.c
xpick.c

diff --git a/TODO.md b/TODO.md
index 409b33eb4a3f53c62708f323d0a8d89c6a0f8925..320bc0ea4f0c4bdbfe4ae0026ef738db1ceb2c8c 100644 (file)
--- 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
index 9e02cb098691f02419a6f7fc4e84cd437a75f387..2272e56e9b35a7cec1dfc3d5b8268793ef6cd461 100644 (file)
--- 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);
index a4b52d91f23663a5b5ebe939e1d80985082b779b..0a5d0edc4ec52cf7e08543d39209fb3cfe6b0aef 100644 (file)
--- 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 9c67faf5919f34f39dcad494645e86c793fe5230..88ff7ae521ea1c8b0d8579a3cb55e37d6aed9e6d 100644 (file)
--- 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 7186c98bbde64ba8c4ab41dc49b1d2bec62f789e..e349f47c180f1f3f2a986758f122af675a8985c4 100644 (file)
--- 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 04393191eb861914271c1f269f9824fcdd88cd31..5f4b23b2685c5fb659e4302caef46ad76cfbe1a3 100644 (file)
--- 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) {