Lagrange [work/v1.7]

Fixed build on Windows (MSYS)

=> ba6d544b1237aea6901cf5b4f6562db9eb0f46c4

diff --git a/src/app.c b/src/app.c
index c1c1da27..d7392423 100644
--- a/src/app.c
+++ b/src/app.c
@@ -762,7 +762,7 @@ static void init_App_(iApp *d, int argc, char **argv) {
     mulfv_I2(&d->initialWindowRect.size, desktopDPI_Win32());
 #endif
 #if defined (iPlatformLinux)
-    /* Scale by the primary (?) monitor DPI. */ 
+    /* Scale by the primary (?) monitor DPI. */
     if (isRunningUnderWindowSystem_App()) {
         float vdpi;
         SDL_GetDisplayDPI(0, NULL, NULL, &vdpi);
@@ -1061,7 +1061,7 @@ void trimMemory_App(void) {
             init_ObjectListIterator(&i, docs);
         }
     }
-    iRelease(docs);    
+    iRelease(docs);
 }
 
 iLocalDef iBool isWaitingAllowed_App_(iApp *d) {
@@ -1249,7 +1249,7 @@ void processEvents_App(enum iAppEventMode eventMode) {
                     }
                     else if (ev.type == SDL_MOUSEMOTION) {
                         if (~ev.motion.state & SDL_BUTTON(SDL_BUTTON_LEFT)) {
-                            continue; /* only when pressing a button */    
+                            continue; /* only when pressing a button */
                         }
                         const float xf = (d->window->pixelRatio * ev.motion.x) / (float) d->window->size.x;
                         const float yf = (d->window->pixelRatio * ev.motion.y) / (float) d->window->size.y;
@@ -1263,7 +1263,7 @@ void processEvents_App(enum iAppEventMode eventMode) {
                         ev.tfinger.fingerId = 0x1234;
                         ev.tfinger.pressure = 1.0f;
                         ev.tfinger.timestamp = SDL_GetTicks();
-                        ev.tfinger.touchId = SDL_TOUCH_MOUSEID;                        
+                        ev.tfinger.touchId = SDL_TOUCH_MOUSEID;
                     }
                 }
 #endif
@@ -1307,7 +1307,7 @@ void processEvents_App(enum iAppEventMode eventMode) {
                                 if (root) {
                                     arrange_Widget(root->widget);
                                 }
-                            }                            
+                            }
                         }
                     }
                     if (!wasUsed) {
@@ -1374,11 +1374,11 @@ static int resizeWatcher_(void *user, SDL_Event *event) {
     if (event->type == SDL_WINDOWEVENT && event->window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
         const SDL_WindowEvent *winev = &event->window;
 #if defined (iPlatformMsys)
-        resetFonts_Text(); {
+        resetFonts_Text(text_Window(d->window)); {
             SDL_Event u = { .type = SDL_USEREVENT };
             u.user.code = command_UserEventCode;
             u.user.data1 = strdup("theme.changed auto:1");
-            dispatchEvent_Window(d->window, &u);
+            dispatchEvent_Window(as_Window(d->window), &u);
         }
 #endif
         drawWhileResizing_MainWindow(d->window, winev->data1, winev->data2);
@@ -1420,7 +1420,7 @@ void refresh_App(void) {
 #endif
     const iPtrArray *windows = listWindows_App_(d);
     /* Destroy pending widgets. */ {
-        iConstForEach(PtrArray, j, windows) { 
+        iConstForEach(PtrArray, j, windows) {
             iWindow *win = j.ptr;
             setCurrent_Window(win);
             iForIndices(i, win->roots) {
@@ -1449,7 +1449,7 @@ void refresh_App(void) {
                     break;
                 default:
                     draw_Window(win);
-                    break;        
+                    break;
             }
         }
     }
@@ -1807,7 +1807,7 @@ static iBool handlePrefsCommands_(iWidget *d, const char *cmd) {
         updateFontButton_(findChild_Widget(d, "prefs.headingfont"), arg_Command(cmd));
         return iFalse;
     }
-    else if (startsWith_CStr(cmd, "input.ended id:prefs.linespacing")) {    
+    else if (startsWith_CStr(cmd, "input.ended id:prefs.linespacing")) {
         /* Apply line spacing changes immediately. */
         const iInputWidget *lineSpacing = findWidget_App("prefs.linespacing");
         postCommandf_App("linespacing.set arg:%f", toFloat_String(text_InputWidget(lineSpacing)));
@@ -1895,7 +1895,7 @@ static iBool handleIdentityCreationCommands_(iWidget *dlg, const char *cmd) {
         }
         setFlags_Widget(pointer_Command(cmd), disabled_WidgetFlag, iTrue);
         arrange_Widget(dlg);
-        refresh_Widget(dlg);        
+        refresh_Widget(dlg);
         return iTrue;
     }
     if (equal_Command(cmd, "ident.scope")) {
@@ -2027,7 +2027,7 @@ const iString *searchQueryUrl_App(const iString *queryStringUnescaped) {
 static void resetFonts_App_(iApp *d) {
     iConstForEach(PtrArray, win, listWindows_App_(d)) {
         resetFonts_Text(text_Window(win.ptr));
-    }    
+    }
 }
 
 iBool handleCommand_App(const char *cmd) {
@@ -2875,7 +2875,7 @@ iBool handleCommand_App(const char *cmd) {
         write_Ipc(argLabel_Command(cmd, "pid"),
                   collectNewFormat_String("%s\n", cstr_String(url_DocumentWidget(document_App()))),
                   response_IpcWrite);
-        return iTrue;        
+        return iTrue;
     }
     else if (equal_Command(cmd, "ipc.signal")) {
         if (argLabel_Command(cmd, "raise")) {
diff --git a/src/ui/window.c b/src/ui/window.c
index e9a34ace..27ef2bc3 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -240,7 +240,7 @@ static void updateSize_MainWindow_(iMainWindow *d, iBool notifyAlways) {
 }
 
 void drawWhileResizing_MainWindow(iMainWindow *d, int w, int h) {
-    draw_MainWindow(d);        
+    draw_MainWindow(d);
 }
 
 static float pixelRatio_Window_(const iWindow *d) {
@@ -438,7 +438,7 @@ void init_Window(iWindow *d, enum iWindowType type, iRect rect, uint32_t flags)
     if (left_Rect(rect) >= 0 || top_Rect(rect) >= 0) {
         SDL_SetWindowPosition(d->win, left_Rect(rect), top_Rect(rect));
     }
-    SDL_GetRendererOutputSize(d->render, &d->size.x, &d->size.y);    
+    SDL_GetRendererOutputSize(d->render, &d->size.x, &d->size.y);
     drawBlank_Window_(d);
     d->pixelRatio   = pixelRatio_Window_(d); /* point/pixel conversion */
     d->displayScale = displayScale_Window_(d);
@@ -472,7 +472,7 @@ void deinit_Window(iWindow *d) {
         if (d->cursors[i]) {
             SDL_FreeCursor(d->cursors[i]);
         }
-    }    
+    }
 }
 
 void init_MainWindow(iMainWindow *d, iRect rect) {
@@ -522,7 +522,7 @@ void init_MainWindow(iMainWindow *d, iRect rect) {
 #endif
     }
 #if defined(iPlatformMsys)
-    SDL_SetWindowMinimumSize(d->win, minSize.x * d->base.displayScale, minSize.y * d->base.displayScale);
+    SDL_SetWindowMinimumSize(d->base.win, minSize.x * d->base.displayScale, minSize.y * d->base.displayScale);
     useExecutableIconResource_SDLWindow(d->base.win);
 #endif
 #if defined (iPlatformLinux)
@@ -538,7 +538,7 @@ void init_MainWindow(iMainWindow *d, iRect rect) {
     setupWindow_iOS(as_Window(d));
 #endif
     setCurrent_Text(d->base.text);
-    SDL_GetRendererOutputSize(d->base.render, &d->base.size.x, &d->base.size.y);    
+    SDL_GetRendererOutputSize(d->base.render, &d->base.size.x, &d->base.size.y);
     setupUserInterface_MainWindow(d);
     postCommand_App("~bindings.changed"); /* update from bindings */
     /* Load the border shadow texture. */ {
@@ -800,7 +800,7 @@ static iBool handleWindowEvent_MainWindow_(iMainWindow *d, const SDL_WindowEvent
                 // printf("normal rect set (move)\n"); fflush(stdout);
                 iInt2 border = zero_I2();
 #if !defined(iPlatformApple)
-                SDL_GetWindowBordersSize(d->win, &border.y, &border.x, NULL, NULL);
+                SDL_GetWindowBordersSize(d->base.win, &border.y, &border.x, NULL, NULL);
 #endif
                 d->place.normalRect.pos =
                     max_I2(zero_I2(), sub_I2(d->place.normalRect.pos, border));
@@ -1055,7 +1055,7 @@ iBool dispatchEvent_Window(iWindow *d, const SDL_Event *ev) {
                 if (!isEscapeKeypress_(ev)) {
                     /* Key events go only to the root with keyboard focus, with the exception
                        of Escape that will also affect the entire window. */
-                    continue; 
+                    continue;
                 }
             }
             if (ev->type == SDL_MOUSEWHEEL && !contains_Rect(rect_Root(root),
@@ -1126,7 +1126,7 @@ void draw_Window(iWindow *d) {
 #if !defined (NDEBUG)
         draw_Text(defaultBold_FontId, safeRect_Root(root).pos, red_ColorId, "%d", drawCount_);
         drawCount_ = 0;
-#endif        
+#endif
     }
 //    drawRectThickness_Paint(&p, (iRect){ zero_I2(), sub_I2(d->size, one_I2()) }, gap_UI / 4, uiSeparator_ColorId);
     setCurrent_Root(NULL);
@@ -1587,6 +1587,9 @@ iWindow *newPopup_Window(iInt2 screenPos, iWidget *rootWidget) {
         new_Window(popup_WindowType,
                    (iRect){ screenPos, divf_I2(rootWidget->rect.size, get_Window()->pixelRatio) },
                    SDL_WINDOW_ALWAYS_ON_TOP |
+#if !defined (iPlatformAppleDesktop)
+                   SDL_WINDOW_BORDERLESS |
+#endif
                    SDL_WINDOW_POPUP_MENU |
                    SDL_WINDOW_SKIP_TASKBAR);
 #if defined (iPlatformAppleDesktop)
Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.7/cdiff/ba6d544b1237aea6901cf5b4f6562db9eb0f46c4
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
64.555222 milliseconds
Gemini-to-HTML Time
0.427719 milliseconds

This content has been proxied by September (3851b).