Comments (13)
Alright, it's merged now. Feel free to reopen if there are more screenshot pixel format issues!
from swaylock-effects.
Right, I had a typo in the XBGR conversion. c30e0d5 should fix it.
from swaylock-effects.
I might have some hints about this issue.
I'm using an OBS plugin called wlrobs that has an option to flip red and blue when capturing the screen, to fix this very issue.
You can see how it's implemented here.
I took a quick look at the code of this repo and didn't manage to find something that looked similar, but I don't think it'd be too hard to implement such an option, and it would probably fix the color issue.
from swaylock-effects.
I'm also pretty sure it's a problem with how swaylock-effects detects the pixel format, I might go through the code next week when I've got the time
from swaylock-effects.
Alright, so this isn't actually super surprising. main.c
passes the format
argument it receives from the compositor to the load_background_from_buffer
in background-image.c
, but load_background_from_buffer
then ignores the format and assumes the input is in cairo's CAIRO_FORMAT_RGB24
(aka RGBX in native endianness; calling it "RGB24" is a misnomer IMO, since it still uses 32 bits per pixel, it just ignores 8 of them). If the format is rgbx8888
or rgba8888
, this works, but otherwise it'll look wrong.
Any individual conversion from some pixel format to cairo's RGB24 is easy, but there's a lot of formats; handling all of them would be a ton of code.
The two solutions I see is: A) figure out which pixel formats compositors actually use and add conversions from those, or B) add a dependency on a pixel format conversion library which handles all of them for us. I'm not sure which is better, or, in the case of B, which libraries would be suitable.
from swaylock-effects.
wlrootsβs screen copy example code just supports RGB and BGR (https://github.com/swaywm/wlroots/blob/master/examples/screencopy.c#L62), so just supporting those two pixel formats might be a good start.
from swaylock-effects.
I added pixel format conversion in #49. It should work now, but I don't have a system to test it with (sway on my laptop uses *RGB, not *BGR). Do colors look better with that patch?
from swaylock-effects.
I tried it on my laptop and I'm getting a segfault upon launch, can't tell if it's related to the changes you made in the PR or not π
It works on my desktop system (so it doesn't crash), but this computer didn't have the color shifting problem with the master branch.
from swaylock-effects.
Yeah, sorry about that. I can't test the BGR case on my laptop obviously, but I made sure the RGB case worked... Except I didn't consider the fact that I'm skipping the pixel format conversion entirely if the compositor gives you RGB and your system is little endian. Both the pixel format conversion routines were just broken; it just usually isn't necessary to convert RGB.
5351466 should work better.
from swaylock-effects.
@mortie The pixelformat is still not quite right right on my laptop. Here are screenshots from my laptop on the master branch and on the fix/pixel-format-conversion branch.
fix/pixel-format-conversion branch
from swaylock-effects.
I'm getting very similar results on my side, I disabled the blur effect, here are the screenshots, just in case :
from swaylock-effects.
Indeed, colors are looking good this time ! π
from swaylock-effects.
Can confirm it's fixed on my end as well! π
from swaylock-effects.
Related Issues (20)
- Feature Request: Merge swaylock-mobile HOT 2
- CPU maxed out when running in different TTY
- new effect suggestion: dim HOT 1
- Getting "ext_session_lock_surface_v1@21: error 0: session lock surface has never been configured" after shutting down while locked HOT 3
- Make indicator and image appear simultaneously
- Indicator ring squished in Hyprland HOT 3
- Clock showing UTC instead of local timezone HOT 1
- Have a error code when run swaylock HOT 1
- 100% CPU usage when running swaylock HOT 3
- After updating archlinux to the latest version, a core dumped appears HOT 4
- Coredump when using dpms HOT 2
- Compositor does not support the input inhibitor protocol, refusing to run insecurely HOT 11
- Sugestion - greeter
- Locked account after 3 failed login
- Feature Request : looping custom effects
- unrecognized option? ._. HOT 3
- swaylock --screenshots does not work. HOT 4
- Lockscreen can be unlocked when entering very long password HOT 1
- Doesn't work with latest sway version HOT 14
- Screen flashes when using fade-in
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swaylock-effects.