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

82 Commits

Author SHA1 Message Date
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
Lea Anthony
3e42d2da05
Rename WindowSetRGBA -> WindowSetBackgroundColour (#1506)
* Rename WindowSetRGBA -> WindowSetBackgroundColour

* Fix Typos
2022-06-29 22:31:49 +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
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
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
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
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
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
f6257d3d31 Add Environment and WindowReloadApp calls to runtime. Updated default templates. 2022-04-20 20:28:41 +10:00
Lea Anthony
4e9eda8e1f Fix bug in WindowSet*Theme 2022-04-19 17:44:40 +10:00
stffabi
6d09a45a30
[v2] Add support for AssetsHandler (#1325)
* [website] Fix devserver default value doc

* [v2] Add support for AssetsHandler

AssetsHandler is a http.Handler delegate, which gets called
as a fallback for all Non-GET requests and for GET requests
for which the Assets didn’t find the file.

Known Limitations on Linux:
- All requests are GET requests
- No request headers
- No request body
- No response status code, only StatusOK will be returned
- No response headers

Known Limitations on Windows:
-  Request body is leaking memory. Seems to be a bug in
    WebView2, investigation angoing.

Most of these limitations on Linux will be fixed in the future with
adding support for Webkit2Gtk 2.36.0+.

* [v2, linux] Add response streaming support

The complete response won’t be held anymore in memory and will
be streamed to WebKit2.

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-04-12 20:18:27 +10:00
stffabi
c70d93b482
Suppress resizing during minimize of a frameless window (#1322)
If the window is frameless and we are minimizing, then we need to suppress
the Resize on the WebView2. If we don't do this, restoring does not work as
expected and first restores with some wrong size during the restore animation
and only fully renders when the animation is done.
This highly depends on the content in the WebView.
Possible fix for #1319
2022-04-10 18:45:09 +10:00
Lea Anthony
073f8202e5 Fix windows/frontend compile error 2022-04-01 09:59:33 +11:00
Sebastian Bauer
7dd3f96915 [Feature/1149] Dark mode: functions for manually switching theme (#1291)
* [Feature/1149] Dark mode: functions for manually switching theme
2022-04-01 08:21:37 +11:00
stffabi
65fb42d9e7
[v2] Add support for external frontend dev servers (#1290)
* [v2] Consolidate AssetServers

* [v2] Support starturl for webview on linux and darwin

* [v2] Add support for frontend DevServer

* [v2] Activate frontend DevServer in svelte template

* [website] Add bleeding edge guide for PRs

* DoNotMerge: Bump Version for testing

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-03-31 00:40:44 +11:00
Lea Anthony
a5bf76b30f Fix up dev. Pull in go-webview and winc 2022-03-29 21:45:16 +11:00
Lea Anthony
48254b73e5
[Feature/1149] Dark mode (#1281)
* Add Windows version helper

* Initial theme support

* Support custom themes

* Update docs

* Honour HighContrast theme. Remove import "C". Refactor

* Small refactor

* Support inactive theme

* Update Docs
2022-03-27 22:57:45 +11:00
Lea Anthony
a278c9e164
Try to focus window when Show() is called. (#1212)
* Try to focus window when Show() is called.

* Ensure Focus is regained by Webview2 when tabbing

* Run restore code on main thread
2022-03-15 20:16:38 +11:00
Lea Anthony
60c6dce07d
Ensure Focus is regained by Webview2 when tabbing (#1257) 2022-03-15 20:15:21 +11:00
Stefanos Papadakis
e78557ec24
Windows switch scheme: https -> http (#1255) 2022-03-15 05:58:43 +11:00
stffabi
abe8ba9266
[v2, windows] Fix maximised start state (#1243) 2022-03-11 06:26:59 +11:00
Lea Anthony
1048782eb4
Initial commit (#1241) 2022-03-10 21:20:41 +11:00
Lea Anthony
31b609dff0 Print friendlier file path when file does not exist 2022-03-05 13:33:24 +11:00
stffabi
fbf75b1d14
[v2, windows] Move assets from file://wails to https://wails.localhost (#1211)
This should allow web workers to be used
2022-03-05 13:32:28 +11:00
stffabi
c63b1f1981
[v2] Consolidate processRequest, improve logging and error handling (#1158) 2022-02-28 19:14:03 +11:00
Lea Anthony
93491eb2eb
Feature/align api (#1161)
* Fix WindowSetRGBA API

* Change WindowUnFullscreen -> WindowUnfullscreen for consistency
RGBA bugfix
2022-02-19 20:29:55 +11:00
Lea Anthony
f059c35d9e
Feature: WindowToggleMaximise (#1159)
* [windows] Add WindowToggleMaximise

* Add mac support

* Update docs

* [linux] Toggle Maximise
2022-02-18 20:28:16 +11:00
Lea Anthony
876b845762 [Windows] Restore min/max after fullscreen 2022-02-10 19:55:04 +11:00
stffabi
7bc51725c0
[v2, windows] Apply suggested window size during DPI changed event (#1131)
* [v2, windows] Apply suggested window size during DPI changed event

This adjusts the window size if the window is moved from one
monitor to another with a different DPI scaling

* [v2, windows] Do not block processing of messages during frameless drag/resize

* [v2, windows] Bump winc

Improves the HiDPI handling by using newer APIs if available

* [v2, windows] Constrain frameless maximize to MaxWidth/MaxHeight
2022-02-08 07:56:01 +11:00
Lea Anthony
0c6864c7ed [windows] Fix pos/getpos calls 2022-02-04 07:45:44 +11:00
Lea Anthony
0971857e7e
Fix position runtime (#1123)
* [linux] Move SetTitle and startDrag to main thread

* [linux] Move SetPosition, Center, Fullscreen and UnFullscreen to main thread

* Fix runtime Window Get/Set Position signatures

* Fix vanilla template keyboard handling
2022-02-03 21:42:14 +11:00
Lea Anthony
6a5937bd90 [windows] Do not allow maximise via runtime if disableResize is true 2022-02-03 07:31:05 +11:00
MikeSchaap
965187a8bb
Updated windows window/frontend to fix issue with html select positioning (#1082)
* Updated windows window/frontend to fix issue with html select positioning

* Moved notifyParentWindowPositionChanged to the Window struct and moved RegMsgHandler to Run

* Update v2/internal/frontend/desktop/windows/window.go

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>

* Moved winc.RegMsgHandler back to old location

* fixed error with merge

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-01-26 18:48:39 +11:00
stffabi
b1c2065dfb [v2, windows] Add WebviewUserDataPath to windows options 2022-01-25 21:42:01 +01:00
Lea Anthony
8b7d4393dc Revert "WIP"
This reverts commit b07fd608b3.
2022-01-12 20:34:37 +11:00
Lea Anthony
b07fd608b3 WIP 2022-01-12 20:29:20 +11:00
redraskal
b32c5b7ba2
fix: [v2] win runtime.WindowMinimise() 2022-01-10 23:00:31 -06:00
redraskal
0593c29784
fix: [v2] win runtime.WindowMaximise() 2022-01-10 22:59:40 -06:00
ironpark
fda3323386 basic implement 2021-12-04 04:55:36 +09:00
stffabi
d827aafe89 [v2] Improve processRequest: Handle errors and behave more like a webserver
This also fixes that requests remain in "pending" state on
darwin if e.g. a file is not found or an error occurs during
loading of the file.
2021-12-03 16:41:51 +01:00
Lea Anthony
97be694d2a
Merge pull request #996 from stffabi/feature/improved-translate-uri
[v2] Improve translation of URI to file to be loaded
2021-12-02 05:38:04 -08:00
stffabi
8107a8bd1e [v2] Improve translation of URI to file to be loaded 2021-12-02 11:53:32 +01:00
stffabi
0295f8dee2 [v2] Fix memory leak in processRequest for windows and darwin 2021-12-02 11:04:24 +01:00
stffabi
a353a653d1 [windows] Replace dispatch with invoke 2021-12-01 13:24:54 +01:00
stffabi
155f1fde49 [v2] Do not block during processing of messages
On windows blocking here results in a blocked main thread
and a blocked webview.
2021-12-01 13:24:19 +01:00
stffabi
2e15f22621 [v2] Windows do not apply WindowStartState on reloads 2021-11-29 15:14:03 +01:00
Lea Anthony
9525667ebd [windows] Add Frameless resize 2021-11-22 06:47:09 +11:00