From 61e92fdcfa2ba4fe3f722eb7e75e97d96a09e3b4 Mon Sep 17 00:00:00 2001 From: Amr Bashir <48618675+amrbashir@users.noreply.github.com> Date: Wed, 1 Sep 2021 17:17:24 +0200 Subject: [PATCH] fix: increase borderless resizing inset (#202) * fix: increase borderless resizing inset * update some comments --- .changes/borderless-resizing-inset.md | 4 ++++ src/platform_impl/linux/event_loop.rs | 8 ++++---- src/window.rs | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 .changes/borderless-resizing-inset.md diff --git a/.changes/borderless-resizing-inset.md b/.changes/borderless-resizing-inset.md new file mode 100644 index 000000000..b140273a0 --- /dev/null +++ b/.changes/borderless-resizing-inset.md @@ -0,0 +1,4 @@ +--- +"tao": patch +--- +Increased Borderless window resizing inset. \ No newline at end of file diff --git a/src/platform_impl/linux/event_loop.rs b/src/platform_impl/linux/event_loop.rs index e6ed65625..3c9b03c08 100644 --- a/src/platform_impl/linux/event_loop.rs +++ b/src/platform_impl/linux/event_loop.rs @@ -317,7 +317,7 @@ impl EventLoop { }; } WindowRequest::WireUpEvents => { - // resizing `decorations: false` aka borderless + // Resizing `decorations: false` aka borderless window.add_events( EventMask::POINTER_MOTION_MASK | EventMask::BUTTON1_MOTION_MASK @@ -329,7 +329,6 @@ impl EventLoop { if let Some(window) = window.window() { let (cx, cy) = event.root(); let edge = hit_test(&window, cx, cy); - // FIXME: calling `window.begin_resize_drag` seems to revert the cursor back to normal style window.set_cursor( Cursor::from_name( &window.display(), @@ -358,10 +357,11 @@ impl EventLoop { let (cx, cy) = event.root(); let result = hit_test(&window, cx, cy); - // we ignore the `__Unknown` variant so the window receives the click correctly if it is not on the edges. + // Ignore the `__Unknown` variant so the window receives the click correctly if it is not on the edges. match result { WindowEdge::__Unknown(_) => (), _ => { + // FIXME: calling `window.begin_resize_drag` uses the default cursor, it should show a resizing cursor instead window.begin_resize_drag(result, 1, cx as i32, cy as i32, event.time()) } } @@ -378,7 +378,7 @@ impl EventLoop { if let Some(device) = event.device() { let result = hit_test(&window, cx, cy); - // we ignore the `__Unknown` variant so the window receives the click correctly if it is not on the edges. + // Ignore the `__Unknown` variant so the window receives the click correctly if it is not on the edges. match result { WindowEdge::__Unknown(_) => (), _ => window.begin_resize_drag_for_device( diff --git a/src/window.rs b/src/window.rs index 222d17878..a58c8dc25 100644 --- a/src/window.rs +++ b/src/window.rs @@ -1060,4 +1060,4 @@ impl Default for UserAttentionType { } /// A constant used to determine how much inside the window, the resize handler should appear (only used in Linux(gtk) and Windows). -pub const BORDERLESS_RESIZE_INSET: i32 = 3; +pub const BORDERLESS_RESIZE_INSET: i32 = 5;