From 89b0c96982370eb7fa4c43eb1080163dedcc4b0a Mon Sep 17 00:00:00 2001

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

Date: Fri, 28 Apr 2023 14:17:14 +0300

Subject: [PATCH 1/1] Wayland: Disable X11-specific code and features known to

not work

IssueID #575


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

src/ui/util.c | 115 +++++++++++++++++++++++++++-----------------------

src/x11.c | 14 ++++++

src/x11.h | 1 +

4 files changed, 93 insertions(+), 56 deletions(-)

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

index 5abfdb4e..63c32e8a 100644

--- a/src/app.c

+++ b/src/app.c

@@ -2243,6 +2243,19 @@ static int resizeWatcher_(void *user, SDL_Event *event) {

 return 0;

}

+iLocalDef iBool isResizeDrawEnabled_(void) {

+#if defined (LAGRANGE_ENABLE_RESIZE_DRAW)

+# if defined (LAGRANGE_ENABLE_X11_XLIB)

+# endif

+#else

+#endif

+}

static int run_App_(iApp *d) {

 /* Initial arrangement. */

 iForIndices(i, d->window->roots) {

@@ -2252,9 +2265,9 @@ static int run_App_(iApp *d) {

 }

 d->isRunning = iTrue;

 SDL_EventState(SDL_DROPFILE, SDL_ENABLE); /* open files via drag'n'drop */

-#if defined (LAGRANGE_ENABLE_RESIZE_DRAW)

-#endif

 while (d->isRunning) {

     processEvents_App(waitForNewEvents_AppEventMode);

     runTickers_App_(d);

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

index 296aedba..21e9d490 100644

--- a/src/ui/util.c

+++ b/src/ui/util.c

@@ -51,6 +51,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */

include "macos.h"

#endif

+#if defined (LAGRANGE_ENABLE_X11_XLIB)

+# include "x11.h"

+#endif

#include <the_Foundation/math.h>

#include <the_Foundation/path.h>

#include <SDL_timer.h>

@@ -1220,6 +1224,11 @@ void unselectAllNativeMenuItems_Widget(iWidget *menu) {

iLocalDef iBool isUsingMenuPopupWindows_(void) {

#if defined (LAGRANGE_ENABLE_POPUP_MENUS) && !defined (iPlatformTerminal)

+# if defined (LAGRANGE_ENABLE_X11_XLIB)

+# endif

 return deviceType_App() == desktop_AppDeviceType;

#else

 return iFalse;

@@ -1268,64 +1277,64 @@ void openMenuFlags_Widget(iWidget *d, iInt2 windowCoord, int menuOpenFlags) {

         }

     }

 }

-#if defined (LAGRANGE_ENABLE_POPUP_MENUS) && !defined (iPlatformTerminal)

     iInt2 winPos;

     SDL_GetWindowPosition(sdlWin, &winPos.x, &winPos.y);

         }

     }

 }

-#endif

 raise_Widget(d);

 if (deviceType_App() != desktop_AppDeviceType) {

     setFlags_Widget(d, arrangeWidth_WidgetFlag | resizeChildrenToWidestChild_WidgetFlag, 

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

index 40878c30..94f6701a 100644

--- a/src/x11.c

+++ b/src/x11.c

@@ -30,7 +30,18 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */

#include <X11/Xlib.h>

#include <X11/Xatom.h>

+iBool isXSession_X11(void) {

+}

void setDarkWindowTheme_SDLWindow(SDL_Window *d, iBool setDark) {

 SDL_SysWMinfo wmInfo;

 SDL_VERSION(&wmInfo.version);

 if (SDL_GetWindowWMInfo(d, &wmInfo)) {

@@ -45,6 +56,9 @@ void setDarkWindowTheme_SDLWindow(SDL_Window *d, iBool setDark) {

}

void handleCommand_X11(const char *cmd) {

 if (equal_Command(cmd, "theme.changed")) {        

     iConstForEach(PtrArray, iter, mainWindows_App()) {

         iMainWindow *mw = iter.ptr;

diff --git a/src/x11.h b/src/x11.h

index 2eb195ad..c25a212a 100644

--- a/src/x11.h

+++ b/src/x11.h

@@ -25,6 +25,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */

#include <the_Foundation/defs.h>

#include <SDL_video.h>

+iBool isXSession_X11 (void);

void setDarkWindowTheme_SDLWindow (SDL_Window *, iBool setDark);

void handleCommand_X11 (const char *cmd);

--

2.25.1

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

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