-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
bddf59e
commit 4137ab4
Showing
13 changed files
with
180 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"tauri": minor | ||
"tauri-runtime-wry": minor | ||
--- | ||
|
||
Disable automatic window tabbing on macOS when the `tabbing_identifier` option is not defined, the window is transparent or does not have decorations. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"api": minor | ||
--- | ||
|
||
Added `tabbingIdentifier` window option for macOS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"tauri": minor | ||
"tauri-runtime": minor | ||
"tauri-runtime-wry": minor | ||
"api": minor | ||
--- | ||
|
||
Added `tabbing_identifier` to the window builder on macOS. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,89 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
#response { | ||
white-space: pre-wrap; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div id="window-label"></div> | ||
<div id="container"></div> | ||
<div id="response"></div> | ||
<head> | ||
<style> | ||
#response { | ||
white-space: pre-wrap; | ||
} | ||
</style> | ||
</head> | ||
|
||
<script> | ||
var WebviewWindow = window.__TAURI__.window.WebviewWindow | ||
var appWindow = window.__TAURI__.window.appWindow | ||
var windowLabel = appWindow.label | ||
var windowLabelContainer = document.getElementById('window-label') | ||
windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.' | ||
<body> | ||
<div id="window-label"></div> | ||
<div id="container"></div> | ||
<div id="response"></div> | ||
|
||
var container = document.getElementById('container') | ||
<script> | ||
var WebviewWindow = window.__TAURI__.window.WebviewWindow | ||
var appWindow = window.__TAURI__.window.appWindow | ||
var windowLabel = appWindow.label | ||
var windowLabelContainer = document.getElementById('window-label') | ||
windowLabelContainer.innerText = 'This is the ' + windowLabel + ' window.' | ||
|
||
function createWindowMessageBtn(label) { | ||
var tauriWindow = WebviewWindow.getByLabel(label) | ||
var button = document.createElement('button') | ||
button.innerText = 'Send message to ' + label | ||
button.addEventListener('click', function () { | ||
tauriWindow.emit('clicked', 'message from ' + windowLabel) | ||
}) | ||
container.appendChild(button) | ||
} | ||
var container = document.getElementById('container') | ||
|
||
// global listener | ||
window.__TAURI__.event.listen('clicked', function (event) { | ||
responseContainer.innerHTML += | ||
'Got ' + JSON.stringify(event) + ' on global listener\n\n' | ||
}) | ||
window.__TAURI__.event.listen('tauri://window-created', function (event) { | ||
createWindowMessageBtn(event.payload.label) | ||
function createWindowMessageBtn(label) { | ||
var tauriWindow = WebviewWindow.getByLabel(label) | ||
var button = document.createElement('button') | ||
button.innerText = 'Send message to ' + label | ||
button.addEventListener('click', function () { | ||
tauriWindow.emit('clicked', 'message from ' + windowLabel) | ||
}) | ||
container.appendChild(button) | ||
} | ||
|
||
var responseContainer = document.getElementById('response') | ||
// listener tied to this window | ||
appWindow.listen('clicked', function (event) { | ||
responseContainer.innerText += | ||
'Got ' + JSON.stringify(event) + ' on window listener\n\n' | ||
}) | ||
// global listener | ||
window.__TAURI__.event.listen('clicked', function (event) { | ||
responseContainer.innerHTML += | ||
'Got ' + JSON.stringify(event) + ' on global listener\n\n' | ||
}) | ||
window.__TAURI__.event.listen('tauri://window-created', function (event) { | ||
createWindowMessageBtn(event.payload.label) | ||
}) | ||
|
||
var createWindowButton = document.createElement('button') | ||
createWindowButton.innerHTML = 'Create window' | ||
createWindowButton.addEventListener('click', function () { | ||
var webviewWindow = new WebviewWindow( | ||
Math.random().toString().replace('.', '') | ||
) | ||
webviewWindow.once('tauri://created', function () { | ||
responseContainer.innerHTML += 'Created new webview' | ||
}) | ||
webviewWindow.once('tauri://error', function (e) { | ||
responseContainer.innerHTML += 'Error creating new webview' | ||
}) | ||
}) | ||
container.appendChild(createWindowButton) | ||
var responseContainer = document.getElementById('response') | ||
// listener tied to this window | ||
appWindow.listen('clicked', function (event) { | ||
responseContainer.innerText += | ||
'Got ' + JSON.stringify(event) + ' on window listener\n\n' | ||
}) | ||
|
||
var globalMessageButton = document.createElement('button') | ||
globalMessageButton.innerHTML = 'Send global message' | ||
globalMessageButton.addEventListener('click', function () { | ||
// emit to all windows | ||
window.__TAURI__.event.emit('clicked', 'message from ' + windowLabel) | ||
var createWindowButton = document.createElement('button') | ||
createWindowButton.innerHTML = 'Create window' | ||
createWindowButton.addEventListener('click', function () { | ||
var webviewWindow = new WebviewWindow( | ||
Math.random().toString().replace('.', ''), | ||
{ | ||
tabbingIdentifier: windowLabel | ||
} | ||
) | ||
webviewWindow.once('tauri://created', function () { | ||
responseContainer.innerHTML += 'Created new webview' | ||
}) | ||
webviewWindow.once('tauri://error', function (e) { | ||
responseContainer.innerHTML += 'Error creating new webview' | ||
}) | ||
container.appendChild(globalMessageButton) | ||
}) | ||
container.appendChild(createWindowButton) | ||
|
||
var allWindows = window.__TAURI__.window.getAll() | ||
for (var index in allWindows) { | ||
var label = allWindows[index].label | ||
if (label === windowLabel) { | ||
continue | ||
} | ||
createWindowMessageBtn(label) | ||
var globalMessageButton = document.createElement('button') | ||
globalMessageButton.innerHTML = 'Send global message' | ||
globalMessageButton.addEventListener('click', function () { | ||
// emit to all windows | ||
window.__TAURI__.event.emit('clicked', 'message from ' + windowLabel) | ||
}) | ||
container.appendChild(globalMessageButton) | ||
|
||
var allWindows = window.__TAURI__.window.getAll() | ||
for (var index in allWindows) { | ||
var label = allWindows[index].label | ||
if (label === windowLabel) { | ||
continue | ||
} | ||
</script> | ||
</body> | ||
</html> | ||
createWindowMessageBtn(label) | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters