summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2025-09-03 07:42:45 -0400
committerLuke from DC <[email protected]>2025-09-05 01:45:06 +0000
commit4a2eebdd0f20a9ea4f60d63fe03837f9a39350ba (patch)
tree09aa967bb2d118dc7dd7b8fec4136e96b9915b33
parent1e9133c2c09c30c5cb3ae91786c5f83365ccabd7 (diff)
downloadmarco-4a2eebdd0f20a9ea4f60d63fe03837f9a39350ba.tar.bz2
marco-4a2eebdd0f20a9ea4f60d63fe03837f9a39350ba.tar.xz
theme: Fix left-side Fitt's Law1.28
When calculating the clickable area on the left-most button of a maximized window, we need to take into account the layout components, not just the button size. Fixes mate-desktop/mate-themes#318
-rw-r--r--src/ui/theme.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 60b456a3..dadc9ab8 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -1003,17 +1003,12 @@ meta_frame_layout_calc_geometry (const MetaFrameLayout *layout,
rect->clickable.width = button_width;
rect->clickable.height = button_height;
- if (i == n_right - 1)
+ /* For the last right button on maximized/right-tiled windows, extend clickable area to the top-right edge (Fitts's law)*/
+ if (i == n_right - 1 && (flags & META_FRAME_MAXIMIZED || flags & META_FRAME_TILED_RIGHT))
{
- /* Extend clickable area to the right edge */
+ rect->clickable.y = 0;
rect->clickable.width += layout->right_titlebar_edge + layout->right_width + layout->button_border.right;
-
- /* For maximized and right-tiled windows, extend clickable area to the top edge (Fitts's law)*/
- if (flags & META_FRAME_MAXIMIZED || flags & META_FRAME_TILED_RIGHT)
- {
- rect->clickable.y = 0;
- rect->clickable.height = button_y + button_height;
- }
+ rect->clickable.height = button_y + button_height;
}
}
@@ -1054,12 +1049,12 @@ meta_frame_layout_calc_geometry (const MetaFrameLayout *layout,
rect->clickable.width = button_width;
rect->clickable.height = button_height;
- /* For the first left button on maximized/left-tiled windows, extend to top-left corner (Fitts's law) */
+ /* For the first left button on maximized/left-tiled windows, extend clickable area to top-left corner (Fitts's law) */
if (i == 0 && (flags & META_FRAME_MAXIMIZED || flags & META_FRAME_TILED_LEFT))
{
rect->clickable.x = 0;
rect->clickable.y = 0;
- rect->clickable.width = rect->visible.x + button_width;
+ rect->clickable.width += layout->left_titlebar_edge + layout->left_width + layout->button_border.left;
rect->clickable.height = button_y + button_height;
}
}