]> git.mdlowis.com Git - projs/tide.git/commitdiff
Tweaked redraw logic to ensure content is update *after* layout so that it can be...
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 2 May 2017 16:52:48 +0000 (12:52 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 2 May 2017 16:52:48 +0000 (12:52 -0400)
TODO.md
lib/win.c

diff --git a/TODO.md b/TODO.md
index 320bc0ea4f0c4bdbfe4ae0026ef738db1ceb2c8c..409b33eb4a3f53c62708f323d0a8d89c6a0f8925 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -14,6 +14,7 @@ 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 52715a31649d068fb549c70f94f12bb5fb15d211..a4b52d91f23663a5b5ebe939e1d80985082b779b 100644 (file)
--- a/lib/win.c
+++ b/lib/win.c
@@ -166,7 +166,6 @@ static void layout(int width, int height) {
     
     /* place the status region */
     view_resize(statview, 1, Regions[STATUS].width / fwidth);
-    view_update(statview, &(Regions[STATUS].csrx), &(Regions[STATUS].csry));
     
     /* Place the tag region relative to status */
     Regions[TAGS].y = 5 + Regions[STATUS].y + Regions[STATUS].height;
@@ -175,7 +174,6 @@ static void layout(int width, int height) {
     size_t tagrows    = view_limitrows(tagview, maxtagrows, tagcols);
     Regions[TAGS].height = tagrows * fheight;
     view_resize(tagview, tagrows, tagcols);
-    view_update(tagview, &(Regions[TAGS].csrx), &(Regions[TAGS].csry));
     
     /* Place the scroll region relative to tags */
     Regions[SCROLL].x      = 0;
@@ -189,16 +187,17 @@ static void layout(int width, int height) {
     Regions[EDIT].height = (height - Regions[EDIT].y - 5);
     Regions[EDIT].width  = width - Regions[SCROLL].width - 5; 
     view_resize(editview, Regions[EDIT].height / fheight, Regions[EDIT].width / fwidth);
-    view_update(editview, &(Regions[EDIT].csrx), &(Regions[EDIT].csry));
 }
 
 static void onredraw(int width, int height) {
     size_t fheight = x11_font_height(Font);
     size_t fwidth  = x11_font_width(Font);
     
-    /* layout and draw the three text regions */
-    onupdate(); // Let the user program update the status and other content
     layout(width, height);
+    onupdate(); // Let the user program update the status and other content
+    view_update(win_view(STATUS), &(Regions[STATUS].csrx), &(Regions[STATUS].csry));
+    view_update(win_view(TAGS), &(Regions[TAGS].csrx), &(Regions[TAGS].csry));
+    view_update(win_view(EDIT), &(Regions[EDIT].csrx), &(Regions[EDIT].csry));
     onlayout(); // Let the user program update the scroll bar
     
     for (int i = 0; i < SCROLL; i++) {