Skip to content

Commit

Permalink
fix(positioner): pass correct values through IPC (tauri-apps#1858)
Browse files Browse the repository at this point in the history
* fix(positioner): pass correct values through IPC

followup to tauri-apps#1822

* build api & remove packageManager field
  • Loading branch information
amrbashir authored and gezihuzi committed Oct 3, 2024
1 parent 9499f68 commit d33143b
Show file tree
Hide file tree
Showing 31 changed files with 82 additions and 72 deletions.
2 changes: 1 addition & 1 deletion plugins/autostart/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/barcode-scanner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/biometric/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/clipboard-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/deep-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/dialog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/geolocation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/global-shortcut/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/haptics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/log/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/nfc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/notification/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/os/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
4 changes: 2 additions & 2 deletions plugins/positioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ import {
const action = async (event: TrayIconEvent) => {
// add the handle in the action to update the state
await handleIconState(event);
if ("click" in event) {
const { click } = event;

if (event.type === "Click") {
// note this option requires enabling the `tray-icon`
// feature in the Cargo.toml
await moveWindow(Position.TrayLeft);
Expand Down
2 changes: 1 addition & 1 deletion plugins/positioner/api-iife.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions plugins/positioner/guest-js/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,20 @@ export async function moveWindow(to: Position): Promise<void> {
}

export async function handleIconState(event: TrayIconEvent): Promise<void> {
await invokeSetTrayIconState(event.rect)
}
const size = {} as Record<string, unknown>
size[`${event.rect.size.type}`] = {
width: event.rect.size.width,
height: event.rect.size.height
}

const position = {} as Record<string, unknown>
position[`${event.rect.position.type}`] = {
x: event.rect.position.x,
y: event.rect.position.y
}

async function invokeSetTrayIconState(rect: TrayIconEvent['rect']) {
await invoke('plugin:positioner|set_tray_icon_state', {
position: rect.position,
size: rect.size
position,
size
})
}
2 changes: 1 addition & 1 deletion plugins/positioner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/process/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/shell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/sql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/store/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/stronghold/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/updater/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/upload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/websocket/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
2 changes: 1 addition & 1 deletion plugins/window-state/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"LICENSE"
],
"dependencies": {
"@tauri-apps/api": "^2.0.0-rc.4"
"@tauri-apps/api": "^2.0.0-rc.6"
}
}
Loading

0 comments on commit d33143b

Please sign in to comment.