5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-09 23:41:09 +08:00
Commit Graph

1412 Commits

Author SHA1 Message Date
Lea Anthony
7b656c49c2
Add -s support for wails dev (#1632)
* Add -s support for wails dev

* Ignore frontend if external dev server used.
2022-07-24 19:19:48 +10:00
Lea Anthony
ae756a8409
Use scaling when setting min/max window (#1557)
* Use scaling when setting min/max window

* Fix compile issue. Add debug

* Fix scaling issue
2022-07-23 17:15:22 +10:00
Lea Anthony
5a3d45b535
Override platform with GOOS and GOARCH (#1618)
* Override platform with GOOS and GOARCH

* Update v2/cmd/wails/internal/commands/build/build.go

Co-authored-by: stffabi <stffabi@users.noreply.github.com>

* Only use GOOS and GOARCH env vars for default target

* Update docs. Add dryrun flag for testing

* Update v2/cmd/wails/internal/commands/build/build.go

Co-authored-by: stffabi <stffabi@users.noreply.github.com>

* Fix scenario where no arch specified

* Fixed banner

Co-authored-by: stffabi <stffabi@users.noreply.github.com>
2022-07-21 21:25:57 +10:00
Lea Anthony
29912785fa
Add Show() and Hide() to runtime to show/hide application (#1599)
* Add Show() and Hide() to runtime to show/hide application

* Fix devserver

* Update API docs
2022-07-20 20:59:49 +10:00
Lea Anthony
b21a92ecdb
Install dev dependencies before starting dev mode (#1615) 2022-07-20 20:52:35 +10:00
stffabi
1f62b5773d
[v2] Fix plain template (#1609)
* [template] Add missing main.go file to plain template

* [dev] If wails could not be find in go.mod output a gracefull error message
2022-07-20 08:45:48 +10:00
Lea Anthony
848eee5a7c
v2.0.0-beta.39.2 2022-07-20 07:23:25 +10:00
Lea Anthony
461d0c4448
Add compatibility for Go1.17 (#1605) 2022-07-20 07:10:05 +10:00
Lea Anthony
f7976a5c85
v2.0.0-beta.39 2022-07-19 20:58:11 +10:00
stffabi
1247c8aa28
[windows] Fix stack corruption when using ICoreWebView2HttpHeadersCollectionIterator (#1589)
The API expects a `BOOL *` with `typedef int BOOL` therefore
we need to use a `int32` on the stack.
2022-07-18 18:57:30 +10:00
Lea Anthony
af1c530442
Remove usage of unsafe.Pointer in winc (#1556)
* Remove usage of unsafe.Pointer

* [windows] Remove MakeIntResource and add overloads for Load functions

* Fix `EnumProc` race condition.

* Refactor `EnumDisplayMonitors` to use `unsafe.Pointer` instead of `uintptr`

Co-authored-by: stffabi <stffabi@users.noreply.github.com>
2022-07-18 18:22:46 +10:00
Lea Anthony
f46e825d24
Add pre-build hooks. Print command output when verbosity flag set. (#1578)
* Add pre-build hooks. Print command output when verbosity flag set.

* Refactor build hooks
2022-07-17 22:08:55 +10:00
Lea Anthony
ee988dfb9e
Update runtime 2022-07-16 12:37:56 +10:00
skamensky
04d35410de
Expose screen dimensions (#1519)
* get dimensions working for linux

* Cleaning up some GTK code

I was getting the following errors due to some bad casts.

Gdk-CRITICAL **: 18:58:51.943: gdk_monitor_get_geometry: assertion 'GDK_IS_MONITOR (monitor)' failed
Gdk-CRITICAL **: 18:58:51.943: gdk_display_get_monitor_at_window: assertion 'GDK_IS_DISPLAY (display)' failed

This commit fixes these errors

* Adding Screen namespace along with linux implementation

* moving ScreenGetAll into a more appropriate place

* Fixing typescript definition mistake, documentation, ordering of functions, and formatting

* add ScreenGetAll to more templates

* moving screen into its own javascript file

* fixing bug where screen objects are not returned from the runtime function

* rebuilding frontend wrapper package

* adding windows implementation of ScreenGetAll

* adding screen get all implementation for darwin

* reverting a change that is unrelated to the work on expose-dimensions

* removing duplicate comparison

* changing GetNthScreen in screen API on macos

To use frame instead of visibleframe to keep into account the space the the dock takes up
We want to include that space in the calculation in order to keep the sizes of screens consistent across platforms

* Correcting screen jsdoc

It used to say it returned a single screen object. Now it says that it returns an array of screen objects

* Fixing typo in function name

* reverting pointless spacing change

* reverting pointless spacing change

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: shmuel.kamensky <shmuel.kamensky@shutterfly.com>
2022-07-16 12:33:37 +10:00
dependabot[bot]
60e4127b24
Bump svelte from 3.42.5 to 3.49.0 in /v2/internal/frontend/runtime (#1573)
Bumps [svelte](https://github.com/sveltejs/svelte) from 3.42.5 to 3.49.0.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/compare/v3.42.5...v3.49.0)

---
updated-dependencies:
- dependency-name: svelte
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-16 03:58:15 +10:00
dependabot[bot]
db7f24ff93
Bump svelte from 3.42.2 to 3.49.0 in /v2/internal/frontend/runtime/dev (#1572)
Bumps [svelte](https://github.com/sveltejs/svelte) from 3.42.2 to 3.49.0.
- [Release notes](https://github.com/sveltejs/svelte/releases)
- [Changelog](https://github.com/sveltejs/svelte/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sveltejs/svelte/compare/v3.42.2...v3.49.0)

---
updated-dependencies:
- dependency-name: svelte
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-16 03:58:05 +10:00
Lea Anthony
12e6445a30
Fix loglevel for wails build -debug 2022-07-14 22:40:27 +10:00
Lea Anthony
5987f17cca
Check for line length when scanning for local devserver url (#1566) 2022-07-14 22:22:26 +10:00
Lea Anthony
f068c33dcf
Add support for production log levels (#1555) 2022-07-14 21:45:13 +10:00
Lea Anthony
69016c6c6f
Fix OnBeforeClose code for Mac (#1558)
* Fix OnBeforeClose code for Mac

* Fix OnBeforeClose for linux
2022-07-14 21:04:45 +10:00
Ian M. Jones
82cc5498f1
Add nixpkgs support to doctor command. (#1551)
* Dependancy => Dependency typo fix.

* Add Nixpkgs support to doctor command.

* Add mention of nixpkgs to linux distro support doc.
2022-07-13 07:29:41 +10:00
Lea Anthony
1dec40db33
Feature/auto devserver port (#1547)
* Support "auto" devserverurl
2022-07-12 21:41:41 +10:00
Ian M. Jones
095ef5ab64
Fix checking for installed apt package in none English session. (#1548) 2022-07-12 07:07:01 +10:00
Lea Anthony
1cbc34eff8
Fixes #1546 2022-07-11 20:56:05 +10:00
Lea Anthony
d4662bd797
Support Maps in TS conversion (#1435) 2022-07-10 20:54:49 +10:00
Lea Anthony
55ec688331
Add helloworld tutorial 2022-07-10 15:07:42 +10:00
Lea Anthony
7a63464997
Update vscode template (#1398) 2022-07-08 20:33:49 +10:00
Lea Anthony
bf2d83d939
Change: Order of generated bindings now consistent
Closes #1531
2022-07-08 20:18:31 +10:00
Lea Anthony
1cd31573a9
change: improve cli output for wails update
closes #1528
2022-07-08 19:53:13 +10:00
Lea Anthony
39cebffa87
Fix: use correct json value for buildtype 2022-07-08 10:58:38 +10:00
Ian M. Jones
f4b4e4cdb8
Allow -appargs flag to pass flags to binary. (#1534) 2022-07-06 19:25:28 +10:00
Lea Anthony
4726b72708
feature: Add -windowsconsole flag 2022-07-04 22:52:50 +10:00
Lea Anthony
cd35536a79
[linux] Fix SetBackgroundColour 2022-07-04 22:29:51 +10:00
stffabi
41d1bf3d10
[v2] Improvements to the dev command (#1510)
* [v2, darwin] Fix nullreference exception when dev watcher failed to start and the user stopped wails dev with ctrl-c

* [v2] Improve starting of dev watcher command

Wails dev now also fails if the dev watcher could not be started. Since
the dev watcher is used to start e.g. vite to serve the frontend, it does
not make much sense to let Wails dev be running if the dev
watcher failed to start.

* [v2] Improve killing and cleanup of debug binary

- Make sure to kill the debug process in all cases even if an error occured.
- Make sure to kill the last started binary process
2022-06-30 20:13:06 +10:00
Lea Anthony
3e42d2da05
Rename WindowSetRGBA -> WindowSetBackgroundColour (#1506)
* Rename WindowSetRGBA -> WindowSetBackgroundColour

* Fix Typos
2022-06-29 22:31:49 +10:00
Lea Anthony
7141c972fd
Move WindowGet* to main thread (#1464) 2022-06-29 20:07:16 +10:00
NYSSEN Michaël
b2cec41fbf
Fix lit-ts template (#1494)
* Fix lit-ts template

* Fixing generate Template

* Remove bad null check

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-06-27 20:56:18 +10:00
Lea Anthony
66f79c2e51
v2.0.0-beta.38 + release script 2022-06-27 20:41:09 +10:00
Lea Anthony
f8e6fa4bf3
Regenerate templates 2022-06-27 18:09:25 +10:00
Tom
d9888ce6af
Chore/react 18 create root (#1489)
* chore: use createRoot for react-ts

* chore: use createRoot for react-js

* fix: quotes

* fix: remove semi

* chore: update react templates to use createRoot instead of ReactDOM.render

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-06-27 18:00:04 +10:00
Lea Anthony
0531645377
Better signal handling (#1488)
* Better signal handling

* Remove waitgroup
2022-06-25 09:26:17 +10:00
Nan0
2065600096
Feature: set browser path (#1448)
* Added option to specify webview2 path

* Added `manual` webview strategy

* Update documentation

* Fixed build with manual tag

* Check for browser directory existence

* Added version check for manually specified webview, removed fallback for installed webview in manual strategy

* Update WebviewBrowserPath documentation

* Replaced deprecated StringToUTF16Ptr

* Return on error

* Removed manual strategy, return error in wv2installer for fixed runtime

* Removed manual strategy from CLI
2022-06-25 07:49:00 +10:00
stffabi
c61ce1e2de
[v2, windows] Make SetBackgroundColour compatible for windows/386 (#1493)
* [v2, windows] Remove duplicate SetBackgroundColour

* [v2, windows] Make SetBackgroundColour compatible for windows/386
2022-06-25 06:46:23 +10:00
Lea Anthony
16581ceff9
Regenerate templates to use BackgroundColour 2022-06-23 20:30:18 +10:00
Lea Anthony
e504d1124a
Fix AlwaysOnTop code for Mac 2022-06-22 21:36:57 +10:00
dependabot[bot]
91afa396ba
Bump shell-quote from 1.7.2 to 1.7.3 in /v2/internal/frontend/runtime (#1485)
Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/substack/node-shell-quote/releases)
- [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md)
- [Commits](https://github.com/substack/node-shell-quote/compare/v1.7.2...1.7.3)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-22 20:56:16 +10:00
dependabot[bot]
08eee061ab
Bump shell-quote in /v2/internal/frontend/runtime/dev (#1486)
Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/substack/node-shell-quote/releases)
- [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md)
- [Commits](https://github.com/substack/node-shell-quote/compare/v1.7.2...1.7.3)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-22 20:56:01 +10:00
chenxiao
072929689c
feature: add runtime func WindowSetAlwaysOnTop (#1442)
* feature: add runtime func WindowSetAlwaysOnTop

* add runtime WindowSetUnalwaysOnTop

* add  JavaScript runtime method  ,  docs update

* WindowSetAlwaysOnTop(b bool)

* Add AlwaysOnTop for MacOS

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-06-22 20:55:02 +10:00
stffabi
72d019cb48
[v2, windows] Pass the correct installationStatus to the webview installation strategy (#1483)
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-06-22 20:50:45 +10:00
stffabi
4493a05fb9
[v2] AssetsHandler remove retry logic in dev mode (#1479) 2022-06-22 20:06:20 +10:00
Lea Anthony
f8eac34212
Bugfix: Don't stop if unable to remove temporary bindings build (#1465) 2022-06-22 08:40:30 +10:00
Lea Anthony
1687906376
Improve theme change at runtime (#1473)
* Improve theme change at runtime

* Handle change to dark mode

* Refactor theme calculation

* Ensure theme is updated for WM_ACTIVATE and WM_SETTINGCHANGE events
2022-06-22 08:34:41 +10:00
Lea Anthony
381909696b
[Windows] Add Suspend/Resume callback support (#1474)
* Add Suspend/Resume callback support

* Fix comment
2022-06-22 06:37:18 +10:00
Lea Anthony
c477100374
Add BackgroundColour and deprecate RGBA (#1475) 2022-06-21 19:47:05 +10:00
Lea Anthony
cb169611b1
Set Window Background colour if provided + debounce redraw option (#1466)
* Set Window Background colour if provided. Added debounce option for Webview2 redraw on resize

* [windows] Workaround resize flickering in frameless mode

Co-authored-by: stffabi <stffabi@users.noreply.github.com>
2022-06-20 17:47:13 +10:00
Lea Anthony
a7f1ea21ef Bugfix: Better support for showing window 2022-06-19 13:32:48 +10:00
Lea Anthony
e4f2bfe699 Bugfix: Windows start maximised
Fixes #1462
2022-06-18 16:21:32 +10:00
Abtin
9a01c757bd
Fix apt command syntax (#1458) (#1461) 2022-06-18 09:26:22 +10:00
stffabi
884773a218
[v2, windows] Fix WebView2 minimum runtime version check (#1456)
* [v2, windows] CompareBrowserVersions needs a int32 pointer

Otherwise 4294967295 will be returned instead of -1 and the
minimum version check can't detect an older version.
So an older version than the minimum might be used and will
result in AccessViolationExceptions.

* [v2, windows] Use the correct minimum runtime version for SDK 1.0.992.28

The Webview2Loader.dll are already at version 1.0.992.28 for all platforms.
2022-06-16 18:43:19 +10:00
stffabi
664f6a952c
[v2, windows] Unlock OSThread after native calls have been finished (#1441)
* [v2, windows] Remove unnecessary LockOSThread

Form.Invoke makes sure the call is on the correct thread and does
lock the OSThread during the call.

* [v2, windows] Unlock OSThread after native calls have been finished

This makes sure the OSThread can be reused by other go
routines after a native call has been finished. Otherwise the
OSThread will be destroyed as soon as the goroutine has
finished.
2022-06-08 20:56:07 +10:00
Lea Anthony
fe341741b5
Always use return in wrapped method (#1410) 2022-06-06 00:41:44 -10:00
Lea Anthony
6a07cbd505 Move go-common-file-dialog into project. Fix Title bug. 2022-06-01 21:00:52 +10:00
stffabi
614f50d5d3
[v2, windows] Load WebView2 loader from embedded only (#1432) 2022-05-31 10:00:02 -10:00
Jae-Sung Lee
f292e221f1
Create gitignore when using g option (#1430)
* Create gitignore when using g option
2022-05-31 20:29:20 +10:00
stffabi
2a0673f99f
[v2, linux] Improve switching to main thread for callbacks (#1392)
Make sure no pointers to the stack are passed to g_idle_add,
because at the time the callback gets executed on the
main thread, the pointer might be invalid.
Go might have reused the stack or grown the stack and the
pointer is invalid.

The concept used on Windows has been ported to Linux.
2022-05-31 20:28:37 +10:00
Zámbó, Levente
794a8ce19f
feature - support linux/arm (#1427) 2022-05-27 19:09:50 -10:00
Zámbó, Levente
f6425a64a6
feature - add race detector to build & dev (#1426) 2022-05-27 19:07:39 -10:00
Lea Anthony
6a88568f0a
v2.0.0-beta.37 2022-05-26 17:45:57 -10:00
Edward Browncross
a10a9e5b36
Add missing className to input in React and Preact templates (#1419)
* add missing className to input in react and preact templates

* add missing className to input in react and preact assets
2022-05-26 02:56:37 +10:00
yuzu
316a24f6da
update runtime.d.ts & templates (#1421) 2022-05-24 21:20:53 +02:00
mondy
d4ecaad0e1 Add nogen flag in wails dev command 2022-05-21 14:22:18 +09:00
Lea Anthony
953bc09343
Merge pull request #1400 from wailsapp/feature/native-translucency
Initial support for new native translucency in Windows Preview
2022-05-18 18:52:45 +10:00
stffabi
c97e1c50af
[v2, linux] Make sure to execute the menu callbacks on a new goroutine (#1403)
* Make sure to execute the menu callbacks on a new goroutine
* Fix assertion message when opening file dialogs by passing the correct parent window
2022-05-17 20:45:48 +10:00
Travis McLane
b84fd76e86 bugfix: correct typo 2022-05-10 21:56:19 -05:00
Lea Anthony
55115742c1 fix: TS conversion of interface{} 2022-05-11 08:21:17 +10:00
Jack Bizzell
d59bec171e Changing all occurrences of calls to OnMultiple() inside EventsOn() and EventsOnce() in the frontend definitions, to calls to EventsOnMultiple()
OnMultiple is undefined
2022-05-09 20:42:40 +01:00
stffabi
5f612301f9
[v2] During wails dev only use reload logic if no AssetsHandler are in use (#1385)
This slows down every GET request to the AssetsHandler taking 5s
2022-05-07 09:11:07 +10:00
Lea Anthony
84b6273baf
Bugfix/incorrect bindings (#1383)
* Print struct path

* Better handling of anon structs
2022-05-05 23:07:33 +10:00
Lea Anthony
6224d3aa82 Re-add plain template, Improve stalebot. 2022-05-05 06:53:39 +10:00
stffabi
2d66d2146a
[v2] Improve multi platform builds (#1373)
- Make sure to reset the default Arch of the build options and not keep the previous one.
- Expand to the full platform in outputBinaries so e.g. `-platform windows` can be used with `-nsis`
2022-05-04 07:27:13 +10:00
Aleksey Polyakov
531d7cfb62
replace OnMultiple with EventsOnMultiple (#1369) 2022-05-02 22:10:33 +10:00
Lea Anthony
9c7ef2d47c
v2.0.0-beta.36 2022-05-01 11:10:05 +10:00
Lea Anthony
490388ae8f
Another vue fix 2022-05-01 10:47:09 +10:00
Lea Anthony
fac2a8ba3c
Closes #1357 #1366 2022-05-01 10:41:07 +10:00
Lea Anthony
912d7cf34b
Add startup method to templates by default 2022-05-01 10:19:15 +10:00
stffabi
22d3f93b52
[v2, darwin] Initialize native variables on stack to prevent segfault (#1362) 2022-04-30 06:11:19 +10:00
stffabi
d9120181b7
[v2] Validate devServer property to be of the correct form (#1359) 2022-04-29 07:22:45 +10:00
Lea Anthony
ac81d5aa3d v2.0.0-beta.35 2022-04-27 22:01:32 +10:00
Lea Anthony
41f9c07c88 Fixes #1343 2022-04-27 21:29:54 +10:00
Lea Anthony
a8357a2459 Update templates 2022-04-27 20:53:59 +10:00
Lea Anthony
bd344bf32c Update runtime.d.ts + regenerate templates 2022-04-27 20:53:24 +10:00
Lea Anthony
ded28cf9c2 Remove redundant dev .js files 2022-04-27 19:26:42 +10:00
Lea Anthony
e7aa74905a
Initial commit (#1352) 2022-04-27 19:10:20 +10:00
Lea Anthony
781a0df72e
Fix for TS/JS generation on methods with no returns (#1356) 2022-04-27 19:09:55 +10:00
stffabi
524411964f
[v2] WindowReloadApp should use the startURL of the frontend to support reloading when a frontend dev server is used (#1347) 2022-04-23 07:09:53 +10:00
Lea Anthony
7f3f56663f
Fix: wails dev 2022-04-21 07:40:56 +10:00
Lea Anthony
f6257d3d31 Add Environment and WindowReloadApp calls to runtime. Updated default templates. 2022-04-20 20:28:41 +10:00
Lea Anthony
2e3c90c096 Update runtime.d.ts documentation. Regenerate templates 2022-04-19 21:48:26 +10:00
Lea Anthony
4e9eda8e1f Fix bug in WindowSet*Theme 2022-04-19 17:44:40 +10:00
Lea Anthony
02fcf738d3 Update runtime wrapper. Update base templates. 2022-04-19 17:43:55 +10:00