mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-09-17 18:01:11 +03:00
Compare commits
7 Commits
main-6fb7e
...
main-09889
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09889cd839 | ||
|
|
c194df791d | ||
|
|
b316af6a8f | ||
|
|
d09a574380 | ||
|
|
b115208aad | ||
|
|
392af44cbe | ||
|
|
133e1ae81d |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -105,7 +105,7 @@ jobs:
|
|||||||
# see https://github.com/wingtk/gvsbuild/pull/1004
|
# see https://github.com/wingtk/gvsbuild/pull/1004
|
||||||
Move-Item "C:\Program Files\Git\usr\bin" "C:\Program Files\Git\usr\notbin"
|
Move-Item "C:\Program Files\Git\usr\bin" "C:\Program Files\Git\usr\notbin"
|
||||||
Move-Item "C:\Program Files\Git\bin" "C:\Program Files\Git\notbin"
|
Move-Item "C:\Program Files\Git\bin" "C:\Program Files\Git\notbin"
|
||||||
gvsbuild build --msys-dir=C:\msys64 gtk4 libadwaita librsvg
|
gvsbuild build --vs-ver=vs2026 --msys-dir=C:\msys64 gtk4 libadwaita librsvg
|
||||||
Move-Item "C:\Program Files\Git\usr\notbin" "C:\Program Files\Git\usr\bin"
|
Move-Item "C:\Program Files\Git\usr\notbin" "C:\Program Files\Git\usr\bin"
|
||||||
Move-Item "C:\Program Files\Git\notbin" "C:\Program Files\Git\bin"
|
Move-Item "C:\Program Files\Git\notbin" "C:\Program Files\Git\bin"
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|||||||
10
.github/workflows/rust.yml
vendored
10
.github/workflows/rust.yml
vendored
@@ -40,7 +40,6 @@ jobs:
|
|||||||
- test
|
- test
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
- uses: Swatinem/rust-cache@v2
|
|
||||||
- name: Install Linux deps
|
- name: Install Linux deps
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
@@ -49,6 +48,13 @@ jobs:
|
|||||||
- name: Install macOS dependencies
|
- name: Install macOS dependencies
|
||||||
if: runner.os == 'macOS'
|
if: runner.os == 'macOS'
|
||||||
run: brew install gtk4 libadwaita imagemagick
|
run: brew install gtk4 libadwaita imagemagick
|
||||||
|
- name: Record macOS native lib versions for cache key
|
||||||
|
if: runner.os == 'macOS'
|
||||||
|
run: |
|
||||||
|
echo "MACOS_LIB_VER=$(brew list --versions glib gtk4 libadwaita | tr '\n' '_')" >> "$GITHUB_ENV"
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
with:
|
||||||
|
prefix-key: ${{ env.MACOS_LIB_VER }}
|
||||||
- name: Install Windows Dependencies - create gtk dir
|
- name: Install Windows Dependencies - create gtk dir
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows'
|
||||||
run: mkdir C:\gtk-build\gtk\x64\release
|
run: mkdir C:\gtk-build\gtk\x64\release
|
||||||
@@ -77,7 +83,7 @@ jobs:
|
|||||||
py -m venv .venv
|
py -m venv .venv
|
||||||
.venv\Scripts\activate.ps1
|
.venv\Scripts\activate.ps1
|
||||||
py -m pip install gvsbuild
|
py -m pip install gvsbuild
|
||||||
gvsbuild build --msys-dir=C:\msys64 gtk4 libadwaita librsvg
|
gvsbuild build --vs-ver=vs2026 --msys-dir=C:\msys64 gtk4 libadwaita librsvg
|
||||||
- name: cargo build
|
- name: cargo build
|
||||||
if: matrix.job == 'build'
|
if: matrix.job == 'build'
|
||||||
run: cargo build
|
run: cargo build
|
||||||
|
|||||||
@@ -123,7 +123,6 @@ struct State {
|
|||||||
focused: Option<Arc<Window>>,
|
focused: Option<Arc<Window>>,
|
||||||
global_list: GlobalList,
|
global_list: GlobalList,
|
||||||
globals: Globals,
|
globals: Globals,
|
||||||
wayland_fd: RawFd,
|
|
||||||
read_guard: Option<ReadEventsGuard>,
|
read_guard: Option<ReadEventsGuard>,
|
||||||
qh: QueueHandle<Self>,
|
qh: QueueHandle<Self>,
|
||||||
pending_events: VecDeque<(Position, CaptureEvent)>,
|
pending_events: VecDeque<(Position, CaptureEvent)>,
|
||||||
@@ -138,7 +137,7 @@ struct Inner {
|
|||||||
|
|
||||||
impl AsRawFd for Inner {
|
impl AsRawFd for Inner {
|
||||||
fn as_raw_fd(&self) -> RawFd {
|
fn as_raw_fd(&self) -> RawFd {
|
||||||
self.state.wayland_fd
|
self.queue.as_fd().as_raw_fd()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,7 +331,6 @@ impl LayerShellInputCapture {
|
|||||||
active_windows: Vec::new(),
|
active_windows: Vec::new(),
|
||||||
focused: None,
|
focused: None,
|
||||||
qh,
|
qh,
|
||||||
wayland_fd: queue.as_fd().as_raw_fd(),
|
|
||||||
read_guard: None,
|
read_guard: None,
|
||||||
pending_events: VecDeque::new(),
|
pending_events: VecDeque::new(),
|
||||||
outputs: vec![],
|
outputs: vec![],
|
||||||
@@ -548,13 +546,12 @@ impl State {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Inner {
|
impl Inner {
|
||||||
fn read(&mut self) -> bool {
|
fn read(&mut self) {
|
||||||
match self.state.read_guard.take().unwrap().read() {
|
match self.state.read_guard.take().unwrap().read() {
|
||||||
Ok(_) => true,
|
Ok(_) => {}
|
||||||
Err(WaylandError::Io(e)) if e.kind() == ErrorKind::WouldBlock => false,
|
Err(WaylandError::Io(e)) if e.kind() == ErrorKind::WouldBlock => {}
|
||||||
Err(WaylandError::Io(e)) => {
|
Err(WaylandError::Io(e)) => {
|
||||||
log::error!("error reading from wayland socket: {e}");
|
log::error!("error reading from wayland socket: {e}");
|
||||||
false
|
|
||||||
}
|
}
|
||||||
Err(WaylandError::Protocol(e)) => {
|
Err(WaylandError::Protocol(e)) => {
|
||||||
panic!("wayland protocol violation: {e}")
|
panic!("wayland protocol violation: {e}")
|
||||||
@@ -564,16 +561,11 @@ impl Inner {
|
|||||||
|
|
||||||
fn prepare_read(&mut self) -> io::Result<()> {
|
fn prepare_read(&mut self) -> io::Result<()> {
|
||||||
loop {
|
loop {
|
||||||
match self.queue.prepare_read() {
|
if let Some(guard) = self.queue.prepare_read() {
|
||||||
None => match self.queue.dispatch_pending(&mut self.state) {
|
self.state.read_guard = Some(guard);
|
||||||
Ok(_) => continue,
|
break Ok(());
|
||||||
Err(DispatchError::Backend(WaylandError::Io(e))) => return Err(e),
|
} else {
|
||||||
Err(e) => panic!("failed to dispatch wayland events: {e}"),
|
self.dispatch_events();
|
||||||
},
|
|
||||||
Some(r) => {
|
|
||||||
self.state.read_guard = Some(r);
|
|
||||||
break Ok(());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -655,13 +647,7 @@ impl Stream for LayerShellInputCapture {
|
|||||||
let inner = guard.get_inner_mut();
|
let inner = guard.get_inner_mut();
|
||||||
|
|
||||||
// read events
|
// read events
|
||||||
while inner.read() {
|
inner.read();
|
||||||
// prepare next read
|
|
||||||
match inner.prepare_read() {
|
|
||||||
Ok(_) => {}
|
|
||||||
Err(e) => return Poll::Ready(Some(Err(e.into()))),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// dispatch the events
|
// dispatch the events
|
||||||
inner.dispatch_events();
|
inner.dispatch_events();
|
||||||
|
|||||||
@@ -413,7 +413,15 @@ async fn do_capture_session(
|
|||||||
};
|
};
|
||||||
|
|
||||||
// find client corresponding to barrier
|
// find client corresponding to barrier
|
||||||
let pos = *pos_for_barrier_id.get(&barrier_id).expect("invalid barrier id");
|
let pos = match pos_for_barrier_id.get(&barrier_id) {
|
||||||
|
Some(id) => *id,
|
||||||
|
None => {
|
||||||
|
log::warn!("INVALID BARRIER ID: Id {barrier_id} does not exist!");
|
||||||
|
let id = find_corresponding_client(&barriers, activated.cursor_position().expect("no cursor position reported by compositor"));
|
||||||
|
let pos = *pos_for_barrier_id.get(&id).expect("invalid barrier id");
|
||||||
|
pos
|
||||||
|
},
|
||||||
|
};
|
||||||
current_pos.replace(Some(pos));
|
current_pos.replace(Some(pos));
|
||||||
|
|
||||||
// client entered => send event
|
// client entered => send event
|
||||||
|
|||||||
@@ -518,7 +518,7 @@ impl Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn read_from_disk(&mut self) -> Result<bool, io::Error> {
|
pub fn read_from_disk(&mut self) -> Result<bool, io::Error> {
|
||||||
log::info!("reading config from {:?}", &self.config_path);
|
log::info!("reading config from {:?}", self.config_path);
|
||||||
|
|
||||||
let current_config = fs::read_to_string(&self.config_path)?;
|
let current_config = fs::read_to_string(&self.config_path)?;
|
||||||
let current_config = match current_config.parse::<DocumentMut>() {
|
let current_config = match current_config.parse::<DocumentMut>() {
|
||||||
@@ -548,7 +548,7 @@ impl Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn write_back(&mut self) -> Result<(), io::Error> {
|
pub fn write_back(&mut self) -> Result<(), io::Error> {
|
||||||
log::info!("writing config to {:?}", &self.config_path);
|
log::info!("writing config to {:?}", self.config_path);
|
||||||
/* the new config */
|
/* the new config */
|
||||||
let new_config = self.config_toml.clone().unwrap_or_default();
|
let new_config = self.config_toml.clone().unwrap_or_default();
|
||||||
let new_config = toml_edit::ser::to_string_pretty(&new_config).expect("config");
|
let new_config = toml_edit::ser::to_string_pretty(&new_config).expect("config");
|
||||||
|
|||||||
Reference in New Issue
Block a user