From ce928050f3f48db8c1dc46030f36fefc705de987 Mon Sep 17 00:00:00 2001

From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= jaakko.keranen@iki.fi

Date: Mon, 21 Sep 2020 13:52:13 +0300

Subject: [PATCH 1/1] macOS: Window size/mode restoration tweaks

Don't bother with maximized mode, it causes a needless animation at launch.


src/app.c | 18 ++++--------------

src/ui/window.c | 15 ++++++++++++---

2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/src/app.c b/src/app.c

index ee8bccb4..04928b84 100644

--- a/src/app.c

+++ b/src/app.c

@@ -142,25 +142,15 @@ static iString *serializePrefs_App_(const iApp *d) {

     y = d->window->lastRect.pos.y;

     w = d->window->lastRect.size.x;

     h = d->window->lastRect.size.y;

-#if 0

-#i f defined (iPlatformLinux)

-#endif

     appendFormat_String(str, "window.setrect width:%d height:%d coord:%d %d\n", w, h, x, y);

     appendFormat_String(str, "sidebar.width arg:%d\n", width_SidebarWidget(sidebar));

+#if !defined (iPlatformApple)

     if (isMaximized) {

         appendFormat_String(str, "~window.maximize\n");

     }

+#endif

 }

 if (isVisible_Widget(sidebar)) {

     appendCStr_String(str, "sidebar.toggle\n");

diff --git a/src/ui/window.c b/src/ui/window.c

index 6c7775ee..19432691 100644

--- a/src/ui/window.c

+++ b/src/ui/window.c

@@ -597,6 +597,15 @@ SDL_Renderer *renderer_Window(const iWindow *d) {

 return d->render;

}

+static iBool isMaximized_Window_(const iWindow *d) {

+#if !defined (iPlatformApple)

+#else

+#endif

+}

static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) {

 switch (ev->event) {

#if defined (LAGRANGE_ENABLE_WINDOWPOS_FIX)

@@ -610,10 +619,10 @@ static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) {

         return iFalse;

#endif

     case SDL_WINDOWEVENT_MOVED: {

             d->lastRect.pos = init_I2(ev->data1, ev->data2);

             iInt2 border = zero_I2();

-#if defined (iPlatformMsys) || defined (iPlatformLinux)

+#if !defined (iPlatformApple)

             SDL_GetWindowBordersSize(d->win, &border.y, &border.x, NULL, NULL);

#endif

             d->lastRect.pos = max_I2(zero_I2(), sub_I2(d->lastRect.pos, border));

@@ -622,7 +631,7 @@ static iBool handleWindowEvent_Window_(iWindow *d, const SDL_WindowEvent *ev) {

     }

     case SDL_WINDOWEVENT_RESIZED:

     case SDL_WINDOWEVENT_SIZE_CHANGED:

             d->lastRect.size = init_I2(ev->data1, ev->data2);

         }

         updateRootSize_Window_(d);

--

2.25.1

Proxy Information
Original URL
gemini://git.skyjake.fi/lagrange/work%2Fv1.7/patch/ce928050f3f48db8c1dc46030f36fefc705de987.patch
Status Code
Success (20)
Meta
text/plain
Capsule Response Time
56.501522 milliseconds
Gemini-to-HTML Time
3.35939 milliseconds

This content has been proxied by September (ba2dc).