mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
HiDPI: fix move_to_edge and snap_to_edge
This commit is contained in:
parent
ed3d0cd523
commit
6f2f79b8d7
1 changed files with 12 additions and 0 deletions
12
src/view.c
12
src/view.c
|
|
@ -333,6 +333,12 @@ view_move_to_edge(struct view *view, const char *direction)
|
||||||
}
|
}
|
||||||
struct border border = view_border(view);
|
struct border border = view_border(view);
|
||||||
struct wlr_box usable = output_usable_area_in_layout_coords(output);
|
struct wlr_box usable = output_usable_area_in_layout_coords(output);
|
||||||
|
if (usable.height == output->wlr_output->height && output->wlr_output->scale != 1) {
|
||||||
|
usable.height /= output->wlr_output->scale;
|
||||||
|
}
|
||||||
|
if (usable.width == output->wlr_output->width && output->wlr_output->scale != 1) {
|
||||||
|
usable.width /= output->wlr_output->scale;
|
||||||
|
}
|
||||||
|
|
||||||
int x = 0, y = 0;
|
int x = 0, y = 0;
|
||||||
if (!strcasecmp(direction, "left")) {
|
if (!strcasecmp(direction, "left")) {
|
||||||
|
|
@ -399,6 +405,12 @@ view_get_edge_snap_box(struct view *view, struct output *output, enum view_edge
|
||||||
{
|
{
|
||||||
struct border border = view_border(view);
|
struct border border = view_border(view);
|
||||||
struct wlr_box usable = output_usable_area_in_layout_coords(output);
|
struct wlr_box usable = output_usable_area_in_layout_coords(output);
|
||||||
|
if (usable.height == output->wlr_output->height && output->wlr_output->scale != 1) {
|
||||||
|
usable.height /= output->wlr_output->scale;
|
||||||
|
}
|
||||||
|
if (usable.width == output->wlr_output->width && output->wlr_output->scale != 1) {
|
||||||
|
usable.width /= output->wlr_output->scale;
|
||||||
|
}
|
||||||
|
|
||||||
int x_offset = edge == VIEW_EDGE_RIGHT
|
int x_offset = edge == VIEW_EDGE_RIGHT
|
||||||
? (usable.width + rc.gap) / 2 : rc.gap;
|
? (usable.width + rc.gap) / 2 : rc.gap;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue