Skip to content

Commit

Permalink
Add selection of custom input areas on Wayland.
Browse files Browse the repository at this point in the history
Automatic and correct input mapping on Wayland is difficult/impossible.
Thus, on Wayland Weylus now supports the selection of a custom input
area. This is done via a pop-up window that is positioned according to
the desired area of input. Typically, the different input devices
(mouse, touch, pen) can be mapped to the whole workspace (all screens)
or only a specific screen. KDE for example offers input mapping of touch
input to a specific screen. To Weylus this specific mapping is not know
and needs to be specified in a choice menu of the pop-up window.
  • Loading branch information
H-M-H committed Oct 11, 2024
1 parent e59a375 commit 18a584b
Show file tree
Hide file tree
Showing 15 changed files with 602 additions and 42 deletions.
6 changes: 4 additions & 2 deletions lib/linux/xhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ int x11_error_handler(Display* disp, XErrorEvent* err)
return 0;
}

void x11_set_error_handler() {
void x11_set_error_handler()
{
// setting an error handler is required as otherwise xlib may just exit the process, even though
// the error was recoverable.
XSetErrorHandler(x11_error_handler);
Expand Down Expand Up @@ -176,7 +177,8 @@ Window* get_client_list(Display* disp, unsigned long* size, Error* err)
return client_list;
}

int create_capturables(Display* disp, Capturable** capturables, int* num_monitors, int size, Error* err)
int create_capturables(
Display* disp, Capturable** capturables, int* num_monitors, int size, Error* err)
{
if (size <= 0)
return 0;
Expand Down
2 changes: 2 additions & 0 deletions src/capturable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub mod core_graphics;
#[cfg(target_os = "linux")]
pub mod pipewire;
#[cfg(target_os = "linux")]
#[allow(dead_code)]
pub mod remote_desktop_dbus;
pub mod testsrc;

Expand Down Expand Up @@ -37,6 +38,7 @@ where
/// VirtualScreen: offset_x, offset_y, width, height for a capturable using a virtual screen. (Windows)
pub enum Geometry {
Relative(f64, f64, f64, f64),
#[cfg(target_os = "windows")]
VirtualScreen(i32, i32, u32, u32, i32, i32),
}

Expand Down
Loading

0 comments on commit 18a584b

Please sign in to comment.