Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add Wayland support #55

Open
schmittlauch opened this issue Mar 27, 2014 · 115 comments

Comments

Projects
None yet
@schmittlauch
Copy link

commented Mar 27, 2014

I use a Jolla phone with SailfishOS which already uses Wayland as display server. One thing I'm really missing is color shift in the dark. Is there something similar to the X server extension used for Wayland?

@maandree

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2014

Check if it is possible load xwayland on your phone, it should work transparently then. It does not look like support for colour adjustments have been added to Wayland yet, or at least I have not been able to find the API. Personally I am eagerly waiting for Wayland and Haiku to add colour adjustments support.

@jonls jonls added the enhancement label Mar 31, 2014

@genodeftest

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2014

redshift doesn't work on XWayland (here on Fedora 21 Alpha under wayland/gnome-session) at least without any changes.

According to http://lists.freedesktop.org/archives/wayland-devel/2014-February/ (via: https://en.wikipedia.org/wiki/RandR ) there is a randr extension in wayland since February, but I didn't find any API or cli tool for it.

@maandree

This comment has been minimized.

Copy link
Contributor

commented Oct 17, 2014

Running grep -rni randr over the source code for Wayland and Weston reveals that there is no RandR support merged into either Wayland or Weston. However the reference for Wayland's support in the Wikipedia article contains mailing list posts with patches to add RandR support in Weston, nothing about RandR support in Wayland however (probably elsewhere).

In March I did successfully run Redshift in XWayland, so I don't know what has happened. (Have not retried.)

@ghost

This comment has been minimized.

Copy link

commented Oct 19, 2014

As the OP is running Sailfish I thought it would be worth mentioning that it is now possible to run XWayland on it (http://talk.maemo.org/showthread.php?t=93828&page=2), so if you get the chance please do try if you can get Redshift to work (until it's possible to run Redshift on Wayland directly).

@pazooki

This comment has been minimized.

Copy link

commented Dec 22, 2014

redshift is broken on Fedora 21: Gnome Wayland

~ $ redshift -l 55.7:12.6 -t 5700:3600 -g 0.8 -m vidmode -v &
Location: 55.700001, 12.600000
Temperatures: 5700K at day, 3600K at night
Brightness: 1.00:1.00
Gamma: 0.800, 0.800, 0.800
Xlib:  extension "XFree86-VidModeExtension" missing on display ":1".
X request failed: XF86VidModeQueryVersion
Failed to start adjustment method vidmode
@maandree

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2014

Have you tried -m randr?

@pazooki

This comment has been minimized.

Copy link

commented Dec 22, 2014

Ya:

$ redshift -l 55.7:12.6 -t 5700:3600 -g 0.8 -m randr
Screen 1 could not be found.
Failed to start adjustment method randr.
Job 1, “redshift -l 55.7:12.6 -t 5700:3600 -g 0.8 -m randr &” has ended
@rubdos

This comment has been minimized.

Copy link

commented Dec 22, 2014

I'm also running Sailfish and I'd be interested too in this feature. Any updates on Wayland supporting randr?

@maandree

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2014

@pazooki

Try removing your redshift.conf. Most people with
two or more monitors do not have a "Screen 1",
only "Screen 0"; they usually have a "CRTC 1"
in "Screen 0".

@maandree

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2014

@rubdos

It looks like there still is no support in Wayland and that Weston only supports it but utilising colord.
So it looks like XWayland is still required, which does (or atleast did in March) support RandR.

@pazooki

This comment has been minimized.

Copy link

commented Dec 22, 2014

now it doesn't do anything, it just wait after running the commnad.

@maandree

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2014

Are you running a virtual or physical machine?
Does xgamma or xrandr work for you?

@pazooki

This comment has been minimized.

Copy link

commented Dec 22, 2014

I'm running it on my laptop, it's not a virtual machine.

~ $ redshift -l 55.7:12.6 -t 5700:3600 -g 0.8 -m xrandr
Unknown adjustment method `xrandr'.
~ $ redshift -l 55.7:12.6 -t 5700:3600 -g 0.8 -m xgamma
Unknown adjustment method `xgamma'.
@maandree

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2014

Ok.
I meant to programs xrandr and xgamma. For example xgamma -gamma 0.8.

@pazooki

This comment has been minimized.

Copy link

commented Dec 22, 2014

this is what I'm getting

~ $ xgamma -gamma 0.8
Xlib:  extension "XFree86-VidModeExtension" missing on display ":1".
Unable to query video extension version
~ $ xrandr
Screen 0: minimum 320 x 200, current 1280 x 800, maximum 8192 x 8192
XWAYLAND0 connected 1280x800+0+0 260mm x 160mm
   1280x800@0.1Hz   0.00*+
@maandree

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2014

How about xrandr --output XWAYLAND0 --gamma 0.8:0.8:0.8?

@pazooki

This comment has been minimized.

Copy link

commented Dec 22, 2014

I think that made a difference. no errors

@maandree

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2014

How about redshift -O 4500 -m randr?

@pazooki

This comment has been minimized.

Copy link

commented Dec 22, 2014

it didn't do anything

@maandree

This comment has been minimized.

Copy link
Contributor

commented Dec 22, 2014

That's weird.

@genodeftest

This comment has been minimized.

Copy link
Contributor

commented Dec 23, 2014

$ redshift -l 49:11 -t 3500:4000 works fine under Fedora 21 + X.org – at least for me.

@lispykid

This comment has been minimized.

Copy link

commented Dec 23, 2014

I am also on Jolla. Will see if can test this over the holidays.

@Mikaela

This comment has been minimized.

Copy link

commented Feb 7, 2015

Jolla/Sailfish here too, did anyone test this? Comments only talk about testing, but I don't see successful result.

@giucam

This comment has been minimized.

Copy link

commented Feb 7, 2015

It will not work with xrandr and xwayland, since the screen is managed by the wayland compositor, and there is no wayland protocol to se the color temperature (yet).
http://lists.freedesktop.org/archives/wayland-devel/2015-January/019578.html

@genodeftest

This comment has been minimized.

Copy link
Contributor

commented Mar 6, 2015

Can this (theoretically) be done by gamma factors?

@genodeftest

This comment has been minimized.

Copy link
Contributor

commented Apr 26, 2015

randr and vidmode are not supported on wayland.
Another possibility is using DDC/CI with ddccontrol:
http://ddccontrol.sourceforge.net/
https://github.com/ddccontrol/

@giucam

This comment has been minimized.

Copy link

commented May 2, 2015

I've written the support for some wayland compositors here: giucam@d3f54ed
The thing to be aware of is that it uses a protocol extension not in core Wayland, and at the moment the only compositor i know that implements it is this (wip): https://github.com/giucam/orbital/tree/gamma

This surely could be implemented in lipstick so that would answer the OP's question, however first i think it is necessary to understand the security implications. In the wayland world clients must not have the ability to screw the user interface, and a protocol like that could surely allow clients to do so.
Either we need some way to mark redshift as trusted or some way for the compositor to cope with malicious/bugged clients.

@jonls

This comment has been minimized.

Copy link
Owner

commented May 2, 2015

@giucam That's very cool. It seems that your protocol does gamma adjustments directly. Would it be possible to have the protocol instead only allow adjusting the color temperature or perhaps a color overlay? Perhaps such a scheme could be more easily limited to avoid the security issues?

@giucam

This comment has been minimized.

Copy link

commented May 2, 2015

@jonls It could work with the temperature directly, but i guess that would mean the compositors would need to do what colorramp.c does themselves. I don't really know anything about color management so that was easier for me, but it sure could be possible. I'm not sure that solves the security issue, though.
And not sure what you mean with a color overlay...

Repository owner unlocked this conversation Jan 14, 2017

@auscompgeek

This comment has been minimized.

Copy link

commented Jan 30, 2017

Looks like things are happening on the gnome-settings-daemon side of things: https://bugzilla.gnome.org/show_bug.cgi?id=742149

@auscompgeek

This comment has been minimized.

Copy link

commented Feb 11, 2017

and the UI for it too in gnome-control-center: https://bugzilla.gnome.org/show_bug.cgi?id=778326

@ddevault

This comment has been minimized.

Copy link

commented Feb 21, 2017

sway 0.12-rc1 has been released and includes gamma adjustment support via @giucam's proposed protocol. It would be nice if we could coordinate releases so that we don't have to ask sway users to patch redshift :)

@cyplo

This comment has been minimized.

Copy link

commented Mar 20, 2017

Hello ! Any news/blockers on this one ? thanks a lot !

@maandree

This comment has been minimized.

Copy link
Contributor

commented Mar 20, 2017

You can write a script that every hour quickly switches VT to a TTY runs redshift -o -m drm and switches back to the display. However, you not give you full functionality. I think it's also possible to run Wayland inside X, but I'm not sure your Wayland experience will be that good.

@prahal

This comment has been minimized.

Copy link

commented Apr 3, 2017

Likely obsolete as of now ( well as soon as gnome 3.24 lands) but I mangled a bash script:shift2red-mutter.sh to test if redshift could work on gnome wayland.
It is based on org.gnome.Mutter.DisplayConfig.SetCrtcGamma and redshift.

I did not manage to devote enough time to make it a redshift's method, so I cleaned it up and shared here

@CubeTheThird

This comment has been minimized.

Copy link

commented Apr 4, 2017

I wouldn't say that the gnome 2.24 night settings are entirely a replacement for redshift. As far as I can tell, it doesn't have brightness control (which I personally love). It also seems to adjust the colour temperature based solely on time of day, whereas redshift adjusts according to your geographic location. This means that, regardless of factors such as time of year and daylight-savings (for those who have it), it still adjusts accurately relative to current daylight levels.

@prahal

This comment has been minimized.

Copy link

commented Apr 5, 2017

Here is an implementation for gnome (wayland and likely Xorg too) https://github.com/prahal/redshift/tree/add-gnomerr-method

Internally gnome-desktop-3.0 gnome-rr nowadays calls the mutter dbus api that is semi-private per
https://wiki.gnome.org/Initiatives/Wayland/Gaps/DisplayConfig. This page suggest to use this GnomeRR API from gnome-desktop (even though it is itself tagged unstable).

Tell me if this is of interest to the project even though it is gnome only and not a stable API, and I send the PR. It also adds a dependency on gnome-desktop-3.0 thus gtk-3.0.

Note the "gnomerr" method I implement is lower priority.than default "randr" one.
Thus one need to hardcode it in

; $HOME/.config/redshift.conf 
[redshift]
adjustment-method=gnomerr

or call redshift with the "gnomerr" method explcitely:
redshift -lgeoclue2 -t 6500:4500 -r -m gnomerr

@Thor77

This comment has been minimized.

Copy link

commented Apr 6, 2017

@prahal Wow, that's great! Works perfectly on ArchLinux + Gnome (Wayland) 3.22.2

@aiguofer

This comment has been minimized.

Copy link

commented Apr 14, 2017

@prahal's branch is working great on Fedora 26 alpha with Gnome 3.24.1 on Wayland... this should be pulled in! Although I do understand the concerns of not using a completely open api, I think many people would benefit from having a working option without having to re-compile from his source.

@matysek

This comment has been minimized.

Copy link

commented Apr 18, 2017

@aiguofer Gnome 3.24 introduces new feature "Night Light" https://help.gnome.org/misc/release-notes/3.24/.
Is it similar to redshift or is it anything completely different?

@alexduf

This comment has been minimized.

Copy link

commented Apr 18, 2017

I think it is very similar, but wayland may be used for other DE than gnome, so I suppose this is still relevant (or I missed something)

@aiguofer

This comment has been minimized.

Copy link

commented Apr 18, 2017

@matysek interesting, yeah just tried it out and it seems about the same. It allows you to use sunrise/sunset based on location as well as manual. However, to change temperature it looks like you need to go into dconf and change it.

It also seems like their 4000 is like 2000 on redshift... not sure why the difference

@auscompgeek

This comment has been minimized.

Copy link

commented Apr 19, 2017

GNOME 3.24's Night Light feature doesn't support changing the colour temperature during the day though, only during the night.

@konfou

This comment has been minimized.

Copy link

commented Apr 27, 2017

I ain't sure if it has been mentioned but Lourens-Rich/redshift (found as source to redshift-wayland-git package on Arch AUR) seems to add Wayland support on redshift.

@CubeTheThird

This comment has been minimized.

Copy link

commented Jun 5, 2017

While I haven't had success with the version by Lourens-Rich (getting SEGFAULTS), the method using gnomerr that prahal appears to work. I uploaded it to the AUR under redshift-gnomerr-git in case anyone is interested in trying it.

@konfou

This comment has been minimized.

Copy link

commented Jun 8, 2017

Checking a bit, what I posted is a Sway adaption of Orbital's patch seen at the first comments. The problem is that core Wayland protocol doesn't specify something for color temperature management so everything is based on whether the used compositor implements extensions for that. I don't know if anything has changed.

@breznak

This comment has been minimized.

Copy link

commented Nov 1, 2017

Is anyone solving the problem for KDE/Neon on Wayland side?

Also, how is the development of this package going? I'm considering giving it some time on new feature, but I see a lot of unmerged PRs and opened issues..is the development stalled?

@breznak breznak referenced a pull request that will close this issue Dec 10, 2017

Open

Wayland support PR (updated Lourens rich master) #568

@breznak

This comment has been minimized.

Copy link

commented Dec 12, 2017

This is a new addition to KDE (DE support for Gnome already in place)
https://bugs.kde.org/show_bug.cgi?id=371494
Does this make redshift obsolete for Wayland?

@ddevault

This comment has been minimized.

Copy link

commented Dec 12, 2017

No.

@breznak

This comment has been minimized.

Copy link

commented Jan 10, 2018

@SirCmpwn can you elaborate how is this KDE commit from Dec/2017 different to redshift's functionality?

Roman Gilg 2017-12-11 10:22:53 UTC

Git commit 82d286046907c07050ebb8c8f5c09cb60079c3ae by Roman Gilg.
Committed on 11/12/2017 at 09:58.
Pushed by romangilg into branch 'master'.

[colorcorrection] Night Color - blue light filter at nighttime

With Wayland KWin needs to provide certain services, which were provided
before that by the Xserver. One of these is gamma correction, which includes
the - by many people beloved - functionality to reduce the blue light at
nighttime. This patch provides the KWin part of that. It is self contained,
but in the end will work in tandem with a lib in Plasma Workspace and a KCM
in Plasma Desktop, which can be used to configure Night Color.

* Three modi:
** Automatic: The location and sun timings are determined automatically
   (location data updates will be provided by the workspace)
** Location: The sun timings are determined by fixed location data
** Timings: The sun timings are set manually by the user
* Color temperature value changes are smoothly applied:
** Configuration changes, which lead to other current values are changed
   in a quick way over a few seconds
** Changes on sunrise and sunset are applied slowly over the course of few
   minutes till several hours depending on the configuration
* The current color value is set immediately at startup or after suspend
  phases and VT switches. There is no flickering.
* All configuration is done via a DBus interface, changed values are tested
  on correctness and applied atomically
* Self contained mechanism, speaks directly to the hardware by setting the
  gamma ramps on the CRTC
* Currently working on DRM backend, extensible to other platform backends in
  the future
* The code is written in a way to make the classes later easily extendable to
  also provide normal color correction, as it's currently done by KGamma on X

Test Plan:
Manually with the workspace parts and added integration tests in KWin using
the virtual backend.

Reviewers: #kwin, graesslin

Subscribers: kwin, plasma-devel, #kwin

Tags: #kwin 
@ddevault

This comment has been minimized.

Copy link

commented Jan 10, 2018

Kwin's proprietary gamma correction system, much like GNOME's proprietary gamma correction system, is only relevant in the context of each and not for the broader Wayland ecosystem.

@cecton

This comment has been minimized.

Copy link

commented Aug 15, 2018

There is an app called "Tint Overlay" for SailfishOS. https://openrepos.net/content/coderus/tint-overlay

@claudep

This comment has been minimized.

Copy link

commented Jun 8, 2019

I just wanted to say thanks to @prahal and his gnomerr branch which saved my day (Debian 10 - GNOME 3.30).

@CubeTheThird

This comment has been minimized.

Copy link

commented Jun 8, 2019

Look like there's talks of adding colour profile calibration functionality to Wayland (see here), so we may eventually see redshift working on there too.

@mariusa

This comment has been minimized.

Copy link

commented Jul 5, 2019

More details here, hope these are useful?
https://gitlab.freedesktop.org/wayland/wayland/issues/99

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.