summaryrefslogtreecommitdiff
path: root/lib/wx
Commit message (Collapse)AuthorAgeFilesLines
* Prepare releaseErlang/OTP2023-05-153-2/+25
|
* Update copyright yearErlang/OTP2023-05-151-1/+1
|
* Merge branch 'dgud/wx/win32-debug-info'Dan Gudmundsson2023-05-081-1/+5
|\ | | | | | | | | * dgud/wx/win32-debug-info: Add win32 debug info to installer
| * Add win32 debug info to installerDan Gudmundsson2023-04-261-1/+5
| | | | | | | | So the released wx can be debugged
* | Merge branch 'maint' into masterJakub Witczak2023-04-2719-18/+34
|\ \ | |/ |/| | | | | | | | | * maint: Updated OTP version Prepare release Update copyright year
| * Prepare releaseErlang/OTP2023-04-252-1/+17
| |
| * Update copyright yearErlang/OTP2023-04-2517-17/+17
| |
* | Merge branch 'maint'Dan Gudmundsson2023-04-2531-2625/+2911
|\ \ | |/ | | | | | | | | | | | | | | | | * maint: wx: Use temp env for send_msg gl: Fix glDebugMessage functionality Fix tests Fix wx-3.2 macros and OpenGL support wx: Add debug printouts for OpenGL wx: Improve debug printouts
| * wx: Use temp env for send_msgDan Gudmundsson2023-04-241-0/+3
| | | | | | | | | | | | | | | | | | send_msg can be called via (gtk debug msgs) callback when the env is already in use. Noticed with a assert in debug compiled erl. Solve by using a temporary "env" when sending msgs.
| * gl: Fix glDebugMessage functionalityDan Gudmundsson2023-04-248-64/+117
| | | | | | | | | | gl:getDebugMessageLog returned one list instead of several, and gl:debugMessageInsert had an unused lenght parameter.
| * Fix testsDan Gudmundsson2023-04-241-4/+7
| | | | | | | | | | Clipboard test hangs on windows, when we run the tests from remote without gui open.
| * Fix wx-3.2 macros and OpenGL supportDan Gudmundsson2023-04-2414-2542/+2703
| | | | | | | | | | | | Some changed macros in 3.2. Also add support function for OpenGL contexts.
| * wx: Add debug printouts for OpenGLDan Gudmundsson2023-04-028-27/+71
| |
| * wx: Improve debug printoutsDan Gudmundsson2023-03-143-9/+31
| | | | | | | | Remove printouts of large binaries.
* | Revert "Prepare release"Henrik Nord2023-04-123-25/+2
| | | | | | | | This reverts commit d4e4511b19f4126d9271a6e3a8fa2eb716da7e85.
* | Prepare releaseErlang/OTP2023-04-113-2/+25
| |
* | Update copyright yearErlang/OTP2023-04-111-1/+1
| |
* | Remove --enable-sanitizers configure optionSverker Eriksson2023-03-292-47/+0
| | | | | | | | | | | | Motivation: An untested broken feature. Can easily be enabled by setting CFLAGS and LDFLAGS.
* | Revert "Prepare release"Henrik Nord2023-03-223-25/+2
| | | | | | | | This reverts commit 1cf126f91eb533783409da95b117207d8c13d9aa.
* | Prepare releaseErlang/OTP2023-03-213-2/+25
| |
* | Update copyright yearErlang/OTP2023-03-212-2/+2
| |
* | Use `proc_lib:init_fail/2,3` where appropriateRaimo Niskanen2023-02-272-13/+6
| |
* | Revert "Prepare release"Henrik Nord2023-02-152-15/+1
| | | | | | | | This reverts commit 587341d994f91af5b30483ee9434e932e3d7b802.
* | Prepare releaseErlang/OTP2023-02-142-1/+15
| |
* | Merge branch 'maint' into masterHenrik Nord2022-12-143-2/+19
|\ \ | |/ | | | | | | | | | | * maint: Updated OTP version Prepare release Update copyright year
| * Prepare releaseErlang/OTP2022-12-122-1/+18
| |
| * Update copyright yearErlang/OTP2022-12-121-1/+1
| |
* | Merge branch 'maint'Dan Gudmundsson2022-11-171-2/+2
|\ \ | |/
| * Merge pull request #6310 from tcrossland/wx/gl-build-fixDan Gudmundsson2022-11-171-2/+2
| |\ | | | | | | wx: fix build issue when GL/glu.h is not present
| | * Fix wx build issue when GL/glu.h is not presentTom Crossland2022-09-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the build of wx fails if GL/gl.h is present but GL/glu.h is not. This may happen, for example, in macOS if the homebrew mesa package is installed. This change ensures that both GL/gl.h and GL/glu.h are present before including them.
* | | otp: Refactor second and third bootstrapLukas Larsson2022-10-182-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | We move all the logic around bootstraps to the top Makefile.in instead of sharing it with lib/Makefile. Now there is a single place that lists which applications are part of which bootstrap and which need to be built or not built.
* | | Merge branch 'maint'Dan Gudmundsson2022-09-291-7/+9
|\ \ \ | |/ /
| * | wx: Add `WX_MACOS_NON_GUI_APP`Wojtek Mach2022-07-191-7/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot depend on `is_packaged_app()` check because it is not a perfect way of checking if app is bundled. It would return true when the app is bundled with a launcher like this: ```swift import AppKit let task = Process() task.launchPath = "/Users/wojtek/src/otp/bin/erl" task.arguments = ["-noshell", "-eval", "wx:new(), timer:sleep(5000), halt()"] try task.run() task.waitUntilExit() ``` It would return false for this launcher, however: ```swift import AppKit class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { let task = Process() task.launchPath = "/Users/wojtek/src/otp/bin/erl" task.arguments = ["-noshell", "-eval", "wx:new(), timer:sleep(5000), halt()"] try! task.run() } } let app = NSApplication.shared let delegate = AppDelegate() app.delegate = delegate app.run() ``` Btw, there has recently been a fix in wx [1] and we'd only be able to take advantage of it when `OSXIsGUIApplication` returns true (and when wx recognizes our app as properly bundled, see [2]). And so I believe to support variety of scenarios, we need precise control. [1] https://github.com/wxWidgets/wxWidgets #22508 [2] https://github.com/erlang/otp #6070
* | otp: Fix some windows gitignoresLukas Larsson2022-09-271-0/+1
|/
* Prepare releaseErlang/OTP2022-05-172-1/+33
|
* Update copyright yearErlang/OTP2022-05-171-1/+1
|
* Merge branch 'maint' into masterLukas Larsson2022-05-033-2/+30
|\ | | | | | | | | | | | | * maint: Updated OTP version Prepare release Update copyright year
| * Prepare releaseErlang/OTP2022-05-022-1/+29
| |
| * Update copyright yearErlang/OTP2022-05-022-2/+2
| |
| * Merge branch 'dgud/wx/compile-wxWidgets-316/GH-5893/OTP-18064' into maint-24Erlang/OTP2022-05-021-2/+2
| |\ | | | | | | | | | | | | * dgud/wx/compile-wxWidgets-316/GH-5893/OTP-18064: wx: Fix build problems with wxWidgets-3.1.6
* | \ Merge pull request #5909 from wojtekmach/wm-doc-subscribe-eventsDan Gudmundsson2022-04-271-1/+42
|\ \ \ | | | | | | | | wx: Document `wx:subscribe_events/0`
| * | | wx: Document `wx:subscribe_events/0`Wojtek Mach2022-04-191-1/+42
| | | |
* | | | Merge pull request #5906 from wojtekmach/wm-wx-mac-backgroundDan Gudmundsson2022-04-273-0/+15
|\ \ \ \ | | | | | | | | | | wx: Overload `OSXIsGUIApplication` with our own check
| * | | | wx: Overload `OSXIsGUIApplication` with our own checkWojtek Mach2022-04-193-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some macOS apps only run in the background and thus have no GUI. Some apps only live in the "menu bar" (top-right corner) and thus don't have the traditional GUI either. In both cases, we don't want the application to show up in the Dock (and thus show up when switching apps with cmd+tab, etc) A standard way to do this to set `LSUIElement` to `true`. See: https://developer.apple.com/documentation/bundleresources/information_property_list/lsuielement) Here's an example script that builds such app: #!/bin/sh set -eo pipefail cat <<EOF > app1.swift import Cocoa _ = NSApplication.shared let window = NSWindow( contentRect: NSMakeRect(800, 600, 320, 200), styleMask: [.titled, .closable], backing: .buffered, defer: true ) window.orderFrontRegardless() window.title = "Example" let menuItemOne = NSMenuItem() menuItemOne.submenu = NSMenu() menuItemOne.submenu?.items = [ NSMenuItem(title: "Quit", action: #selector(NSApplication.terminate(_:)), keyEquivalent: "q") ] let menu = NSMenu() menu.items = [menuItemOne] NSApp.mainMenu = menu NSApp.activate(ignoringOtherApps: true) NSApp.run() EOF echo app1: building mkdir -p app1.app/Contents/MacOS swiftc app1.swift -o app1.app/Contents/MacOS/app1 echo app1: setting LSUIElement cat <<EOF > app1.app/Contents/Info.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>LSUIElement</key> <true/> </dict> </plist> EOF Besides the `LSUIElemet` property, there's also a programatic way of setting this behaviour. If that is used, the property seems to be ignored. In our example app, if we make this code change: + NSApp.setActivationPolicy(.regular) NSApp.run() Then our app will show up in the Dock if though we set `LSUIElement`. I tried using the `LSUIElement` property with wxErlang. Here's an example script: echo app2: building mkdir -p app2.app/Contents/MacOS cat <<EOF > app2.app/Contents/MacOS/app2 #!/bin/sh set -eo pipefail export PATH="$(dirname $(which erl)):\$PATH" export WX_MACOS_NON_GUI_APP=true erl -noshell -eval 'WX=wx:new(), F=wxFrame:new(WX,-1,"Hello"), wxFrame:show(F), MB=wxMenuBar:new(), wxFrame:setMenuBar(F, MB), wxFrame:connect(F, command_menu_selected, [{skip,true}]), wxFrame:connect(F, close_window, [{skip,true}]), receive Evt -> io:format("~p~n", [Evt]), halt() end. ' EOF chmod +x app2.app/Contents/MacOS/app2 echo app2: setting LSUIElement cat <<EOF > app2.app/Contents/Info.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>LSUIElement</key> <true/> </dict> </plist> EOF When running it, the app shows up in the Dock. I determined that wxWidgets sets the activation policy to regular here: if ( !wxApp::sm_isEmbedded && wxTheApp && wxTheApp->OSXIsGUIApplication() ) { CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle() ) ; CFStringRef path = CFURLCopyFileSystemPath ( url , kCFURLPOSIXPathStyle ) ; CFRelease( url ) ; wxString app = wxCFStringRef(path).AsString(wxLocale::GetSystemEncoding()); if ( !app.EndsWith(".app") ) { [NSApp setActivationPolicy: NSApplicationActivationPolicyRegular]; [NSApp activateIgnoringOtherApps: YES]; } } https://github.com/wxWidgets/wxWidgets/blob/v3.1.5/src/osx/cocoa/utils.mm#L90 Now, there are two conditions that gate this behaviour. The first one is the one I'm overwriting, the call to `wxTheApp->OSXIsGUIApplication()` method. The second one is checking if the application is bundled. When running wxErlang, that code is always executed even if the application is in fact bundled. I copied this checking code to `wxe_impl.cpp`: --- a/lib/wx/c_src/wxe_impl.cpp +++ b/lib/wx/c_src/wxe_impl.cpp @@ -20,6 +20,7 @@ #include <stdio.h> #include <signal.h> +#include <CoreServices/CoreServices.h> #include <wx/wx.h> @@ -180,6 +181,12 @@ bool WxeApp::OnInit() wxInitAllImageHandlers(); #ifdef _MACOSX + CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); + CFStringRef path = CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle); + CFRelease(url); + wxString app = wxCFStringRef(path).AsString(wxLocale::GetSystemEncoding()); + wxLogInfo(app); And on my system the following was logged: `/Users/wojtek/src/otp/bin/aarch64-apple-darwin21.4.0`. For this reason I've added an implementation of the first check, `wxTheApp->OSXIsGUIApplication()` which uses wxErlang's way of detecting if we are in a bundle.
* | | | | Merge branch 'maint'Dan Gudmundsson2022-04-251-1/+1
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | * maint: wx: Fix build problems with wxWidgets-3.1.6
| * | | | Merge branch 'dgud/wx/compile-wxWidgets-316/GH-5893/OTP-18064' into maintDan Gudmundsson2022-04-251-2/+2
| |\ \ \ \ | | |_|/ / | |/| | / | | | |/ | | |/| * dgud/wx/compile-wxWidgets-316/GH-5893/OTP-18064: wx: Fix build problems with wxWidgets-3.1.6
| | * | wx: Fix build problems with wxWidgets-3.1.6Dan Gudmundsson2022-04-201-2/+2
| | | | | | | | | | | | | | | | | | | | Update pushed to wx_api_branch on git@github.com:erlang/wxWidgets.git and code re-generated.
* | | | Merge branch 'maint'Dan Gudmundsson2022-04-192-6/+0
|\ \ \ \ | |/ / /
| * | | wx: Remove windows.h header from configureDan Gudmundsson2022-04-192-6/+0
| | | | | | | | | | | | | | | | Missed one place
* | | | Merge branch 'maint'Dan Gudmundsson2022-04-143-89/+2
|\ \ \ \ | |/ / / | | | | | | | | | | | | * maint: wx: Fix configure on win32 with newer wxWidgets