mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-21 03:19:31 +08:00
[linux] Create Linux runtime
This commit is contained in:
parent
a1d5412465
commit
466676d99f
1
v2/internal/bridge/linux.js
Normal file
1
v2/internal/bridge/linux.js
Normal file
File diff suppressed because one or more lines are too long
5
v2/internal/ffenestri/runtime_linux.c
Normal file
5
v2/internal/ffenestri/runtime_linux.c
Normal file
File diff suppressed because one or more lines are too long
1
v2/internal/runtime/assets/desktop_linux.js
Normal file
1
v2/internal/runtime/assets/desktop_linux.js
Normal file
File diff suppressed because one or more lines are too long
@ -19,7 +19,7 @@ export const System = {
|
||||
};
|
||||
|
||||
export function SendMessage(message) {
|
||||
window.webkit.messageHandlers.external.postMessage(message);
|
||||
window.wailsInvoke(message);
|
||||
}
|
||||
|
||||
export function Init() {
|
||||
@ -32,10 +32,34 @@ export function Init() {
|
||||
if (currentElement.hasAttribute('data-wails-no-drag')) {
|
||||
break;
|
||||
} else if (currentElement.hasAttribute('data-wails-drag')) {
|
||||
window.webkit.messageHandlers.windowDrag.postMessage(null);
|
||||
window.wailsDrag(null);
|
||||
break;
|
||||
}
|
||||
currentElement = currentElement.parentElement;
|
||||
}
|
||||
});
|
||||
|
||||
// Setup context menu hook
|
||||
window.addEventListener('contextmenu', function (e) {
|
||||
let currentElement = e.target;
|
||||
let contextMenuId;
|
||||
while (currentElement != null) {
|
||||
contextMenuId = currentElement.dataset['wails-context-menu-id'];
|
||||
if (contextMenuId != null) {
|
||||
break;
|
||||
}
|
||||
currentElement = currentElement.parentElement;
|
||||
}
|
||||
if (contextMenuId != null || window.disableWailsDefaultContextMenu) {
|
||||
e.preventDefault();
|
||||
}
|
||||
if( contextMenuId != null ) {
|
||||
let contextData = currentElement.dataset['wails-context-menu-data'];
|
||||
let message = {
|
||||
id: contextMenuId,
|
||||
data: contextData || '',
|
||||
};
|
||||
window.wailsContextMenuMessage(JSON.stringify(message));
|
||||
}
|
||||
});
|
||||
}
|
@ -16,7 +16,7 @@ func main() {
|
||||
|
||||
sourceDir := fs.RelativePath("../../../internal/runtime/js")
|
||||
|
||||
platforms := []string{"darwin", "windows"}
|
||||
platforms := []string{"darwin", "windows", "linux"}
|
||||
|
||||
for _, platform := range platforms {
|
||||
println("Building JS Runtime for " + platform)
|
||||
|
Loading…
Reference in New Issue
Block a user