Skip to content

Commit

Permalink
Wayland Backend: Fix cursor scaling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ehopperdietzel committed Nov 1, 2024
1 parent f121caf commit 7f7836c
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
14 changes: 14 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
Louvre (2.10.1-1)

# Packaging

* Added official Fedora COPR link to the downloads page.

# Bug Fixes

* Wayland Backend: Prevent compositor from exiting when a `wl_output` global is removed.
* Wayland Backend: Fixed cursor scaling issue that made it look oversized on low DPI displays.

-- Eduardo Hopperdietzel <[email protected]> Wed, 31 Oct 2024 23:10:40 -0300


Louvre (2.10.0-1)

# API Additions
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="Louvre is released under the MIT license." />
</a>
<a href="https://github.com/CuarzoSoftware/Louvre">
<img src="https://img.shields.io/badge/version-2.10.0-brightgreen" alt="Current Louvre version." />
<img src="https://img.shields.io/badge/version-2.10.1-brightgreen" alt="Current Louvre version." />
</a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.10.0
2.10.1
2 changes: 1 addition & 1 deletion doxygen/md/Downloads.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Pre-built binaries are provided for the following distributions. Please be aware that their versions may not always match the latest Louvre release.

* **Arch** : [louvre](https://aur.archlinux.org/packages/louvre) - *Thanks to [@TrialnError](https://aur.archlinux.org/account/TrialnError)*.
* **Fedora** : [louvre](https://copr.fedorainfracloud.org/coprs/ngompa/louvre/) - *Thanks to [Neal Gompa](https://github.com/Conan-Kudo)*.
* **Fedora** : [cuarzo-louvre](https://copr.fedorainfracloud.org/coprs/ehopperdietzel/cuarzo/) - *By [Eduardo Hopperdietzel](https://github.com/ehopperdietzel) (always up to date)*.
* **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)*.

## Manual Building
Expand Down
15 changes: 4 additions & 11 deletions pkg/fedora/latest.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%global basever 2.10.0
%global basever 2.10.1
%global origrel 1
%global somajor 2

Expand Down Expand Up @@ -91,13 +91,6 @@ pushd repo/src

%changelog
* Fri Nov 01 2024 Eduardo Hopperdietzel <[email protected]> - %{basever}-%{origrel}
- Added LTexture::setFence() and LRenderBuffer::setFence() to prevent partial updates when used as source textures.
- Added LTexture::setDataFromGL() to enable wrapping of already created OpenGL textures.
- Replaced glFinish() calls with fences, ensuring synchronization without requiring CPU-side waiting.
- Fixed issue of black textures appearing on proprietary NVIDIA drivers (and potentially others). Thanks @renhiyama and @kingdomkind for all your help!
- Fixed synchronization issues between threads that were causing partial texture updates.
- 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!
- Fixed segfault occurring when an idle inhibitor resource was destroyed.
- Wayland Backend: Resolved issue where modifier keys were not released when the window lost focus. Thanks @renhiyama for reporting it!
- Added test to validate support for common texture formats and the synchronization of updates across threads.
- Updated SRM dependency to version >= v0.8.0.
- Added official Fedora COPR link to the downloads page.
- Wayland Backend: Prevent compositor from exiting when a `wl_output` global is removed.
- Wayland Backend: Fixed cursor scaling issue that made it look oversized on low DPI displays.
15 changes: 5 additions & 10 deletions src/backends/graphic/Wayland/LGraphicBackendWayland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1021,14 +1021,6 @@ class Louvre::LGraphicBackend
if (shared.currentCursor)
{
memcpy(shared.currentCursor->map, buffer, LOUVRE_WAYLAND_BACKEND_CURSOR_SIZE);
LSize size { cursor()->rect().size() * shared.bufferScale };

if (size.w() > 64)
size.setW(64);

if (size.h() > 64)
size.setH(64);

wl_surface_attach(shared.cursorSurface, shared.currentCursor->buffer, 0, 0);
}
shared.cursorVisible = true;
Expand All @@ -1053,7 +1045,7 @@ class Louvre::LGraphicBackend
{
prevHotspotB = cursor()->hotspotB();
shared.mutex.lock();
shared.cursorHotspot = cursor()->pos() - cursor()->rect().pos();
shared.cursorHotspot = ((cursor()->pos() - cursor()->rect().pos()) * shared.bufferScale)/2;
shared.cursorChangedHotspot = true;
unlockInputThread();
shared.mutex.unlock();
Expand Down Expand Up @@ -1136,9 +1128,9 @@ class Louvre::LGraphicBackend
if (waylandOutput->name == name)
{
LVectorRemoveOneUnordered(surfaceOutputs, waylandOutputs[i]);
wl_proxy_destroy((wl_proxy*)waylandOutputs[i]);
waylandOutputs[i] = waylandOutputs.back();
waylandOutputs.pop_back();
wl_proxy_destroy((wl_proxy*)waylandOutputs[i]);
delete waylandOutput;
updateSurfaceScale();
return;
Expand Down Expand Up @@ -1176,7 +1168,10 @@ class Louvre::LGraphicBackend
}

if (pendingBufferScale != oldScale)
{
shared.cursorChangedBuffer = true;
outputRepaint(nullptr);
}
}

static void outputHandleMode(void *data, wl_output *, UInt32 /*flags*/, Int32 /*width*/, Int32 /*height*/, Int32 refresh)
Expand Down
2 changes: 1 addition & 1 deletion src/backends/input/Wayland/LInputBackendWayland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class Louvre::LInputBackend
if (shared().cursorChangedBuffer && shared().currentCursor)
{
wl_surface_damage(shared().cursorSurface, 0, 0, 512, 512);
wl_surface_set_buffer_scale(shared().cursorSurface, shared().bufferScale);
wl_surface_set_buffer_scale(shared().cursorSurface, 2);
wl_surface_commit(shared().cursorSurface);
}

Expand Down

0 comments on commit 7f7836c

Please sign in to comment.