Skip to content

Commit 7f7836c

Browse files
Wayland Backend: Fix cursor scaling issues
1 parent f121caf commit 7f7836c

File tree

7 files changed

+27
-25
lines changed

7 files changed

+27
-25
lines changed

CHANGES

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
Louvre (2.10.1-1)
2+
3+
# Packaging
4+
5+
* Added official Fedora COPR link to the downloads page.
6+
7+
# Bug Fixes
8+
9+
* Wayland Backend: Prevent compositor from exiting when a `wl_output` global is removed.
10+
* Wayland Backend: Fixed cursor scaling issue that made it look oversized on low DPI displays.
11+
12+
-- Eduardo Hopperdietzel <ehopperdietzel@gmail.com> Wed, 31 Oct 2024 23:10:40 -0300
13+
14+
115
Louvre (2.10.0-1)
216

317
# API Additions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Louvre is released under the MIT license." />
88
</a>
99
<a href="https://github.com/CuarzoSoftware/Louvre">
10-
<img src="https://img.shields.io/badge/version-2.10.0-brightgreen" alt="Current Louvre version." />
10+
<img src="https://img.shields.io/badge/version-2.10.1-brightgreen" alt="Current Louvre version." />
1111
</a>
1212
</p>
1313

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.10.0
1+
2.10.1

doxygen/md/Downloads.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Pre-built binaries are provided for the following distributions. Please be aware that their versions may not always match the latest Louvre release.
66

77
* **Arch** : [louvre](https://aur.archlinux.org/packages/louvre) - *Thanks to [@TrialnError](https://aur.archlinux.org/account/TrialnError)*.
8-
* **Fedora** : [louvre](https://copr.fedorainfracloud.org/coprs/ngompa/louvre/) - *Thanks to [Neal Gompa](https://github.com/Conan-Kudo)*.
8+
* **Fedora** : [cuarzo-louvre](https://copr.fedorainfracloud.org/coprs/ehopperdietzel/cuarzo/) - *By [Eduardo Hopperdietzel](https://github.com/ehopperdietzel) (always up to date)*.
99
* **NixOS** : [louvre](https://search.nixos.org/packages?channel=unstable&show=louvre&from=0&size=50&sort=relevance&type=packages&query=louvre) - *Thanks to [Marco Rebhan](https://github.com/2xsaiko)*.
1010

1111
## Manual Building

pkg/fedora/latest.spec

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%global basever 2.10.0
1+
%global basever 2.10.1
22
%global origrel 1
33
%global somajor 2
44

@@ -91,13 +91,6 @@ pushd repo/src
9191

9292
%changelog
9393
* Fri Nov 01 2024 Eduardo Hopperdietzel <ehopperdietzel@gmail.com> - %{basever}-%{origrel}
94-
- Added LTexture::setFence() and LRenderBuffer::setFence() to prevent partial updates when used as source textures.
95-
- Added LTexture::setDataFromGL() to enable wrapping of already created OpenGL textures.
96-
- Replaced glFinish() calls with fences, ensuring synchronization without requiring CPU-side waiting.
97-
- Fixed issue of black textures appearing on proprietary NVIDIA drivers (and potentially others). Thanks @renhiyama and @kingdomkind for all your help!
98-
- Fixed synchronization issues between threads that were causing partial texture updates.
99-
- Replaced calls to wl_client_destroy with wl_resource_post_error when an unknown buffer type is committed, which was causing a segmentation fault. Thanks @Ramblurr for reporting it!
100-
- Fixed segfault occurring when an idle inhibitor resource was destroyed.
101-
- Wayland Backend: Resolved issue where modifier keys were not released when the window lost focus. Thanks @renhiyama for reporting it!
102-
- Added test to validate support for common texture formats and the synchronization of updates across threads.
103-
- Updated SRM dependency to version >= v0.8.0.
94+
- Added official Fedora COPR link to the downloads page.
95+
- Wayland Backend: Prevent compositor from exiting when a `wl_output` global is removed.
96+
- Wayland Backend: Fixed cursor scaling issue that made it look oversized on low DPI displays.

src/backends/graphic/Wayland/LGraphicBackendWayland.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,14 +1021,6 @@ class Louvre::LGraphicBackend
10211021
if (shared.currentCursor)
10221022
{
10231023
memcpy(shared.currentCursor->map, buffer, LOUVRE_WAYLAND_BACKEND_CURSOR_SIZE);
1024-
LSize size { cursor()->rect().size() * shared.bufferScale };
1025-
1026-
if (size.w() > 64)
1027-
size.setW(64);
1028-
1029-
if (size.h() > 64)
1030-
size.setH(64);
1031-
10321024
wl_surface_attach(shared.cursorSurface, shared.currentCursor->buffer, 0, 0);
10331025
}
10341026
shared.cursorVisible = true;
@@ -1053,7 +1045,7 @@ class Louvre::LGraphicBackend
10531045
{
10541046
prevHotspotB = cursor()->hotspotB();
10551047
shared.mutex.lock();
1056-
shared.cursorHotspot = cursor()->pos() - cursor()->rect().pos();
1048+
shared.cursorHotspot = ((cursor()->pos() - cursor()->rect().pos()) * shared.bufferScale)/2;
10571049
shared.cursorChangedHotspot = true;
10581050
unlockInputThread();
10591051
shared.mutex.unlock();
@@ -1136,9 +1128,9 @@ class Louvre::LGraphicBackend
11361128
if (waylandOutput->name == name)
11371129
{
11381130
LVectorRemoveOneUnordered(surfaceOutputs, waylandOutputs[i]);
1131+
wl_proxy_destroy((wl_proxy*)waylandOutputs[i]);
11391132
waylandOutputs[i] = waylandOutputs.back();
11401133
waylandOutputs.pop_back();
1141-
wl_proxy_destroy((wl_proxy*)waylandOutputs[i]);
11421134
delete waylandOutput;
11431135
updateSurfaceScale();
11441136
return;
@@ -1176,7 +1168,10 @@ class Louvre::LGraphicBackend
11761168
}
11771169

11781170
if (pendingBufferScale != oldScale)
1171+
{
1172+
shared.cursorChangedBuffer = true;
11791173
outputRepaint(nullptr);
1174+
}
11801175
}
11811176

11821177
static void outputHandleMode(void *data, wl_output *, UInt32 /*flags*/, Int32 /*width*/, Int32 /*height*/, Int32 refresh)

src/backends/input/Wayland/LInputBackendWayland.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ class Louvre::LInputBackend
138138
if (shared().cursorChangedBuffer && shared().currentCursor)
139139
{
140140
wl_surface_damage(shared().cursorSurface, 0, 0, 512, 512);
141-
wl_surface_set_buffer_scale(shared().cursorSurface, shared().bufferScale);
141+
wl_surface_set_buffer_scale(shared().cursorSurface, 2);
142142
wl_surface_commit(shared().cursorSurface);
143143
}
144144

0 commit comments

Comments
 (0)