diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/defs.h | 4 | ||||
-rw-r--r-- | src/ui/util.c | 6 | ||||
-rw-r--r-- | src/ui/window.c | 2 |
3 files changed, 9 insertions, 3 deletions
@@ -166,7 +166,9 @@ iLocalDef int acceptKeyMod_ReturnKeyBehavior(int behavior) { | |||
166 | 166 | ||
167 | #if defined (iPlatformAppleDesktop) | 167 | #if defined (iPlatformAppleDesktop) |
168 | # define iHaveNativeMenus /* main menu */ | 168 | # define iHaveNativeMenus /* main menu */ |
169 | # define iHaveNativeContextMenus | 169 | # if defined (LAGRANGE_ENABLE_MAC_MENUS) |
170 | # define iHaveNativeContextMenus | ||
171 | # endif | ||
170 | #endif | 172 | #endif |
171 | 173 | ||
172 | /* UI labels that depend on the platform */ | 174 | /* UI labels that depend on the platform */ |
diff --git a/src/ui/util.c b/src/ui/util.c index c75d7698..2b6ff929 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -975,7 +975,11 @@ void unselectAllNativeMenuItems_Widget(iWidget *menu) { | |||
975 | } | 975 | } |
976 | 976 | ||
977 | iLocalDef iBool isUsingMenuPopupWindows_(void) { | 977 | iLocalDef iBool isUsingMenuPopupWindows_(void) { |
978 | #if defined (LAGRANGE_ENABLE_POPUP_MENUS) | ||
978 | return deviceType_App() == desktop_AppDeviceType; | 979 | return deviceType_App() == desktop_AppDeviceType; |
980 | #else | ||
981 | return iFalse; | ||
982 | #endif | ||
979 | } | 983 | } |
980 | 984 | ||
981 | void releaseNativeMenu_Widget(iWidget *d) { | 985 | void releaseNativeMenu_Widget(iWidget *d) { |
@@ -1019,7 +1023,7 @@ void openMenuFlags_Widget(iWidget *d, iInt2 windowCoord, iBool postCommands) { | |||
1019 | removeChild_Widget(parent_Widget(d), d); /* we'll borrow the widget for a while */ | 1023 | removeChild_Widget(parent_Widget(d), d); /* we'll borrow the widget for a while */ |
1020 | const float pixelRatio = get_Window()->pixelRatio; | 1024 | const float pixelRatio = get_Window()->pixelRatio; |
1021 | iInt2 menuPos = add_I2(get_MainWindow()->place.normalRect.pos, | 1025 | iInt2 menuPos = add_I2(get_MainWindow()->place.normalRect.pos, |
1022 | divf_I2(windowCoord, pixelRatio)); | 1026 | divf_I2(sub_I2(windowCoord, divi_I2(gap2_UI, 2)), pixelRatio)); |
1023 | arrange_Widget(d); | 1027 | arrange_Widget(d); |
1024 | /* Check display bounds. */ { | 1028 | /* Check display bounds. */ { |
1025 | const iInt2 menuSize = divf_I2(d->rect.size, pixelRatio); | 1029 | const iInt2 menuSize = divf_I2(d->rect.size, pixelRatio); |
diff --git a/src/ui/window.c b/src/ui/window.c index 3f8faaea..8197afd4 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -913,7 +913,7 @@ iBool processEvent_Window(iWindow *d, const SDL_Event *ev) { | |||
913 | } | 913 | } |
914 | default: { | 914 | default: { |
915 | SDL_Event event = *ev; | 915 | SDL_Event event = *ev; |
916 | if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.unfreeze")) { | 916 | if (event.type == SDL_USEREVENT && isCommand_UserEvent(ev, "window.unfreeze") && mw) { |
917 | mw->isDrawFrozen = iFalse; | 917 | mw->isDrawFrozen = iFalse; |
918 | if (SDL_GetWindowFlags(d->win) & SDL_WINDOW_HIDDEN) { | 918 | if (SDL_GetWindowFlags(d->win) & SDL_WINDOW_HIDDEN) { |
919 | SDL_ShowWindow(d->win); | 919 | SDL_ShowWindow(d->win); |