=> c113930a66efb7a2a8a1bab62e110dafb5b21209
[1mdiff --git a/CMakeLists.txt b/CMakeLists.txt[m [1mindex 2b229442..d98cc700 100644[m [1m--- a/CMakeLists.txt[m [1m+++ b/CMakeLists.txt[m [36m@@ -45,15 +45,17 @@[m [moption (ENABLE_HARFBUZZ_MINIMAL "Build the HarfBuzz library with minimal depende[m option (ENABLE_IDLE_SLEEP "While idle, sleep in the main thread instead of waiting for events" ON)[m option (ENABLE_IPC "Use IPC to communicate between running instances" ON)[m option (ENABLE_KERNING "Enable kerning in font renderer (slower)" ON)[m [32m+[m[32moption (ENABLE_MAC_MENUS "Use native context menus (macOS)" ON)[m option (ENABLE_MOBILE_PHONE "Use the phone mobile UI design instead of desktop UI" OFF)[m option (ENABLE_MOBILE_TABLET "Use the tablet mobile UI design instead of desktop UI" OFF)[m option (ENABLE_MPG123 "Use mpg123 for decoding MPEG audio" ON)[m [32m+[m[32moption (ENABLE_POPUP_MENUS "Use popup windows for context menus (if OFF, menus are confined inside main window)" ON)[m option (ENABLE_RELATIVE_EMBED "Resources should always be found via relative path" OFF)[m option (ENABLE_RESIZE_DRAW "Force window to redraw during resizing" ${DEFAULT_RESIZE_DRAW})[m option (ENABLE_RESOURCE_EMBED "Embed resources inside the executable" OFF)[m option (ENABLE_WEBP "Use libwebp to decode .webp images (via pkg-config)" ON)[m option (ENABLE_WINDOWPOS_FIX "Set position after showing window (workaround for SDL bug)" OFF)[m [31m-option (ENABLE_X11_SWRENDER "Use software rendering under X11" OFF)[m [32m+[m[32moption (ENABLE_X11_SWRENDER "Use software rendering (X11)" OFF)[m [m include (BuildType.cmake)[m include (res/Embed.cmake)[m [36m@@ -328,10 +330,16 @@[m [mendif ()[m if (ENABLE_KERNING)[m target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_KERNING=1)[m endif ()[m [32m+[m[32mif (ENABLE_MAC_MENUS)[m [32m+[m[32m target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_MAC_MENUS=1)[m [32m+[m[32mendif ()[m if (ENABLE_MPG123 AND MPG123_FOUND)[m target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_MPG123=1)[m target_link_libraries (app PUBLIC PkgConfig::MPG123)[m endif ()[m [32m+[m[32mif (ENABLE_POPUP_MENUS)[m [32m+[m[32m target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_POPUP_MENUS=1)[m [32m+[m[32mendif ()[m if (ENABLE_RESIZE_DRAW)[m target_compile_definitions (app PUBLIC LAGRANGE_ENABLE_RESIZE_DRAW=1)[m endif ()[m [1mdiff --git a/src/defs.h b/src/defs.h[m [1mindex 8b47790a..01bf2b3d 100644[m [1m--- a/src/defs.h[m [1m+++ b/src/defs.h[m [36m@@ -166,7 +166,9 @@[m [miLocalDef int acceptKeyMod_ReturnKeyBehavior(int behavior) {[m [m #if defined (iPlatformAppleDesktop)[m # define iHaveNativeMenus /* main menu */[m [31m-# define iHaveNativeContextMenus[m [32m+[m[32m# if defined (LAGRANGE_ENABLE_MAC_MENUS)[m [32m+[m[32m# define iHaveNativeContextMenus[m [32m+[m[32m# endif[m #endif[m [m /* UI labels that depend on the platform */[m [1mdiff --git a/src/ui/util.c b/src/ui/util.c[m [1mindex c75d7698..2b6ff929 100644[m [1m--- a/src/ui/util.c[m [1m+++ b/src/ui/util.c[m [36m@@ -975,7 +975,11 @@[m [mvoid unselectAllNativeMenuItems_Widget(iWidget *menu) {[m }[m [m iLocalDef iBool isUsingMenuPopupWindows_(void) {[m [32m+[m[32m#if defined (LAGRANGE_ENABLE_POPUP_MENUS)[m return deviceType_App() == desktop_AppDeviceType;[m [32m+[m[32m#else[m [32m+[m[32m return iFalse;[m [32m+[m[32m#endif[m }[m [m void releaseNativeMenu_Widget(iWidget *d) {[m [36m@@ -1019,7 +1023,7 @@[m [mvoid openMenuFlags_Widget(iWidget *d, iInt2 windowCoord, iBool postCommands) {[m removeChild_Widget(parent_Widget(d), d); /* we'll borrow the widget for a while */[m const float pixelRatio = get_Window()->pixelRatio;[m iInt2 menuPos = add_I2(get_MainWindow()->place.normalRect.pos,[m [31m- divf_I2(windowCoord, pixelRatio));[m [32m+[m[32m divf_I2(sub_I2(windowCoord, divi_I2(gap2_UI, 2)), pixelRatio));[m arrange_Widget(d);[m /* Check display bounds. */ {[m const iInt2 menuSize = divf_I2(d->rect.size, pixelRatio);[m [1mdiff --git a/src/ui/window.c b/src/ui/window.c[m [1mindex 3f8faaea..8197afd4 100644[m [1m--- a/src/ui/window.c[m [1m+++ b/src/ui/window.c[m [36m@@ -913,7 +913,7 @@[m [miBool processEvent_Window(iWindow *d, const SDL_Event *ev) {[m }[m default: {[m SDL_Event event = *ev;[m [31m- if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.unfreeze")) {[m [32m+[m[32m if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.unfreeze") && mw) {[m mw->isDrawFrozen = iFalse;[m if (SDL_GetWindowFlags(d->win) & SDL_WINDOW_HIDDEN) {[m SDL_ShowWindow(d->win);[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).