5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 07:10:40 +08:00
Commit Graph

340 Commits

Author SHA1 Message Date
Lea Anthony
baff28bb20
Bugfix/linux warnings (#1656)
* Use scaling when setting min/max window

* Fix compile issue. Add debug

* Fix scaling issue

* Fix window widget warnings & shutdown issue. Remove debug lines for linux

* Update dev build with shutdown fix
2022-08-03 21:17:38 +10:00
Lea Anthony
224f7c0c56
Move SetMin/Max calls to main thread (#1684)
* Move SetMin/MAx calls to main thread

* Move setsize back to original location

* Remove debug
2022-08-02 06:51:20 +10:00
stffabi
3d24a9b4c4
[v2, darwin] Assign a unique requestId to every WKWebView request (#1681)
This makes sure we always use the correct WKURLSchemeTask during
processURLResponse. Only using the URL is not unique enough and
might result in pending requests if two requests with the same URL
are getting processed.
2022-08-01 18:55:25 +10:00
stffabi
53e875d96f
[v2, darwin] Make sure to copy the uri during processURLRequest (#1668)
There's no guarantee that the pointer is still valid when
processURLRequest is finished. So we might end up with an
invalid pointer when the request is asynchronously processed.
2022-07-28 08:56:11 +02:00
Lea Anthony
a229e04e3e
Windows dialogs - Handle scenario when window is not visible yet. (#1662)
* Handle scenario when window is not visible yet.

* Handle scenario when window is not visible yet for all dialogs
2022-07-27 19:38:56 +10:00
stffabi
229d36207c
[v2] Fix formatting of some error messages (#1665) 2022-07-27 19:20:30 +10:00
Lea Anthony
8e21061e78
Remove debug info for linux 2022-07-26 08:29:00 +10:00
Lea Anthony
0f7bd65815
Update Svelte to Vite 3 (#1643)
Updates to svelte template.
Refactor url detector to strip ANSI codes at point of source
Ignore frontend if external dev server used.
[AssetServer] WebSockets can always directly be forwarded to the handler

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

Co-authored-by: stffabi <stffabi@users.noreply.github.com>
2022-07-24 20:20:02 +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
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
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
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
69016c6c6f
Fix OnBeforeClose code for Mac (#1558)
* Fix OnBeforeClose code for Mac

* Fix OnBeforeClose for linux
2022-07-14 21:04:45 +10:00
Lea Anthony
cd35536a79
[linux] Fix SetBackgroundColour 2022-07-04 22:29:51 +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
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
4493a05fb9
[v2] AssetsHandler remove retry logic in dev mode (#1479) 2022-06-22 20:06:20 +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
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
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
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
yuzu
316a24f6da
update runtime.d.ts & templates (#1421) 2022-05-24 21:20:53 +02: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
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
Aleksey Polyakov
531d7cfb62
replace OnMultiple with EventsOnMultiple (#1369) 2022-05-02 22:10:33 +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
Lea Anthony
bd344bf32c Update runtime.d.ts + regenerate templates 2022-04-27 20:53:24 +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