5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 07:21:32 +08:00
Commit Graph

79 Commits

Author SHA1 Message Date
Jakub Peleška
022a5ffec4
Fix Drag & Drop JS runtime (#3516)
* Feature/1090 native drag and drop for file and folder (#3203)

* implement basic dnd for linux

* implemented windows

* progress changed linux handling and added coordinates to drop

* progress fix drop coordinates on windows

* progress remove log from windows

* progress move js

* update js after merge

* fix event listener registration

* fix segfault on non file drag

* remove logs, fix coordinates

* minor changes, simplify to drop only

* rename EnableWails -> EnableFileDrop

* add documentation (PR id missing)

* add PR id to changelog

* fix remove casting from malloc

* fix nil check for OnFileDrop's callback

* fix nil check for OnFileDrop skip event when nil

* add error message for nil callback in OnFileDrop

---------

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

* implement native drag and drop for macOS (#3250)

* implement native drag and drop for macOS

* update docs

* add to changelog

* update docs (macOS is supported)

* Fix windows DragAndDrop options

* Fix class unset on dragleave for full frame elements

* improve class unset (nested elements and borders case)

* Fix runtime drop target detection and CSS class assignment

* Edit changelog

* Fix drag-and-drop options in references

* Update v2/internal/frontend/desktop/darwin/WailsWebView.m

* Update v2/internal/frontend/desktop/darwin/WailsWebView.m

---------

Co-authored-by: Zámbó, Levente <levente.zambo@gmail.com>
Co-authored-by: lyimmi <lelvente.zambo@gmail.com>
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
Co-authored-by: Andrey Pshenkin <andrey.pshenkin@gmail.com>
Co-authored-by: Pavel Binar <pavel@beamtransfer.io>
2024-06-10 15:15:28 +10:00
Atterpac
05bdeb0844
allow builds for webkit2gtk-4.1 (#3465) 2024-05-08 19:26:27 -05:00
Denis Bernard
08e12de2a0
linux: workaround for #2977 (#3027)
In NewWindow, set options.Linux.WebviewGpuPolicy to WebviewGpuPolicyNever
if options.Linux is nil, disabling GPU acceleration by default on linux
until the upstream bugs https://bugs.webkit.org/show_bug.cgi?id=228268
and https://bugs.webkit.org/show_bug.cgi?id=261874 are fixed.
2023-11-04 18:03:12 +11:00
Mohamed Gharib
3f9067c815
[v2] Devtools tag doesn't enable default context-menu (#2923)
* Devtools tag doesn't enable default context-menu

* Update changelog
2023-09-26 07:43:18 +10:00
Mohamed Gharib
34c725231c
[v2] Refactor devtools (better naming to remove confusion) (#2921) 2023-09-19 20:56:49 +10:00
Lea Anthony
6aa6762f12
Devtools hotkey (#2915)
* Add Ctrl/Cmd+Shift+F12 Hotkey to open devtools when `-devtools` flag used.
2023-09-19 05:56:14 +10:00
Zámbó, Levente
647bc87600
[v2, Linux] fix menu background color (#2873)
* fix menu background color

* remove commented line

* handle transparent window and background color

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2023-09-07 21:25:02 +10:00
Zámbó, Levente
427e41f190
fix disable window resize (#2863)
* fix disable window resize

* change issue number in changelog

* change pull request number in changelog
2023-08-28 08:40:28 +10:00
Zámbó, Levente
5a4eae968f
set the background color for window (#2853)
* set the background color for window

* update changelog for #2853
2023-08-25 08:27:52 +10:00
Zámbó, Levente
9085e1edbb
Bugfix/2848 window set position timing (#2850)
* run WindowSetPosition on main thread

* remove wait group from SetPosition it is not neaded

* update changelog
2023-08-25 05:50:26 +10:00
Mohamed Gharib
4162f097f1
[v2, options] Add EnableDefaultContextMenu option (#2733)
* [v2, options] Add EnableDefaultContextMenu option

* Update changelog & docs

* go mod tidy (./v2)

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2023-06-20 06:31:47 +10:00
Mohamed Gharib
fa851f29c5
[v2] Add -devtools production build flag (#2725)
* [v2] Add devtools production build flag

* Update changelog

* Fix changelog spacing

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2023-06-19 06:45:01 +10:00
LGiki
832d6bc4d3
[v2, linux] Fix StartHidden option not working on Linux (#2624)
* fix: StartHidden option not working on Linux

* chore: add an entry to the changelog
2023-04-30 01:20:39 +10:00
Zámbó, Levente
c3011813b0
linux separate window c and go file (#2275) 2023-01-07 16:20:11 +11:00
Zámbó, Levente
ef5f547d27
Support GPU acceleration settings on Windows & Linux (#2266)
* support GPU acceleration settings Window & Linux

* fix linux empty option crash

* fix change linux gpu policy switch case

* add PR to changelog
2023-01-02 09:38:53 +11:00
Lea Anthony
e57bfe002a
Fix right mouse button event (#2190) 2022-12-13 07:09:45 +11:00
stffabi
5418b879c4
[linux] Add support for WebKit2GTK 2.36+ features (#2151) 2022-11-30 11:04:12 +01:00
stffabi
f6e46ac1c3
[debug] Introducing debug options for debug builds to allow opening the inspector on startup (#2080) 2022-11-12 19:51:54 +11:00
Zámbó, Levente
de49b1f125
fix gtk_window_begin_resize_drag's mouse button (#1920)
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-10-01 15:45:37 +10:00
Zámbó, Levente
2690250378
Add window transparency for linux (#1926) 2022-10-01 15:44:38 +10:00
Zámbó, Levente
13532e00a0
add missing resize for framless window on linux (#1918)
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-09-30 08:51:08 +10:00
Lea Anthony
b2069c871d
Refactor app (#1909)
* Application refactor

* [windows] refactor out main loop. Create new application struct. Refactor assethandler/assetserver signatures.

* Refactor darwin app

* Refactor app for linux

* Update v2/internal/frontend/assetserver/assethandler.go

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

* Update v2/internal/frontend/assetserver/assethandler.go

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

* Update v2/internal/frontend/assetserver/assetserver.go

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

* Update v2/internal/frontend/assetserver/assetserver.go

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

Co-authored-by: stffabi <stffabi@users.noreply.github.com>
2022-09-29 18:43:35 +10:00
ZanderCodes
70c484f603
Add Some WindowState (#1349)
* Add Check for WindowState IsMaximised, IsMinimized, IsNormal and IsFullscreen

Solve conflicts

# Conflicts:
#	v2/internal/frontend/desktop/darwin/WailsContext.m
#	v2/internal/frontend/desktop/darwin/frontend.go
#	v2/internal/frontend/desktop/linux/window.go
#	v2/internal/frontend/desktop/windows/window.go

* Add Check for WindowState IsMaximised, IsMinimized, IsNormal and IsFullscreen

Solve conflict
# Conflicts:
#	v2/pkg/runtime/window.go

* Forgot some function to use it

# Conflicts:
#	v2/internal/frontend/desktop/darwin/WailsContext.h
#	v2/internal/frontend/desktop/windows/win32/consts.go
#	v2/internal/frontend/desktop/windows/win32/window.go

* Modify the instructions

# Conflicts:
#	v2/internal/frontend/devserver/devserver.go

* Add Functions to DevServer

# Conflicts:
#	v2/internal/frontend/dispatcher/systemcalls.go
#	v2/internal/frontend/runtime/desktop/window.js
#	v2/internal/frontend/runtime/package-lock.json
#	v2/internal/frontend/runtime/runtime_prod_desktop.js
#	v2/internal/frontend/runtime/wrapper/runtime.d.ts
#	v2/internal/frontend/runtime/wrapper/runtime.js

* Add Callback and JavaScript Functions

# Conflicts:
#	v2/cmd/wails/internal/commands/initialise/templates/generate/assets/common/frontend/wailsjs/runtime/runtime.js
#	v2/internal/frontend/runtime/package-lock.json
#	v2/internal/frontend/runtime/runtime_dev_desktop.js

* Remove Merge lines

* Fix IsMaximised

* Add WindowState Docs

* Update docs

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-08-30 06:52:01 +10:00
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
Lea Anthony
8e21061e78
Remove debug info for linux 2022-07-26 08:29:00 +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
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
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
Lea Anthony
c477100374
Add BackgroundColour and deprecate RGBA (#1475) 2022-06-21 19:47:05 +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
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
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
bearsh
d8bcf7ac70
v2: linux: add icon to linux specific app option and load it during w… (#1272)
* v2: linux: add icon to linux specific app option and load it during window creation

Signed-off-by: Martin Gysel <me@bearsh.org>

* doc: linux specific option: icon
2022-03-30 18:15:58 +11:00
Florent
ec31d49b59
prevent close event being propagated when handled in app (#1297)
closes #1288
2022-03-30 18:13:01 +11:00
Florent
d9e5cce2b2
add support for 'DomReady' callback on linux (#1249)
* add support for 'DomReady' callback on linux
cosmetic: use bodyLen instead of len() in processRequest()

* reformat webViewLoadChanged() for consistency

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-03-14 18:42:38 +11:00
Ian M. Jones
64480ff1ab
Ensure Linux IsFullScreen uses GDK_WINDOW_STATE_FULLSCREEN bitmask appropriately. (#1245) 2022-03-11 15:41:28 +11:00
Ian M. Jones
e9aa0d5c5a
Fix fullscreen on linux arm64 (#1209)
* Fix fatal error on otherwise clean exit.

* Fix race condition while setting title during window creation.

* Fix unexpected signal error when clicking webview should initiate a drag window operation.

* Ensure ExecuteOnMainThread callbacks are removed from the event source list on completion.

* Ensure all ExecuteOnMainThread callbacks use the expected return value on completion.

* Fix potential memory leak when exiting early from startDrag.

* Fix using runtime.WindowFullscreen on Linux ARM64.
2022-03-04 23:07:40 +11:00
Ian M. Jones
c378d935f3
Fix linux unexpected signal errors (#1200)
* Fix fatal error on otherwise clean exit.

* Fix race condition while setting title during window creation.

* Fix unexpected signal error when clicking webview should initiate a drag window operation.

* Ensure ExecuteOnMainThread callbacks are removed from the event source list on completion.

* Ensure all ExecuteOnMainThread callbacks use the expected return value on completion.

* Fix potential memory leak when exiting early from startDrag.
2022-03-04 17:50:43 +11:00
Lea Anthony
c7c068ade0 Add Javascriptcore include. #1198 2022-03-02 20:17:30 +11:00
Lea Anthony
a445db1b7b
Feature/linux v2 beta (#1171)
* Update docusaurus version

* Add install instructions

* Add Linus Distro Support Page

* Update Linus Distro Support Page

* v2.0.0-beta.30

* image

* update blog

* Update blog

* Remove exp tag

* Update banner

* Update banner

* [linux] Fix warning
2022-02-22 21:35:03 +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
6e8d65e3aa
[linux] Add stdint.h include 2022-02-17 21:23:24 +11:00
Lea Anthony
99ca6d5e77 [Linux] Restore min/max after fullscreen 2022-02-10 19:55:04 +11:00
Lea Anthony
3d02a314b9
[linux] Fix min/max size after fullscreen 2022-02-08 07:04:45 +11:00
Lea Anthony
30a4f47cba
[linux] Fix min/max size 2022-02-08 06:51:52 +11:00
Lea Anthony
668da3a827
[linux] Fix disabling context menu 2022-02-08 06:20:41 +11:00