Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update rust crate winit to 0.29 #38

Merged
merged 5 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: rust audit
uses: actions-rs/audit-check@v1
- uses: actions/checkout@v4
- uses: rustsec/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
42 changes: 18 additions & 24 deletions .github/workflows/clippy-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,38 @@ on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
clippy:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: install system deps
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libxdo-dev libayatana-appindicator3-dev
- name: install stable
uses: actions-rs/toolchain@v1
sudo apt-get install -y libgtk-3-dev libxdo-dev

- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: clippy

- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings
- run: cargo clippy --all-targets --all-features -- -D warnings

fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install stable
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt

- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- run: cargo fmt --all -- --check
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/checkout@v4
- name: covector status
uses: jbolda/covector/packages/action@covector-v0
id: covector
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT

name: version or publish
name: covector version or publish

on:
push:
Expand All @@ -19,22 +19,11 @@ jobs:
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: pnpm/[email protected]
with:
version: 7
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
registry-url: 'https://registry.npmjs.org'
- uses: actions/checkout@v4

- name: cargo login
run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }}

- name: git config
run: |
git config --global user.name "${{ github.event.pusher.name }}"
Expand All @@ -55,8 +44,8 @@ jobs:
uses: tauri-apps/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/version-updates
title: Apply Version Updates From Current Changes
commit-message: 'apply version updates'
labels: 'version updates'
branch: 'release'
body: ${{ steps.covector.outputs.change }}
28 changes: 10 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,26 @@ env:
RUST_BACKTRACE: 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
strategy:
fail-fast: false
matrix:
os: ['windows-latest', 'macos-latest', 'ubuntu-latest']
platform: ["windows-latest", "macos-latest", "ubuntu-latest"]

runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: install system deps
if: contains(matrix.os, 'ubuntu')
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libxdo-dev libayatana-appindicator3-dev

- name: install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- uses: actions-rs/cargo@v1
with:
command: test
sudo apt-get install -y libgtk-3-dev libxdo-dev

- uses: dtolnay/rust-toolchain@stable
- run: cargo test
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ features = [
x11-dl = "2.21"

[dev-dependencies]
winit = "0.28"
winit = "0.29"
tao = "0.23"
eframe = "0.23"
20 changes: 11 additions & 9 deletions examples/winit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use global_hotkey::{
use winit::event_loop::{ControlFlow, EventLoopBuilder};

fn main() {
let event_loop = EventLoopBuilder::new().build();
let event_loop = EventLoopBuilder::new().build().unwrap();

let hotkeys_manager = GlobalHotKeyManager::new().unwrap();

Expand All @@ -23,15 +23,17 @@ fn main() {

let global_hotkey_channel = GlobalHotKeyEvent::receiver();

event_loop.run(move |_event, _, control_flow| {
*control_flow = ControlFlow::Poll;
event_loop
.run(move |_event, event_loop| {
event_loop.set_control_flow(ControlFlow::Poll);

if let Ok(event) = global_hotkey_channel.try_recv() {
println!("{event:?}");
if let Ok(event) = global_hotkey_channel.try_recv() {
println!("{event:?}");

if hotkey2.id() == event.id && event.state == HotKeyState::Released {
hotkeys_manager.unregister(hotkey2).unwrap();
if hotkey2.id() == event.id && event.state == HotKeyState::Released {
hotkeys_manager.unregister(hotkey2).unwrap();
}
}
}
})
})
.unwrap();
}