Skip to content

Commit

Permalink
fix(positioner): pass correct values through IPC
Browse files Browse the repository at this point in the history
followup to #1822
  • Loading branch information
amrbashir committed Oct 2, 2024
1 parent f12d356 commit a828fc0
Show file tree
Hide file tree
Showing 31 changed files with 83 additions and 72 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@
},
"engines": {
"pnpm": "^9.0.0"
}
},
"packageManager": "pnpm@9.11.0+sha512.0a203ffaed5a3f63242cd064c8fb5892366c103e328079318f78062f24ea8c9d50bc6a47aa3567cabefd824d170e78fa2745ed1f16b132e16436146b7688f19b"
}
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 @@ -94,8 +94,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
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 a828fc0

Please sign in to comment.